netconfcentral logo

ietf-packet-fields

HTML

ietf-packet-fields@2017-10-03



  module ietf-packet-fields {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-packet-fields";

    prefix packet-fields;

    import ietf-inet-types {
      prefix inet;
    }
    import ietf-yang-types {
      prefix yang;
    }
    import ietf-ethertypes {
      prefix eth;
    }

    organization
      "IETF NETMOD (NETCONF Data Modeling Language) Working
     Group";

    contact
      "WG Web: http://tools.ietf.org/wg/netmod/
     WG List: netmod@ietf.org

     Editor: Mahesh Jethanandani
             mjethanandani@gmail.com
     Editor: Lisa Huang
             lyihuang16@gmail.com
     Editor: Sonal Agarwal
             agarwaso@cisco.com
     Editor: Dana Blair
             dblair@cisco.com";

    description
      "This YANG module defines groupings that are used by
    ietf-access-control-list YANG module. Their usage is not
    limited to ietf-access-control-list and can be
    used anywhere as applicable.
    Copyright (c) 2017 IETF Trust and the persons identified as
    the document authors.  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
    (http://trustee.ietf.org/license-info).
    This version of this YANG module is part of RFC XXXX; see
    the RFC itself for full legal notices.";

    revision "2017-10-03" {
      description
        "Added header fields for TCP, UDP, and ICMP.";
      reference
        "RFC XXX: Network Access Control List (ACL) YANG Data Model.";

    }


    typedef operator {
      type enumeration {
        enum "lt" {
          value 0;
          description "Less than.";
        }
        enum "gt" {
          value 1;
          description "Greater than.";
        }
        enum "eq" {
          value 2;
          description "Equal to.";
        }
        enum "neq" {
          value 3;
          description "Not equal to.";
        }
      }
      description
        "The source and destination port range definitions
       can be further qualified using an operator. An
       operator is needed only if lower-port is specified
       and upper-port is not specified. The operator
       therefore further qualifies lower-port only.";
    }

    grouping acl-transport-header-fields {
      description "Transport header fields";
      container source-port-range {
        presence
          "Enables setting source port range";
        description
          "Inclusive range representing source ports to be used.
         When only lower-port is present, it represents a single
         port and eq operator is assumed to be default.

         When both lower-port and upper-port are specified,
         it implies a range inclusive of both values.

         If no port is specified, 'any' (wildcard) is assumed.";
        leaf lower-port {
          type inet:port-number;
          mandatory true;
          description
            "Lower boundary for port.";
        }

        leaf upper-port {
          type inet:port-number;
          must ". >= ../lower-port" {
            error-message
              "The upper-port must be greater than or equal
           to lower-port";
          }
          description
            "Upper boundary for port. If it exists, the upper port
           must be greater or equal to lower-port.";
        }

        leaf operation {
          type operator;
          must
            "(../lower-port and not(../upper-port))" {
            error-message
              "If lower-port is specified, and an operator is also
             specified, then upper-port should not be specified.";
            description
              "If lower-port is specified, and an operator is also
             specified, then upper-port should not be specified.";
          }
          default 'eq';
          description
            "Operator to be applied on the lower-port.";
        }
      }  // container source-port-range

      container destination-port-range {
        presence
          "Enables setting destination port range";
        description
          "Inclusive range representing destination ports to be used.
         When only lower-port is present, it represents a single
         port and eq operator is assumed to be default.

         When both lower-port and upper-port are specified,
         it implies a range inclusive of both values.

         If no port is specified, 'any' (wildcard) is assumed. ";
        leaf lower-port {
          type inet:port-number;
          mandatory true;
          description
            "Lower boundary for port.";
        }

        leaf upper-port {
          type inet:port-number;
          must ". >= ../lower-port" {
            error-message
              "The upper-port must be greater than or equal
             to lower-port";
          }
          description
            "Upper boundary for port. If existing, the upper port must
          be greater or equal to lower-port";
        }

        leaf operations {
          type operator;
          must
            "(../lower-port and not(../upper-port))" {
            error-message
              "If lower-port is specified, and an operator is also
             specified, then upper-port should not be specified.";
            description
              "If lower-port is specified, and an operator is also
             specified, then upper-port should not be specified.";
          }
          default 'eq';
          description
            "Operator to be applied on the lower-port.";
        }
      }  // container destination-port-range
    }  // grouping acl-transport-header-fields

    grouping acl-ip-header-fields {
      description
        "IP header fields common to ipv4 and ipv6";
      reference
        "RFC 791.";

      leaf dscp {
        type inet:dscp;
        description
          "Differentiated Services Code Point.";
        reference
          "RFC 2474: Definition of Differentiated services field
          (DS field) in the IPv4 and IPv6 headers.";

      }

      leaf ecn {
        type uint8 {
          range "0..3";
        }
        description
          "Explicit Congestion Notification.";
        reference
          "RFC 3168.";

      }

      leaf length {
        type uint16;
        description
          "In IPv4 header field, this field is known as the Total Length.
         Total Length is the length of the datagram, measured in octets,
         including internet header and data.

         In IPv6 header field, this field is known as the Payload
         Length, the length of the IPv6 payload, i.e. the rest of
         the packet following the IPv6 header, in octets.";
        reference
          "RFC 719, RFC 2460";

      }

      leaf ttl {
        type uint8;
        description
          "This field indicates the maximum time the datagram is allowed
         to remain in the internet system.  If this field contains the
         value zero, then the datagram must be destroyed.

         In IPv6, this field is known as the Hop Limit.";
        reference
          "RFC 719, RFC 2460";

      }

      leaf protocol {
        type uint8;
        description
          "Internet Protocol number.";
      }

      uses acl-transport-header-fields;
    }  // grouping acl-ip-header-fields

    grouping acl-ipv4-header-fields {
      description "Fields in IPv4 header.";
      leaf ihl {
        type uint8 {
          range "5..60";
        }
        description
          "An IPv4 header field, the Internet Header Length (IHL) is
         the length of the internet header in 32 bit words, and
         thus points to the beginning of the data. Note that the
         minimum value for a correct header is 5.";
      }

      leaf flags {
        type bits {
          bit reserved {
            position 0;
            description
              "Reserved. Must be zero.";
          }
          bit fragment {
            position 1;
            description
              "Setting value to 0 indicates may fragment, while setting
             the value to 1 indicates do not fragment.";
          }
          bit more {
            position 2;
            description
              "Setting the value to 0 indicates this is the last fragment,
             and setting the value to 1 indicates more fragments are
             coming.";
          }
        }
        description
          "Bit definitions for the flags field in IPv4 header.";
      }

      leaf offset {
        type uint16 {
          range "20..65535";
        }
        description
          "The fragment offset is measured in units of 8 octets (64 bits).
         The first fragment has offset zero. The length is 13 bits";
      }

      leaf identification {
        type uint16;
        description
          "An identifying value assigned by the sender to aid in
         assembling the fragments of a datagram.";
      }

      leaf destination-ipv4-network {
        type inet:ipv4-prefix;
        description
          "Destination IPv4 address prefix.";
      }

      leaf source-ipv4-network {
        type inet:ipv4-prefix;
        description
          "Source IPv4 address prefix.";
      }
    }  // grouping acl-ipv4-header-fields

    grouping acl-ipv6-header-fields {
      description "Fields in IPv6 header";
      reference
        "RFC 4291: IP Version 6 Addressing Architecture
         RFC 4007: IPv6 Scoped Address Architecture
         RFC 5952: A Recommendation for IPv6 Address Text
        	  Representation";

      leaf next-header {
        type uint8;
        description
          "Identifies the type of header immediately following the
         IPv6 header. Uses the same values as the IPv4 Protocol
         field.";
        reference
          "RFC 2460";

      }

      leaf destination-ipv6-network {
        type inet:ipv6-prefix;
        description
          "Destination IPv6 address prefix.";
      }

      leaf source-ipv6-network {
        type inet:ipv6-prefix;
        description
          "Source IPv6 address prefix.";
      }

      leaf flow-label {
        type inet:ipv6-flow-label;
        description "IPv6 Flow label.";
      }
    }  // grouping acl-ipv6-header-fields

    grouping acl-eth-header-fields {
      description
        "Fields in Ethernet header.";
      reference
        "IEEE 802: IEEE Standard for Local and Metropolitan
        Area Networks: Overview and Architecture.";

      leaf destination-mac-address {
        type yang:mac-address;
        description
          "Destination IEEE 802 MAC address.";
      }

      leaf destination-mac-address-mask {
        type yang:mac-address;
        description
          "Destination IEEE 802 MAC address mask.";
      }

      leaf source-mac-address {
        type yang:mac-address;
        description
          "Source IEEE 802 MAC address.";
      }

      leaf source-mac-address-mask {
        type yang:mac-address;
        description
          "Source IEEE 802 MAC address mask.";
      }

      leaf ethertype {
        type eth:ethertype;
        description
          "The Ethernet Type (or Length) value represented
         in the canonical order defined by IEEE 802.
         The canonical representation uses lowercase
         characters.";
        reference
          "IEEE 802-2014 Clause 9.2";

      }
    }  // grouping acl-eth-header-fields

    grouping acl-tcp-header-fields {
      description
        "Collection of TCP header fields that can be used to
       setup a match filter.";
      leaf sequence-number {
        type uint32;
        description
          "Sequence number that appears in the packet.";
      }

      leaf acknowledgement-number {
        type uint32;
        description
          "The acknowledgement number that appears in the
         packet.";
      }

      leaf data-offset {
        type uint8 {
          range "5..15";
        }
        description
          "Specifies the size of the TCP header in 32-bit
         words. The minimum size header is 5 words and
         the maximum is 15 words thus giving the minimum
         size of 20 bytes and maximum of 60 bytes,
         allowing for up to 40 bytes of options in the
         header.";
      }

      leaf reserved {
        type uint8;
        description
          "Reserved for future use.";
      }

      leaf flags {
        type bits {
          bit ns {
            position 0;
            description
              "ECN-nonce concealment protection";
            reference
              "RFC 3540).";

          }
          bit cwr {
            position 1;
            description
              "Congestion Window Reduced (CWR) flag is set by
             the sending host to indicate that it received
             a TCP segment with the ECE flag set and had
             responded in congestion control mechanism.";
            reference
              "RFC 3168";

          }
          bit ece {
            position 2;
            description
              "ECN-Echo has a dual role, depending on the value
             of the SYN flag. It indicates:
             If the SYN flag is set (1), that the TCP peer is ECN
             capable. If the SYN flag is clear (0), that a packet
             with Congestion Experienced flag set (ECN=11) in IP
             header was received during normal transmission
             (added to header by RFC 3168). This serves as an
             indication of network congestion (or impending
             congestion) to the TCP sender.";
          }
          bit urg {
            position 3;
            description
              "Indicates that the Urgent pointer field is significant.";
          }
          bit ack {
            position 4;
            description
              "Indicates that the Acknowledgment field is significant.
             All packets after the initial SYN packet sent by the
             client should have this flag set.";
          }
          bit psh {
            position 5;
            description
              "Push function. Asks to push the buffered data to the
             receiving application.";
          }
          bit rst {
            position 6;
            description
              "Reset the connection.";
          }
          bit syn {
            position 7;
            description
              "Synchronize sequence numbers. Only the first packet
             sent from each end should have this flag set. Some
             other flags and fields change meaning based on this
             flag, and some are only valid for when it is set,
             and others when it is clear.";
          }
          bit fin {
            position 8;
            description
              "Last package from sender.";
          }
        }
        description
          "Also known as Control Bits. Contains 9 1-bit flags.";
      }

      leaf window-size {
        type uint16;
        description
          "The size of the receive window, which specifies
         the number of window size units (by default,
         bytes) (beyond the segment identified by the
         sequence number in the acknowledgment field)
         that the sender of this segment is currently
         willing to receive.";
      }

      leaf urgent-pointer {
        type uint16;
        description
          "This field is an offset from the sequence number
         indicating the last urgent data byte.";
      }

      leaf options {
        type uint32;
        description
          "The length of this field is determined by the
         data offset field. Options have up to three
         fields: Option-Kind (1 byte), Option-Length
         (1 byte), Option-Data (variable). The Option-Kind
         field indicates the type of option, and is the
         only field that is not optional. Depending on
         what kind of option we are dealing with,
         the next two fields may be set: the Option-Length
         field indicates the total length of the option,
         and the Option-Data field contains the value of
         the option, if applicable.";
      }
    }  // grouping acl-tcp-header-fields

    grouping acl-udp-header-fields {
      description
        "Collection of UDP header fields that can be used
       to setup a match filter.";
      leaf length {
        type uint16;
        description
          "A field that specifies the length in bytes of
         the UDP header and UDP data. The minimum
         length is 8 bytes because that is the length of
         the header. The field size sets a theoretical
         limit of 65,535 bytes (8 byte header + 65,527
         bytes of data) for a UDP datagram. However the
         actual limit for the data length, which is
         imposed by the underlying IPv4 protocol, is
         65,507 bytes (65,535 minus 8 byte UDP header
         minus 20 byte IP header).

         In IPv6 jumbograms it is possible to have
         UDP packets of size greater than 65,535 bytes.
         RFC 2675 specifies that the length field is set
         to zero if the length of the UDP header plus
         UDP data is greater than 65,535.";
      }
    }  // grouping acl-udp-header-fields

    grouping acl-icmp-header-fields {
      description
        "Collection of ICMP header fields that can be
       used to setup a match filter.";
      leaf type {
        type uint8;
        description
          "Also known as Control messages.";
        reference
          "RFC 792";

      }

      leaf code {
        type uint8;
        description
          "ICMP subtype. Also known as Control messages.";
      }

      leaf rest-of-header {
        type uint32;
        description
          "Four-bytes field, contents vary based on the
         ICMP type and code.";
      }
    }  // grouping acl-icmp-header-fields
  }  // module ietf-packet-fields

Summary

  
ietf-packet-fields  
  
Organization IETF NETMOD (NETCONF Data Modeling Language) Working Group
  
Module ietf-packet-fields
Version 2015-06-11
File ietf-packet-fields.yang
  
Prefix packet-fields
Namespace urn:ietf:params:xml:ns:yang:ietf-packet-fields
  
Cooked /cookedmodules/ietf-packet-fields/2015-06-11
YANG /src/ietf-packet-fields@2015-06-11.yang
XSD /xsd/ietf-packet-fields@2015-06-11.xsd
  
Abstract This YANG module defines groupings that are used by ietf-access-control-list YANG module. Their usage is not limited to ietf-acc...
  
Contact
WG Web: http://tools.ietf.org/wg/netmod/
WG List: netmod@ietf.org
WG Chair: Juergen Schoenwaelder
j.schoenwaelder@jacobs-university.de
WG Chair: Tom Nadeau
tnadeau@lucidvision.com
Editor: Dean Bogdanovic
deanb@juniper.net
Editor: Kiran Agrahara Sreenivasa
kkoushik@brocade.com
Editor: Lisa Huang
lyihuang@juniper.net
Editor: Dana Blair
dblair@cisco.com
  
ietf-packet-fields  
  
Organization IETF NETMOD (NETCONF Data Modeling Language) Working Group
  
Module ietf-packet-fields
Version 2017-10-03
File ietf-packet-fields@2017-10-03.yang
  
Prefix packet-fields
Namespace urn:ietf:params:xml:ns:yang:ietf-packet-fields
  
Cooked /cookedmodules/ietf-packet-fields/2017-10-03
YANG /src/ietf-packet-fields@2017-10-03.yang
XSD /xsd/ietf-packet-fields@2017-10-03.xsd
  
Abstract This YANG module defines groupings that are used by ietf-access-control-list YANG module. Their usage is not limited to ietf-acc...
  
Contact
WG Web: http://tools.ietf.org/wg/netmod/
WG List: netmod@ietf.org

Editor: Mahesh Jethanandani
	mjethanandani@gmail.com
Editor: Lisa Huang
	lyihuang16@gmail.com
Editor: Sonal Agarwal
	agarwaso@cisco.com
Editor: Dana Blair
	dblair@cisco.com

Description

 
ietf-packet-fields
This YANG module defines groupings that are used by
ietf-access-control-list YANG module. Their usage is not
limited to ietf-access-control-list and can be
used anywhere as applicable.
Copyright (c) 2015 IETF Trust and the persons identified as
the document authors.  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
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.
 
ietf-packet-fields
This YANG module defines groupings that are used by
ietf-access-control-list YANG module. Their usage is not
limited to ietf-access-control-list and can be
used anywhere as applicable.
Copyright (c) 2017 IETF Trust and the persons identified as
the document authors.  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
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.

Typedefs

Typedef Base type Abstract
operator enumeration The source and destination port range definitions can be further qualified using an operator. An operator is needed only if lower-port is specified and upper-port is not specified. The operator therefore further qualifies lower-port only.

Groupings

Grouping Objects Abstract
acl-eth-header-fields destination-mac-address destination-mac-address-mask source-mac-address source-mac-address-mask Fields in Ethernet header.
acl-eth-header-fields destination-mac-address destination-mac-address-mask source-mac-address source-mac-address-mask ethertype Fields in Ethernet header.
acl-icmp-header-fields type code rest-of-header Collection of ICMP header fields that can be used to setup a match filter.
acl-ip-header-fields dscp protocol source-port-range destination-port-range IP header fields common to ipv4 and ipv6
acl-ip-header-fields dscp ecn length ttl protocol source-port-range destination-port-range IP header fields common to ipv4 and ipv6
acl-ipv4-header-fields destination-ipv4-network source-ipv4-network Fields in IPv4 header.
acl-ipv4-header-fields ihl flags offset identification destination-ipv4-network source-ipv4-network Fields in IPv4 header.
acl-ipv6-header-fields destination-ipv6-network source-ipv6-network flow-label Fields in IPv6 header
acl-ipv6-header-fields next-header destination-ipv6-network source-ipv6-network flow-label Fields in IPv6 header
acl-tcp-header-fields sequence-number acknowledgement-number data-offset reserved flags window-size urgent-pointer options Collection of TCP header fields that can be used to setup a match filter.
acl-transport-header-fields source-port-range destination-port-range Transport header fields
acl-transport-header-fields source-port-range destination-port-range Transport header fields
acl-udp-header-fields length Collection of UDP header fields that can be used to setup a match filter.
metadata input-interface absolute-time Fields associated with a packet whick are not in the header.
timerange absolute-time Time range contains time segments to allow access-control-list to be active/inactive when the system time is between the range.