Subject: [Softwires] draft-ietf-softwire-yang: Strawman Proposal to restructure the CE model

From: Ian Farrer <[email-masked]>
Date: Sat, 11 Mar 2017 15:17:57 +0100

Hi,

The structure of the model currently defined in draft-ietf-softwire-yang-01 provides a single model for ‘binding’ softwires containing BR and CE. We’ve done some work on implementing these models and whilst the BR model is working, the CE part is problematic.

While there is all of the relevant configuration parameters data for building a softwire, there is no concept of a softwire interface defined in the model. This means that there’s no way of configuring the CEs routing table to add an IPv4 route via the softwire, as ietf-routing requires an interface to be available in the interfaces list to create a ‘simple-next-hop’. Also (to me), this makes the model incompatible with the wider YANG interfaces and routing structure.

From the 2 softwire CE implementations that I am familiar with, in both cases a tunnel interface is created and this is visible in the device’s interfaces list. My thinking is that the softwire YANG model would be a lot easier to implement if it followed this convention.

Below is a straw man proposal for a CE specific model which hooks into the ietf-interfaces structure. it’s not a complete model with all of the functionality (esp. the state data) there at the moment, but it shows how the CE’s softwire interface could be modelled, making it possible to integrate this with ietf-routing. I used the ‘tunnel’ iftype as it seemed to be the closest match, but it may be necessary to define a new ‘ipip’ type.

I’d appreciate any thoughts on whether this is a better way to approach softwire-yang than we are using at the moment. If so, then it will mean some restructuring of the models overall. Possibly it would make sense to have a common module containing the common grouped functions, a separate model for BR and another for CE (the points I make above are as valid for an ‘algorithm’ CE as for a ‘binding’ one).

Cheers,
Ian

module ietf-softwire-lwb4 {
     namespace "urn:ietf:params:xml:ns:yang:ietf-softwire-lwb4";
     prefix "softwire-lwb4";

     import ietf-inet-types {
       prefix inet;
     }
     import ietf-interfaces {
       prefix if;
     }
     import iana-if-type {
       prefix ianaift;
     }

     organization "Softwire Working Group";

     contact
       "
       Qi Sun <[email-masked]>
       Hao Wang <[email-masked]>
       Yong Cui <[email-masked]>
       Ian <Farrer [email-masked]>
       Sladjana Zoric <[email-masked]>
       Mohamed Boucadair <[email-masked]>
       Rajiv <Asati [email-masked]>
       ";

     description
       "This document defines a YANG data model for the configuration and
       management of A+P Softwire Border Routers (BRs) and Customer
       Premises Equipment (CEs). It covers Lightweight 4over6,
       MAP-E and MAP-T mechanisms.

       Copyright (c) 2017 IETF Trust and the persons identified
       as authors of the code. All rights reserved.
       This version of this YANG module is part of RFC XXX; see the RFC
       itself for full legal notices.";

     revision 2017-11-03 {
       description
         "Initial version of standalone lwB4 model";
          reference "-00";
     }

   /*
    * Grouping
    */

     grouping port-set {
       description
         "Use the PSID algorithm to represent a range of transport layer
         ports which will be used by a CE device for NAPT.";
       leaf psid-offset {
         type uint8 {
           range 0..16;
         }
         description
           "The number of offset bits. In Lightweight 4over6, the default
           value is 0 for assigning one contiguous port range. In MAP-E/T,
           the default value is 6, which excludes system ports by default
           and assigns port ranges distribute across the entire port space.
           If the this parameter is larger than 0, the value of offset
           MUST be greater than 0.";
       }
       leaf psid-len {
         type uint8 {
           range 0..15;
         }
         // mandatory true;
         description
           "The length of PSID, representing the sharing ratio for an
           IPv4 address.";
       }
       leaf psid {
         type uint16;
         // mandatory true;
         description
           "Port Set Identifier (PSID) value, which identifies a set
           of ports algorithmically.";
       }
     }

     grouping binding-entry {
       description
         "The lwAFTR maintains an address binding table that contains
         the binding between the lwB4's IPv6 address, the allocated IPv4
         address and restricted port-set.";
       leaf binding-ipv6info {
         type union {
           type inet:ipv6-address;
           type inet:ipv6-prefix;
         }
         // mandatory true;
         description
           "The IPv6 information for a binding entry.
            If this is an IPv6 prefix, it indicates that
            the IPv6 source address of the lwB4 is constructed
            according to the description in RFC7596;
            if it is an IPv6 address, it means the lwB4 uses
            any /128 address from the assigned IPv6 prefix.
            ";
       }
       leaf binding-ipv4-addr {
         type inet:ipv4-address;
         // mandatory true;
         description
           "The IPv4 address assigned to the lwB4, which is
            used as the IPv4 external address
            for lwB4 local NAPT44.";
       }
       container port-set {
         description
           "For Lightweight 4over6, the default value
           of offset should be 0, to configure one contiguous
           port range.";
         uses port-set {
           refine psid-offset {
             default "0";
           }
         }
       }
       leaf br-ipv6-addr {
         type inet:ipv6-address;
         // mandatory true;
         description
           "The IPv6 address for lwaftr.";
       }
       leaf lifetime {
         type uint32;
         units seconds;
         description "The lifetime for the binding entry";
       }
     }

     // configuration parameters for CE softwire binding interfaces
     augment "/if:interfaces/if:interface" {
       when "if:type = 'ianaift:tunnel'";
       description "CE Softwire binding interface configuration";
       leaf name {
         type string;
         description
           "Name of the Softwire binding interface";
       }
       leaf enable {
         type boolean;
         description
           "Enable/disable the CE interface.";
       }
       leaf type {
         type identityref {
           base if:interface-type;
         }
         description
          "The type of the interface. Softwires use type tunnel";
       reference
         "RFC 2863: The Interfaces Group MIB - ifType";
}

       container ce-interface {
       description "instances for CE";
             leaf name {
               type string;
               description "The CE's name.";
             }
             leaf tunnel-payload-mtu {
               type uint16;
               description
                 "The payload MTU for Lightweight 4over6 tunnel.";
             }
             leaf tunnel-path-mru {
               type uint16;
               description
                 "The path MRU for Lightweight 4over6 tunnel.";
             }
             leaf b4-ipv6-addr-format {
               type boolean;
               description
                "The format of lwB4 (CE) IPv6 address. If set to true,
                it indicates that the IPv6 source address of the lwB4
                is constructed according to the description in
                [RFC7596]; if set to false, the lwB4 (CE)
                can use any /128 address from the assigned IPv6
                prefix.";
             }
             uses binding-entry;
           }
         }

     // operational state parameters for CE softwire binding interface
     augment "/if:interfaces-state/if:interface" {
       when "if:type = 'ianaift:tunnel'";
       description "CE Softwire binding interface operational state";

       container ce-interface {
         config false;
         description
           "Data nodes for the operational state of interfaces.";

           leaf name {
             type string;
             description
               "The name of the interface.";
             reference
               "RFC 2863: The Interfaces Group MIB - ifName";
           }
           leaf type {
             type identityref {
               base if:interface-type;
             }
             description
               "The type of the interface.";
             reference
               "RFC 2863: The Interfaces Group MIB - ifType";
          }
       }
     }
   }