Bug-3904: BGP-LU yang model 18/27218/3
authorMilos Fabian <milfabia@cisco.com>
Mon, 21 Sep 2015 14:28:36 +0000 (16:28 +0200)
committerMilos Fabian <milfabia@cisco.com>
Wed, 23 Sep 2015 16:00:39 +0000 (16:00 +0000)
-model prepresents BGP-LU NLRI as described in
https://tools.ietf.org/html/rfc3107#section-3
-labeled-unicast safi added
-BGP RIBs and Update message augmented to support BGP-LU

Change-Id: I0f33cd8c4e76fe7fcfdcaf8de322dea8dfa26acb
Signed-off-by: Milos Fabian <milfabia@cisco.com>
artifacts/pom.xml
bgp/labeled-unicast/.project [new file with mode: 0644]
bgp/labeled-unicast/pom.xml [new file with mode: 0644]
bgp/labeled-unicast/src/main/yang/bgp-labeled-unicast.yang [new file with mode: 0644]
bgp/pom.xml

index fe3dd0cc2ed82f1d0819fec2443da70543a7bed9..d7381cc03d1bdbc031200be4d7c3170ab6413791 100644 (file)
                 <artifactId>bgp-flowspec</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>bgp-labeled-unicast</artifactId>
+                <version>${project.version}</version>
+            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>bgp-linkstate</artifactId>
diff --git a/bgp/labeled-unicast/.project b/bgp/labeled-unicast/.project
new file mode 100644 (file)
index 0000000..37657ea
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>bgp-labeled-unicast</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
diff --git a/bgp/labeled-unicast/pom.xml b/bgp/labeled-unicast/pom.xml
new file mode 100644 (file)
index 0000000..1b9bda0
--- /dev/null
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <scm>
+        <connection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</connection>
+        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</developerConnection>
+        <url>https://wiki.opendaylight.org/view/BGP_LS_PCEP:Main</url>
+        <tag>HEAD</tag>
+    </scm>
+    <parent>
+        <groupId>org.opendaylight.bgpcep</groupId>
+        <artifactId>bgp-parent</artifactId>
+        <version>0.5.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>bgp-labeled-unicast</artifactId>
+    <description>BGP Labeled Unicast</description>
+    <packaging>bundle</packaging>
+    <name>${project.artifactId}</name>
+    <prerequisites>
+        <maven>3.0.4</maven>
+    </prerequisites>
+
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-bmp-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-concepts</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-parser-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-parser-spi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-rib-api</artifactId>
+        </dependency>
+         <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-rib-spi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>util</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.opendaylight.mdsal</groupId>
+            <artifactId>yang-binding</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-data-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-data-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-common</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>concepts</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>ietf-inet-types</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-common-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-core-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>config-api</artifactId>
+        </dependency>
+
+         <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-buffer</artifactId>
+         </dependency>
+
+         <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+         </dependency>
+         <!-- test scope dependencies -->
+         <dependency>
+             <groupId>junit</groupId>
+             <artifactId>junit</artifactId>
+         </dependency>
+         <dependency>
+             <groupId>org.opendaylight.yangtools</groupId>
+             <artifactId>mockito-configuration</artifactId>
+         </dependency>
+         <dependency>
+             <groupId>org.mockito</groupId>
+             <artifactId>mockito-core</artifactId>
+             <scope>test</scope>
+         </dependency>
+         <dependency>
+             <groupId>${project.groupId}</groupId>
+             <artifactId>bgp-parser-spi</artifactId>
+             <type>test-jar</type>
+         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-rib-spi</artifactId>
+            <type>test-jar</type>
+        </dependency>
+         <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-broker-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-broker-impl</artifactId>
+            <scope>test</scope>
+            <type>test-jar</type>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>config-manager</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>config-manager</artifactId>
+            <type>test-jar</type>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>yang-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/bgp/labeled-unicast/src/main/yang/bgp-labeled-unicast.yang b/bgp/labeled-unicast/src/main/yang/bgp-labeled-unicast.yang
new file mode 100644 (file)
index 0000000..fe09e44
--- /dev/null
@@ -0,0 +1,147 @@
+module bgp-labeled-unicast {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast";
+    prefix "bgp-lu";
+
+    import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+    import bgp-message { prefix bgp-msg; revision-date 2013-09-19; }
+    import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
+    import bgp-rib { prefix bgp-rib; revision-date 2013-09-25; }
+    import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
+    import bmp-monitor { prefix bmp-mon; revision-date 2015-05-12; }
+
+    organization "Cisco Systems, Inc.";
+    contact "GE QU <gequ@cisco.com>";
+    contact "Mingming Chen <mingmche@cisco.com>";
+
+    description
+        "This module contains the base data model of a BGP message.
+        It rolls up the definitions contained in RFC3107.
+
+        Copyright (c)2015 Cisco Systems, Inc. All rights reserved.
+
+        This program and the accompanying materials are made available
+        under the terms of the Eclipse Public License v1.0 which
+        accompanies this distribution, and is available at
+        http://www.eclipse.org/legal/epl-v10.html";
+
+    revision "2015-05-25" {
+        description
+            "Initial Version.";
+    }
+
+    identity labeled-unicast-subsequent-address-family {
+        reference "https://tools.ietf.org/html/rfc3107#section-3";
+        base bgp-t:subsequent-address-family;
+    }
+
+    typedef label-value {
+        description
+            "The 20-bit Label value.";
+        type int32 {
+            range "0..1048575";
+        }
+    }
+
+    grouping label {
+        reference "https://tools.ietf.org/html/rfc3032#section-2.1";
+        description
+            "The lable stack entry.";
+        leaf label-value {
+            type label-value;
+        }
+    }
+
+    grouping labeled-unicast {
+        reference "https://tools.ietf.org/html/rfc3107#section-3";
+        list label-stack {
+            description
+                "The Label field carries one or more labels (that corresponds to
+                 the stack of labels). Each label is encoded as 3
+                 octets, where the high-order 20 bits contain the label value,
+                 and the low order bit contains 'Bottom of Stack'.";
+            uses label;
+            ordered-by user;
+        }
+        leaf prefix {
+            type inet:ip-prefix;
+        }
+    }
+
+    grouping labeled-unicast-destination {
+        list c-labeled-unicast-destination {
+            uses labeled-unicast;
+        }
+    }
+
+    grouping labeled-unicast-routes {
+        container labeled-unicast-routes {
+            list labeled-unicast-route {
+                leaf route-key {
+                    type binary;
+                }
+                key "route-key";
+                uses labeled-unicast;
+                uses bgp-rib:route;
+            }
+        }
+    }
+
+    augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
+        case destination-labeled-unicast-case {
+            container destination-labeled-unicast {
+                uses labeled-unicast-destination;
+            }
+        }
+    }
+
+    augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
+        case destination-labeled-unicast-case {
+            container destination-labeled-unicast {
+                uses labeled-unicast-destination;
+            }
+        }
+    }
+
+    augment "/bgp-rib:application-rib/bgp-rib:tables/bgp-rib:routes" {
+        case labeled-unicast-routes-case {
+            uses labeled-unicast-routes;
+        }
+    }
+
+    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:loc-rib/bgp-rib:tables/bgp-rib:routes" {
+        case labeled-unicast-routes-case {
+            uses labeled-unicast-routes;
+        }
+    }
+
+    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-in/bgp-rib:tables/bgp-rib:routes" {
+        case labeled-unicast-routes-case {
+            uses labeled-unicast-routes;
+        }
+    }
+
+    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:effective-rib-in/bgp-rib:tables/bgp-rib:routes" {
+        case labeled-unicast-routes-case {
+            uses labeled-unicast-routes;
+        }
+    }
+
+    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-out/bgp-rib:tables/bgp-rib:routes" {
+        case labeled-unicast-routes-case {
+            uses labeled-unicast-routes;
+        }
+    }
+
+    augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:pre-policy-rib/bmp-mon:tables/bmp-mon:routes" {
+        case labeled-unicast-routes-case {
+            uses labeled-unicast-routes;
+        }
+    }
+
+    augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:post-policy-rib/bmp-mon:tables/bmp-mon:routes" {
+        case labeled-unicast-routes-case {
+            uses labeled-unicast-routes;
+        }
+    }
+}
index afa9d1dadb2c17a4b3820aa65b6902bdfadbee5c..788b510912590da77ea011563ce323744a1b9d3d 100644 (file)
@@ -34,6 +34,7 @@
         <module>inet</module>
         <module>linkstate</module>
         <module>flowspec</module>
+        <module>labeled-unicast</module>
         <module>parser-api</module>
         <module>parser-spi</module>
         <module>parser-impl</module>