From afcb5b044529a481d2d31de1055ae2350a07f347 Mon Sep 17 00:00:00 2001 From: Milos Fabian Date: Mon, 21 Sep 2015 16:28:36 +0200 Subject: [PATCH 1/1] Bug-3904: BGP-LU yang model -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 --- artifacts/pom.xml | 5 + bgp/labeled-unicast/.project | 23 +++ bgp/labeled-unicast/pom.xml | 190 ++++++++++++++++++ .../src/main/yang/bgp-labeled-unicast.yang | 147 ++++++++++++++ bgp/pom.xml | 1 + 5 files changed, 366 insertions(+) create mode 100644 bgp/labeled-unicast/.project create mode 100644 bgp/labeled-unicast/pom.xml create mode 100644 bgp/labeled-unicast/src/main/yang/bgp-labeled-unicast.yang diff --git a/artifacts/pom.xml b/artifacts/pom.xml index fe3dd0cc2e..d7381cc03d 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -38,6 +38,11 @@ bgp-flowspec ${project.version} + + ${project.groupId} + bgp-labeled-unicast + ${project.version} + ${project.groupId} bgp-linkstate diff --git a/bgp/labeled-unicast/.project b/bgp/labeled-unicast/.project new file mode 100644 index 0000000000..37657eae27 --- /dev/null +++ b/bgp/labeled-unicast/.project @@ -0,0 +1,23 @@ + + + bgp-labeled-unicast + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/bgp/labeled-unicast/pom.xml b/bgp/labeled-unicast/pom.xml new file mode 100644 index 0000000000..1b9bda0f6f --- /dev/null +++ b/bgp/labeled-unicast/pom.xml @@ -0,0 +1,190 @@ + + + + + + + 4.0.0 + + scm:git:ssh://git.opendaylight.org:29418/bgpcep.git + scm:git:ssh://git.opendaylight.org:29418/bgpcep.git + https://wiki.opendaylight.org/view/BGP_LS_PCEP:Main + HEAD + + + org.opendaylight.bgpcep + bgp-parent + 0.5.0-SNAPSHOT + + + bgp-labeled-unicast + BGP Labeled Unicast + bundle + ${project.artifactId} + + 3.0.4 + + + + + ${project.groupId} + bgp-bmp-api + + + ${project.groupId} + bgp-concepts + + + ${project.groupId} + bgp-parser-api + + + ${project.groupId} + bgp-parser-spi + + + ${project.groupId} + bgp-rib-api + + + ${project.groupId} + bgp-rib-spi + + + ${project.groupId} + util + + + + org.slf4j + slf4j-api + + + com.google.guava + guava + + + + org.opendaylight.mdsal + yang-binding + + + org.opendaylight.yangtools + yang-data-impl + + + org.opendaylight.yangtools + yang-data-api + + + org.opendaylight.yangtools + yang-common + + + org.opendaylight.yangtools + concepts + + + org.opendaylight.mdsal.model + ietf-inet-types + + + org.opendaylight.controller + sal-common-api + + + org.opendaylight.controller + sal-core-api + + + org.opendaylight.controller + config-api + + + + io.netty + netty-buffer + + + + org.osgi + org.osgi.core + provided + + + + junit + junit + + + org.opendaylight.yangtools + mockito-configuration + + + org.mockito + mockito-core + test + + + ${project.groupId} + bgp-parser-spi + test-jar + + + ${project.groupId} + bgp-rib-spi + test-jar + + + org.opendaylight.controller + sal-binding-broker-impl + test + + + org.opendaylight.controller + sal-binding-api + test + + + org.opendaylight.controller + sal-binding-broker-impl + test + test-jar + + + org.opendaylight.controller + config-manager + test + + + org.opendaylight.controller + config-manager + test-jar + + + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + + + + + + 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 index 0000000000..fe09e4415a --- /dev/null +++ b/bgp/labeled-unicast/src/main/yang/bgp-labeled-unicast.yang @@ -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 "; + contact "Mingming Chen "; + + 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; + } + } +} diff --git a/bgp/pom.xml b/bgp/pom.xml index afa9d1dadb..788b510912 100644 --- a/bgp/pom.xml +++ b/bgp/pom.xml @@ -34,6 +34,7 @@ inet linkstate flowspec + labeled-unicast parser-api parser-spi parser-impl -- 2.36.6