IP-TRAFFIC-FLOW-SECURITY-MIB DEFINITIONS ::= BEGIN
   IMPORTS
        MODULE-IDENTITY, OBJECT-TYPE,
        Integer32, Unsigned32, Counter64, mib-2
            FROM SNMPv2-SMI
        CounterBasedGauge64
            FROM  HCNUM-TC
        MODULE-COMPLIANCE, OBJECT-GROUP
            FROM SNMPv2-CONF
        TEXTUAL-CONVENTION,
        TruthValue
            FROM SNMPv2-TC;

   iptfsMIB MODULE-IDENTITY
        LAST-UPDATED "202301310000Z"
        ORGANIZATION "IETF IPsecme Working Group"
        CONTACT-INFO
                "
                   Author: Don Fedyk
                           <mailto:dfedyk@labn.net>

                   Author: Eric Kinzie
                           <mailto:ekinzie@labn.net>"

   DESCRIPTION
      "This module defines the configuration and operational
      state for managing the IP Traffic Flow Security
      functionality (RFC 9349).

      Copyright (c) 2023 IETF Trust and the persons identified
      as authors of the code.  All rights reserved.

      Redistribution and use in source and binary forms,
      with or without modification, is permitted pursuant
      to, and subject to the license terms contained in,
      the Simplified BSD License set forth in Section 4.c
      of the IETF Trust's Legal Provisions Relating to IETF
      Documents (https://trustee.ietf.org/license-info).

      This version of this SNMP MIB module is part of RFC 9349;
      see the RFC itself for full legal notices."

    REVISION "202301310000Z"
    DESCRIPTION
            "Initial revision. Derived from the IP-TFS YANG
            Data Model."
    ::= { mib-2 246}
--
-- Textual Conventions
--

UnsignedShort ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "d"
    STATUS      current
    DESCRIPTION "xs:unsignedShort"
    SYNTAX      Unsigned32 (0 .. 65535)


NanoSeconds ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "d-6"
    STATUS  current
    DESCRIPTION
      "Represents the time unit value in nanoseconds."
    SYNTAX      Integer32


-- Objects, Notifications & Conformances

   iptfsMIBObjects     OBJECT IDENTIFIER
               ::= { iptfsMIB 1 }
   iptfsMIBConformance OBJECT IDENTIFIER
               ::= { iptfsMIB 2}

--
-- IP-TFS MIB Object Groups
--
   iptfsGroup OBJECT IDENTIFIER
              ::= { iptfsMIBObjects 1 }

   ipsecStatsGroup OBJECT IDENTIFIER
              ::= { iptfsMIBObjects 2 }

   iptfsInnerStatsGroup OBJECT IDENTIFIER
              ::= { iptfsMIBObjects 3 }

   iptfsOuterStatsGroup OBJECT IDENTIFIER
              ::= { iptfsMIBObjects 4 }

   iptfsConfigTable OBJECT-TYPE
       SYNTAX     SEQUENCE OF IptfsConfigTableEntry
       MAX-ACCESS not-accessible
       STATUS     current
       DESCRIPTION
               "The table containing configuration information for
               IP-TFS."
       ::= { iptfsGroup 1 }

   iptfsConfigTableEntry OBJECT-TYPE
       SYNTAX     IptfsConfigTableEntry
       MAX-ACCESS not-accessible
       STATUS     current
       DESCRIPTION
         "An entry (conceptual row) containing the information on
         a particular IP-TFS SA."
       INDEX      { iptfsConfigSaIndex }
       ::= { iptfsConfigTable 1 }

  IptfsConfigTableEntry ::= SEQUENCE {
      iptfsConfigSaIndex         Integer32,

   -- identifier information
      congestionControl          TruthValue,
      usePathMtuDiscovery        TruthValue,
      outerPacketSize            UnsignedShort,
      l2FixedRate                CounterBasedGauge64,
      l3FixedRate                CounterBasedGauge64,
      dontFragment               TruthValue,
      maxAggregationTime         NanoSeconds,
      windowSize                 UnsignedShort,
      sendImmediately            TruthValue,
      lostPacketTimerInterval    NanoSeconds
   }

   iptfsConfigSaIndex OBJECT-TYPE
       SYNTAX      Integer32 (1..16777215)
       MAX-ACCESS  not-accessible
       STATUS      current
       DESCRIPTION
         "A unique value, greater than zero, for each SA.
         It is recommended that values are assigned contiguously,
         starting from 1.

         The value for each entry must remain constant at least
         from one re-initialization of an entity's network management
         system to the next re-initialization."
       ::= { iptfsConfigTableEntry 1 }

    congestionControl OBJECT-TYPE
        SYNTAX      TruthValue
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "When set to true, the default, this enables the
          congestion control on-the-wire exchange of data that is
          required by congestion control algorithms, as defined by
          RFC 5348.  When set to false, IP-TFS sends fixed-sized
          packets over an IP-TFS tunnel at a constant rate."
        ::= { iptfsConfigTableEntry 2 }

    usePathMtuDiscovery OBJECT-TYPE
        SYNTAX      TruthValue
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "Packet size is either auto-discovered or manually
          configured.  If usePathMtuDiscovery is true, the system
          utilizes path-mtu to determine the maximum IP-TFS packet
          size.  If the packet size is explicitly configured,
          then it will only be adjusted downward if use-path-mtu
          is set."
        ::= { iptfsConfigTableEntry 3 }

    outerPacketSize OBJECT-TYPE
        SYNTAX      UnsignedShort
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "On transmission, the size of the outer encapsulating
          tunnel packet (i.e., the IP packet containing
          Encapsulating Security Payload)."
        ::= { iptfsConfigTableEntry 4 }

    l2FixedRate OBJECT-TYPE
        SYNTAX      CounterBasedGauge64
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "The IP-TFS bit rate may be specified as a layer 2 wire
          rate.  On transmission, the target bandwidth/bit rate in
          bits per second (bps) for the IP-TFS tunnel.  This rate is
          the nominal timing for the fixed-size packet.  If
          congestion control is enabled, the rate may be adjusted
          down."
        ::= { iptfsConfigTableEntry 5 }

    l3FixedRate OBJECT-TYPE
        SYNTAX      CounterBasedGauge64
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "The IP-TFS bit rate may be specified as a layer 3 packet
          rate.  On transmission, the target bandwidth/bit rate in
          bps for the IP-TFS tunnel.  This rate is the nominal timing
          for the fixed-size packet.  If congestion control is
          enabled, the rate may be adjusted down."
        ::= { iptfsConfigTableEntry 6 }

    dontFragment OBJECT-TYPE
        SYNTAX      TruthValue
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "On transmission, disable packet fragmentation across
          consecutive IP-TFS tunnel packets; inner packets larger
          than what can be transmitted in outer packets will be
          dropped."
        ::= { iptfsConfigTableEntry 7 }

    maxAggregationTime OBJECT-TYPE
        SYNTAX      NanoSeconds
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "On transmission, the maximum aggregation time is the
           maximum length of time a received inner packet can be
           held prior to transmission in the IP-TFS tunnel.  Inner
           packets that would be held longer than this time, based
           on the current tunnel configuration, will be dropped
           rather than be queued for transmission."
        ::= { iptfsConfigTableEntry 8 }

    windowSize OBJECT-TYPE
        SYNTAX      UnsignedShort
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "On reception, the maximum number of out-of-order
          packets that will be reordered by an IP-TFS receiver
          while performing the reordering operation.  The value 0
          disables any reordering."
        ::= { iptfsConfigTableEntry 9 }

    sendImmediately OBJECT-TYPE
        SYNTAX      TruthValue
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "On reception, send inner packets as soon as possible; do
          not wait for lost or misordered outer packets.
          Selecting this option reduces the inner (user) packet
          delay but can amplify out-of-order delivery of the inner
          packet stream in the presence of packet aggregation and
          any reordering."
        ::= { iptfsConfigTableEntry 10 }

    lostPacketTimerInterval OBJECT-TYPE
        SYNTAX      NanoSeconds
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
          "On reception, this interval defines the length of time
          an IP-TFS receiver will wait for a missing packet before
          considering it lost.  If not using send-immediately,
          then each lost packet will delay inner (user) packets
          until this timer expires.  Setting this value too low can
          impact reordering and reassembly."
        ::= { iptfsConfigTableEntry 11 }

   ipsecStatsTable OBJECT-TYPE
       SYNTAX     SEQUENCE OF IpsecStatsTableEntry
       MAX-ACCESS not-accessible
       STATUS     current
       DESCRIPTION
         "The table containing basic statistics on IPsec."
       ::= { ipsecStatsGroup 1 }


    ipsecStatsTableEntry OBJECT-TYPE
       SYNTAX     IpsecStatsTableEntry
       MAX-ACCESS not-accessible
       STATUS     current
       DESCRIPTION
         "An entry (conceptual row) containing the information on
         a particular IKE SA."
       INDEX      { ipsecSaIndex }
       ::= { ipsecStatsTable 1 }

     IpsecStatsTableEntry ::= SEQUENCE {
     ipsecSaIndex               Integer32,
-- packet statistics information
     txPkts                     Counter64,
     txOctets                   Counter64,
     txDropPkts                 Counter64,
     rxPkts                     Counter64,
     rxOctets                   Counter64,
     rxDropPkts                 Counter64
   }

   ipsecSaIndex OBJECT-TYPE
      SYNTAX      Integer32 (1..16777215)
      MAX-ACCESS  not-accessible
      STATUS      current
      DESCRIPTION
        "A unique value, greater than zero, for each SA.
        It is recommended that values are assigned contiguously,
        starting from 1.

        The value for each entry must remain constant at least
        from one re-initialization of an entity's network management
        system to the next re-initialization."
      ::= { ipsecStatsTableEntry 1 }


   txPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Outbound Packet count."
       ::= { ipsecStatsTableEntry 2 }

   txOctets OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Outbound Packet bytes."
       ::= { ipsecStatsTableEntry 3 }

   txDropPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Outbound dropped packets count."
       ::= { ipsecStatsTableEntry 4 }

   rxPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Inbound Packet count."
       ::= { ipsecStatsTableEntry 5 }

   rxOctets OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Inbound Packet bytes."
       ::= { ipsecStatsTableEntry 6 }

   rxDropPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Inbound dropped packets."
       ::= { ipsecStatsTableEntry 7 }

   iptfsInnerStatsTable OBJECT-TYPE
       SYNTAX     SEQUENCE OF IptfsInnerStatsSaEntry
       MAX-ACCESS not-accessible
       STATUS     current
       DESCRIPTION
         "The table containing information on IP-TFS
         inner packets."
       ::= { iptfsInnerStatsGroup 1 }

   iptfsInnerStatsTableEntry OBJECT-TYPE
      SYNTAX     IptfsInnerStatsSaEntry
      MAX-ACCESS not-accessible
      STATUS     current
      DESCRIPTION
        "An entry containing the information on
        a particular IP-TFS SA."
      INDEX      { iptfsInnerSaIndex }
      ::= { iptfsInnerStatsTable 1 }

     IptfsInnerStatsSaEntry ::= SEQUENCE {
     iptfsInnerSaIndex          Integer32,

     txInnerPkts                Counter64,
     txInnerOctets              Counter64,
     rxInnerPkts                Counter64,
     rxInnerOctets              Counter64,
     rxIncompleteInnerPkts      Counter64
    }

   iptfsInnerSaIndex OBJECT-TYPE
      SYNTAX      Integer32 (1..16777215)
      MAX-ACCESS  not-accessible
      STATUS      current
      DESCRIPTION
        "A unique value, greater than zero, for each SA.
        It is recommended that values are assigned contiguously,
        starting from 1.

        The value for each entry must remain constant at least
        from one re-initialization of an entity's network management
        system to the next re-initialization."
      ::= { iptfsInnerStatsTableEntry 1 }

   txInnerPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of IP-TFS inner packets sent.  This count
         is whole packets only.  A fragmented packet counts as
         one packet."
       ::= { iptfsInnerStatsTableEntry 2 }

   txInnerOctets OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of IP-TFS inner octets sent.  This is
         inner packet octets only.  This does not count padding."
       ::= { iptfsInnerStatsTableEntry 3 }

   rxInnerPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of IP-TFS inner packets received."
       ::= { iptfsInnerStatsTableEntry 4 }

       rxInnerOctets OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of IP-TFS inner octets received.  This does
         not include padding or overhead."
       ::= { iptfsInnerStatsTableEntry 5 }

   rxIncompleteInnerPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of IP-TFS inner packets that were
         incomplete.  Usually, this is due to fragments not
         received.  Also, this may be due to misordering or
         errors in received outer packets."
    ::= { iptfsInnerStatsTableEntry 6 }

  iptfsOuterStatsTable OBJECT-TYPE
       SYNTAX     SEQUENCE OF IptfsOuterStatsSaEntry
       MAX-ACCESS not-accessible
       STATUS     current
       DESCRIPTION
         "The table containing information on IP-TFS."
       ::= { iptfsOuterStatsGroup 1 }

   iptfsOuterStatsTableEntry OBJECT-TYPE
      SYNTAX     IptfsOuterStatsSaEntry
      MAX-ACCESS not-accessible
      STATUS     current
      DESCRIPTION
        "An entry containing the information on
        a particular IP-TFS SA."
      INDEX      { iptfsOuterSaIndex }
      ::= { iptfsOuterStatsTable 1 }

     IptfsOuterStatsSaEntry ::= SEQUENCE {
     iptfsOuterSaIndex               Integer32,

  -- iptfs packet statistics information
     txExtraPadPkts             Counter64,
     txExtraPadOctets           Counter64,
     txAllPadPkts               Counter64,
     txAllPadOctets             Counter64,
     rxExtraPadPkts             Counter64,
     rxExtraPadOctets           Counter64,
     rxAllPadPkts               Counter64,
     rxAllPadOctets             Counter64,
     rxErroredPkts              Counter64,
     rxMissedPkts               Counter64
    }


   iptfsOuterSaIndex OBJECT-TYPE
      SYNTAX      Integer32 (1..16777215)
      MAX-ACCESS  not-accessible
      STATUS      current
      DESCRIPTION
        "A unique value, greater than zero, for each SA.
        It is recommended that values are assigned contiguously,
        starting from 1.

        The value for each entry must remain constant at least
        from one re-initialization of an entity's network management
        system to the next re-initialization."
      ::= { iptfsOuterStatsTableEntry 1 }

   txExtraPadPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of transmitted outer IP-TFS packets that
         included some padding."
       ::= { iptfsOuterStatsTableEntry 2 }

   txExtraPadOctets OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of transmitted octets of padding added to
         outer IP-TFS packets with data."
       ::= { iptfsOuterStatsTableEntry 3 }

   txAllPadPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of transmitted IP-TFS packets that were
         all padding with no inner packet data."
       ::= { iptfsOuterStatsTableEntry 4 }

   txAllPadOctets OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number transmitted octets of padding added to
         IP-TFS packets with no inner packet data."
       ::= { iptfsOuterStatsTableEntry 5 }

   rxExtraPadPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of received outer IP-TFS packets that
         included some padding."
       ::= { iptfsOuterStatsTableEntry 6 }

   rxExtraPadOctets OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of received octets of padding added to
         outer IP-TFS packets with data."
       ::= { iptfsOuterStatsTableEntry 7 }

   rxAllPadPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of received IP-TFS packets that were all
         padding with no inner packet data."
       ::= { iptfsOuterStatsTableEntry 8 }

   rxAllPadOctets OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number received octets of padding added to
         IP-TFS packets with no inner packet data."
       ::= { iptfsOuterStatsTableEntry 9 }

   rxErroredPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of IP-TFS outer packets dropped due to
         errors."
       ::= { iptfsOuterStatsTableEntry 10 }

   rxMissedPkts OBJECT-TYPE
       SYNTAX      Counter64
       MAX-ACCESS  read-only
       STATUS      current
       DESCRIPTION
         "Total number of IP-TFS outer packets missing indicated
         by a missing sequence number."
       ::= { iptfsOuterStatsTableEntry 11 }

--
-- Iptfs Module Compliance
--

iptfsMIBConformances OBJECT IDENTIFIER
                    ::= { iptfsMIBConformance 1 }

iptfsMIBGroups OBJECT IDENTIFIER
                    ::= { iptfsMIBConformance 2 }

iptfsMIBCompliance MODULE-COMPLIANCE
        STATUS  current
        DESCRIPTION
                "The compliance statement for entities that
                implement the IP-TFS MIB."
        MODULE  -- this module
                MANDATORY-GROUPS {
                 iptfsMIBConfGroup,
                 ipsecStatsConfGroup,
                 iptfsInnerStatsConfGroup,
                 iptfsOuterStatsConfGroup
                }

        ::= { iptfsMIBConformances 1 }

--
-- MIB Groups (Units of Conformance)
--

iptfsMIBConfGroup OBJECT-GROUP
        OBJECTS {
                congestionControl,
                usePathMtuDiscovery,
                outerPacketSize ,
                l2FixedRate ,
                l3FixedRate ,
                dontFragment,
                maxAggregationTime,
                windowSize,
                sendImmediately,
                lostPacketTimerInterval
        }
        STATUS  current
        DESCRIPTION
                "A collection of objects providing per SA IP-TFS
                configuration."
        ::= { iptfsMIBGroups 1 }

ipsecStatsConfGroup OBJECT-GROUP
        OBJECTS {
                txPkts,
                txOctets,
                txDropPkts,
                rxPkts,
                rxOctets,
                rxDropPkts
        }
        STATUS  current
        DESCRIPTION
          "A collection of objects providing per SA basic
          statistics."
        ::= { iptfsMIBGroups 2 }

iptfsInnerStatsConfGroup OBJECT-GROUP
        OBJECTS {
                txInnerPkts,
                txInnerOctets,
                rxInnerPkts,
                rxInnerOctets,
                rxIncompleteInnerPkts
        }
        STATUS  current
        DESCRIPTION
          "A collection of objects providing per SA IP-TFS
          inner packet statistics."
        ::= { iptfsMIBGroups 3 }


iptfsOuterStatsConfGroup OBJECT-GROUP
        OBJECTS {
                txExtraPadPkts,
                txExtraPadOctets,
                txAllPadPkts,
                txAllPadOctets,
                rxExtraPadPkts,
                rxExtraPadOctets,
                rxAllPadPkts,
                rxAllPadOctets,
                rxErroredPkts,
                rxMissedPkts
        }
        STATUS  current
        DESCRIPTION
          "A collection of objects providing per SA IP-TFS
          outer packet statistics."
        ::= { iptfsMIBGroups 4 }

END
