NSO Juniper packages for T-SDN

Introduction

These NSO packages add example Junos support to the T-SDN Core Function Pack.
To use these packages, a working NSO environment with T-SDN installed is
required (for example as used by Cisco Crosswork Network Controller).

Once these packages are installed, Junos support is added to the following
T-SDN services:

  • SR-TE
  • L3 VPN
  • L2 VPN

The Junos configuration generated by these packages should be treated as an
example and may need to be modified to work correctly for some use cases. The
configuration can easily be customised by updating the XML templates.

Pre-requisites

  • NSO with the T-SDN Core Function Pack installed
  • Juniper Junos NED

Installation

Copy the juniper-junos NED, and the packages from this repository, to the NSO
packages directory and reload the packages:

admin@ncs# packages reload
...
reload-result {
    package flat-l3vpn-juniper
    result true
}
reload-result {
    package juniper-junos-nc-4.6
    result true
}
reload-result {
    package sr-te-juniper
    result true
}
...

Load merge the dynamic-device-mapping.xml file from each package directory:

admin@ncs# config
Entering configuration mode terminal
admin@ncs(config)# load merge packages/sr-te-juniper/dynamic-device-mapping.xml
Loading.
358 bytes parsed in 0.01 sec (26.44 KiB/sec)
admin@ncs(config)# load merge packages/flat-l3vpn-juniper/dynamic-device-mapping.xml
Loading.
376 bytes parsed in 0.01 sec (31.85 KiB/sec)
admin@ncs(config)# commit
Commit complete.

How to use

SR-TE

Choose a Junos device as the head-end when configuring an SR-TE policy in T-SDN.
Both static and ODN policies are supported.

L3 VPN

Choose a Junos device as the access-pe when adding a VPN endpoint. Either the
ietf-l3vpn-ntw or cisco-flat-L3vpn model can be used.

Example

Below is an example of creating a static SR-TE policy with a dynamic path on a
Junos xMX device called vmx99:

admin@ncs# config
Entering configuration mode terminal
admin@ncs(config)# sr-te policies policy sr_te_c_777_ep_198.19.1.4 tail-end 198.19.1.4 color 777
admin@ncs(config-policy-sr_te_c_777_ep_198.19.1.4)# head-end vmx99
admin@ncs(config-head-end-vmx99)# path 101 dynamic metric-type te
admin@ncs(config-path-101)# dynamic pce
admin@ncs(config-path-101)# dynamic constraints affinity rule exclude-any color BLUE
admin@ncs(config-rule-exclude-any)# exit
admin@ncs(config-path-101)# exit
admin@ncs(config-policy-sr_te_c_777_ep_198.19.1.4)# show configuration
cisco-sr-te-cfp:sr-te policies policy sr_te_c_777_ep_198.19.1.4
 head-end vmx99
 !
 tail-end 198.19.1.4
 color    777
 path 101
  dynamic metric-type te
  dynamic pce
  dynamic constraints affinity rule exclude-any
   color [ BLUE ]
  !
 !
!
admin@ncs(config-policy-sr_te_c_777_ep_198.19.1.4)# commit dry-run
cli {
    local-node {
        data  devices {
                  device vmx99 {
                      config {
                          configuration {
                              protocols {
                                  source-packet-routing {
             +                        compute-profile sr_te_c_777_ep_198.19.1.4-101-profile {
             +                            admin-group {
             +                                exclude [ BLUE ];
             +                            }
             +                            maximum-computed-segment-lists 1;
             +                            metric-type {
             +                                te;
             +                            }
             +                        }
             +                        # first
             +                        source-routing-path sr_te_c_777_ep_198.19.1.4 {
             +                            to 198.19.1.4;
             +                            color 777;
             +                            sr-preference 101;
             +                            lsp-external-controller pccd;
             +                            primary sr_te_c_777_ep_198.19.1.4-dynamic {
             +                                compute {
             +                                    compute-profile-name sr_te_c_777_ep_198.19.1.4-101-profile;
             +                                }
             +                            }
             +                        }
                                  }
                              }
                          }
                      }
                  }
              }
              cisco-sr-te-cfp:sr-te {
                  policies {
             +        policy sr_te_c_777_ep_198.19.1.4 {
             +            head-end vmx99;
             +            tail-end 198.19.1.4;
             +            color 777;
             +            path 101 {
             +                dynamic {
             +                    metric-type te;
             +                    pce {
             +                    }
             +                    constraints {
             +                        affinity {
             +                            rule exclude-any {
             +                                color [ BLUE ];
             +                            }
             +                        }
             +                    }
             +                }
             +            }
             +        }
                  }
              }
    }
}
admin@ncs(config-policy-sr_te_c_777_ep_198.19.1.4)# commit dry-run outformat native
native {
    device {
        name vmx99
        data <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
                  message-id="1">
               <edit-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
                 <target>
                   <candidate/>
                 </target>
                 <test-option>test-then-set</test-option>
                 <config>
                   <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm">
                     <protocols>
                       <source-packet-routing>
                         <compute-profile>
                           <name>sr_te_c_777_ep_198.19.1.4-101-profile</name>
                           <maximum-computed-segment-lists>1</maximum-computed-segment-lists>
                           <metric-type>
                             <te/>
                           </metric-type>
                           <admin-group>
                             <exclude>BLUE</exclude>
                           </admin-group>
                         </compute-profile>
                         <source-routing-path>
                           <name>sr_te_c_777_ep_198.19.1.4</name>
                           <color>777</color>
                           <to>198.19.1.4</to>
                           <primary>
                             <name>sr_te_c_777_ep_198.19.1.4-dynamic</name>
                             <compute>
                               <compute-profile-name>sr_te_c_777_ep_198.19.1.4-101-profile</compute-profile-name>
                             </compute>
                           </primary>
                           <sr-preference>101</sr-preference>
                           <lsp-external-controller>pccd</lsp-external-controller>
                         </source-routing-path>
                       </source-packet-routing>
                     </protocols>
                   </configuration>
                 </config>
               </edit-config>
             </rpc>
    }
}
View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.