Subject: [netmod] IP data model neighbor changes

From: "Lange, Jeffrey K (GE Energy Management)" <[email-masked]>
Date: Mon, 7 Oct 2013 13:58:35 +0000

In regards to my previous message about the lack of IPv4 neighbor state, I would like to propose a change to the ietf-ip model that makes the following changes:

* Moves IPv4/IPv6 neighbors into /interface-state/interface/ipv[46]/neighbor
  - in doing this, remove the interface leaf from the list
* Removes the top-level ip-state as the only thing in it was the neighbor entries
  - /ip-state/ipv[46] presence containers are redundant as they already exist per interface
* Moves the neighbor-state leafs into a typedef so it can be used in both IPv4 and IPv6
* Add failed, noarp, and permanent as neighbor-state enum values

Feedback is welcome.

Thanks
-Jeff

module: ietf-interfaces
   +--rw interfaces
   |  +--rw interface [name]
   |     +--rw name                        string
   |     +--rw description?                string
   |     +--rw type                        identityref
   |     +--rw enabled?                    boolean
   |     +--rw link-up-down-trap-enable?   enumeration
   |     +--rw ip:ipv4?
   |     |  +--rw ip:enabled?      boolean
   |     |  +--rw ip:forwarding?   boolean
   |     |  +--rw ip:mtu?          uint16
   |     |  +--rw ip:address [ip]
   |     |  |  +--rw ip:ip               inet:ipv4-address-no-zone
   |     |  |  +--rw (subnet)
   |     |  |     +--:(prefix-length)
   |     |  |     |  +--rw ip:prefix-length?   uint8
   |     |  |     +--:(netmask)
   |     |  |        +--rw ip:netmask?         yang:dotted-quad
   |     |  +--rw ip:neighbor [ip]
   |     |     +--rw ip:ip                    inet:ipv4-address-no-zone
   |     |     +--rw ip:link-layer-address?   yang:phys-address
   |     +--rw ip:ipv6?
   |        +--rw ip:enabled?                     boolean
   |        +--rw ip:forwarding?                  boolean
   |        +--rw ip:mtu?                         uint32
   |        +--rw ip:address [ip]
   |        |  +--rw ip:ip               inet:ipv6-address-no-zone
   |        |  +--rw ip:prefix-length    uint8
   |        +--rw ip:neighbor [ip]
   |        |  +--rw ip:ip                    inet:ipv6-address-no-zone
   |        |  +--rw ip:link-layer-address?   yang:phys-address
   |        +--rw ip:dup-addr-detect-transmits?   uint32
   |        +--rw ip:autoconf
   |           +--rw ip:create-global-addresses?        boolean
   |           +--rw ip:create-temporary-addresses?     boolean
   |           +--rw ip:temporary-valid-lifetime?       uint32
   |           +--rw ip:temporary-preferred-lifetime?   uint32
   +--ro interfaces-state
      +--ro interface [name]
         +--ro name               string
         +--ro type               identityref
         +--ro admin-status       enumeration
         +--ro oper-status        enumeration
         +--ro last-change?       yang:date-and-time
         +--ro if-index           int32
         +--ro phys-address?      yang:phys-address
         +--ro higher-layer-if*   interface-state-ref
         +--ro lower-layer-if*    interface-state-ref
         +--ro speed?             yang:gauge64
         +--ro statistics
         |  +--ro discontinuity-time    yang:date-and-time
         |  +--ro in-octets?            yang:counter64
         |  +--ro in-unicast-pkts?      yang:counter64
         |  +--ro in-broadcast-pkts?    yang:counter64
         |  +--ro in-multicast-pkts?    yang:counter64
         |  +--ro in-discards?          yang:counter32
         |  +--ro in-errors?            yang:counter32
         |  +--ro in-unknown-protos?    yang:counter32
         |  +--ro out-octets?           yang:counter64
         |  +--ro out-unicast-pkts?     yang:counter64
         |  +--ro out-broadcast-pkts?   yang:counter64
         |  +--ro out-multicast-pkts?   yang:counter64
         |  +--ro out-discards?         yang:counter32
         |  +--ro out-errors?           yang:counter32
         +--ro ip:ipv4?
         |  +--ro ip:forwarding?   boolean
         |  +--ro ip:mtu?          uint16
         |  +--ro ip:address [ip]
         |  |  +--ro ip:ip               inet:ipv4-address-no-zone
         |  |  +--ro (subnet)?
         |  |  |  +--:(prefix-length)
         |  |  |  |  +--ro ip:prefix-length?   uint8
         |  |  |  +--:(netmask)
         |  |  |     +--ro ip:netmask?         yang:dotted-quad
         |  |  +--ro ip:origin?          ip-address-origin
         |  +--ro ip:neighbor [ip]
         |     +--ro ip:ip                    inet:ipv4-address-no-zone
         |     +--ro ip:link-layer-address?   yang:phys-address
         |     +--ro ip:origin?               neighbor-origin
         |     +--ro ip:state?                neighbor-state
         +--ro ip:ipv6?
            +--ro ip:forwarding?   boolean
            +--ro ip:mtu?          uint32
            +--ro ip:address [ip]
            |  +--ro ip:ip               inet:ipv6-address-no-zone
            |  +--ro ip:prefix-length    uint8
            |  +--ro ip:origin?          ip-address-origin
            |  +--ro ip:status?          enumeration
            +--ro ip:neighbor [ip]
               +--ro ip:ip                    inet:ipv6-address-no-zone
               +--ro ip:link-layer-address?   yang:phys-address
               +--ro ip:origin?               neighbor-origin
               +--ro ip:is-router?            empty
               +--ro ip:state?                neighbor-state

--- [email-masked]        2013-10-07 09:18:11.952631152 -0400                                                                                                   
+++ [email-masked]     2013-10-07 09:45:21.348509916 -0400                                                                                                           
@@ -136,6 +136,62 @@                                                                                                                                                          
       "The origin of a neighbor entry.";                                                                                                                                     
   }                                                                                                                                                                          
                                                                                                                                                                              
+  typedef neighbor-state {                                                                                                                                                   
+    type enumeration {
+      enum incomplete {
+        description
+          "Address resolution is in progress and the link-layer
+           address of the neighbor has not yet been
+           determined.";
+      }
+      enum reachable {
+        description
+          "Roughly speaking, the neighbor is known to have been
+           reachable recently (within tens of seconds ago).";
+      }
+      enum stale {
+        description
+          "The neighbor is no longer known to be reachable but
+           until traffic is sent to the neighbor, no attempt
+           should be made to verify its reachability.";
+      }
+      enum delay {
+        description
+          "The neighbor is no longer known to be reachable, and
+           traffic has recently been sent to the neighbor.
+           Rather than probe the neighbor immediately, however,
+           delay sending probes for a short while in order to
+           give upper-layer protocols a chance to provide
+           reachability confirmation.";
+      }
+      enum probe {
+        description
+          "The neighbor is no longer known to be reachable, and
+           unicast Neighbor Solicitation probes are being sent
+           to verify reachability.";
+      }
+      enum failed {
+        description
+          "The neighbor was unable to be successfully probed.";
+      }
+      enum noarp {
+        description
+          "The neighbor entry will not use any protocol to
+           resolve the L3 to L2 mapping.";
+      }
+      enum permanent{
+        description
+          "The neighbor entry has been statically configured.";
+      }
+    }
+    description
+      "The Neighbor Unreachability Detection state of this
+       entry.";
+    reference
+      "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
+                 Section 7.3.2";
+  }
+  
   /*
    * Configuration data nodes
    */
@@ -455,6 +511,37 @@
             "The origin of this address.";
         }
       }
+      list neighbor {
+        key "ip";
+        description
+          "A list of mappings from IPv4 addresses to
+           link-layer addresses.
+
+           This list represents the ARP Cache.";
+        reference
+          "RFC 826: An Ethernet Address Resolution Protocol";
+
+        leaf ip {
+          type inet:ipv4-address-no-zone;
+          description
+            "The IPv4 address of the neighbor node.";
+        }
+        leaf link-layer-address {
+          type yang:phys-address;
+          description
+            "The link-layer address of the neighbor node.";
+        }
+        leaf origin {
+          type neighbor-origin;
+          description
+            "The origin of this neighbor entry.";
+        }
+        leaf state {
+          type neighbor-state;
+          description
+            "The state of this neighbor entry.";
+        }
+      }
     }
 
     container ipv6 {
@@ -567,59 +654,8 @@
              RFC 4862: IPv6 Stateless Address Autoconfiguration";
         }
       }
-    }
-  }
-
-  container ip-state {
-    config false;
-    description
-      "Data nodes for the operational state of IP.";
-
-    container ipv4 {
-      presence "Present if IPv4 is enabled";
-      description
-        "Parameters for the IPv4 address family.";
-
-      list neighbor {
-        key "interface ip";
-        description
-          "A list of mappings from IPv4 addresses to
-           link-layer addresses.
-
-           This list represents the ARP Cache.";
-        reference
-          "RFC 826: An Ethernet Address Resolution Protocol";
-
-        leaf interface {
-          type if:interface-state-ref;
-          description
-            "The name of the interface for this neighbor.";
-        }
-        leaf ip {
-          type inet:ipv4-address-no-zone;
-          description
-            "The IPv4 address of the neighbor node.";
-        }
-        leaf link-layer-address {
-          type yang:phys-address;
-          description
-            "The link-layer address of the neighbor node.";
-        }
-        leaf origin {
-          type neighbor-origin;
-          description
-            "The origin of this neighbor entry.";
-        }
-      }
-    }
-
-    container ipv6 {
-      presence "Present if IPv6 is enabled";
-      description
-        "Parameters for the IPv6 address family.";
-
       list neighbor {
-        key "interface ip";
+        key "ip";
         description
           "A list of mappings from IPv6 addresses to
            link-layer addresses.
@@ -628,11 +664,6 @@
         reference
           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
 
-        leaf interface {
-          type if:interface-state-ref;
-          description
-            "The name of the interface for this neighbor.";
-        }
         leaf ip {
           type inet:ipv6-address-no-zone;
           description
@@ -654,46 +685,9 @@
             "Indicates that the neighbor node acts as a router.";
         }
         leaf state {
-          type enumeration {
-            enum incomplete {
-              description
-                "Address resolution is in progress and the link-layer
-                 address of the neighbor has not yet been
-                 determined.";
-            }
-            enum reachable {
-              description
-                "Roughly speaking, the neighbor is known to have been
-                 reachable recently (within tens of seconds ago).";
-            }
-            enum stale {
-              description
-                "The neighbor is no longer known to be reachable but
-                 until traffic is sent to the neighbor, no attempt
-                 should be made to verify its reachability.";
-            }
-            enum delay {
-              description
-                "The neighbor is no longer known to be reachable, and
-                 traffic has recently been sent to the neighbor.
-                 Rather than probe the neighbor immediately, however,
-                 delay sending probes for a short while in order to
-                 give upper-layer protocols a chance to provide
-                 reachability confirmation.";
-            }
-            enum probe {
-              description
-                "The neighbor is no longer known to be reachable, and
-                 unicast Neighbor Solicitation probes are being sent
-                 to verify reachability.";
-            }
-          }
+          type neighbor-state;
           description
-            "The Neighbor Unreachability Detection state of this
-             entry.";
-          reference
-            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
-                       Section 7.3.2";
+            "The state of this neighbor entry.";
         }
       }
     }