Jump to: navigation, search

BGP LS PCEP:Restconf and Java Binding API

(Redirected from BGP LS PCEP:Restconf)

This page summarizes how data from BGP, PCEP and BMP can be viewed through RESTCONF. Programmers also might use Java Binding-aware (BA) APIs to get data as Java DTOs.

From releases Helium and up, the port changed from 8080 to 8181.

The BGP and PCEP protocols offers topology-providers, that collect data in a network-topology, to view all topologies:

  • Restconf URL
http://localhost:8181/restconf/operational/network-topology:network-topology/
  • BA Instance Identifier
InstanceIdentifier<NetworkTopology> networkTopologyIId = InstanceIdentifier.create(NetworkTopology.class);

If BGP and PCEP are configured properly, it should display output similar to this one:

  1. <network-topology>
  2.  <topology>
  3.   <topology-id>pcep-topology</topology-id>
  4.   <topology-types>
  5.    <topology-pcep/>
  6.   </topology-types>
  7.  </topology>
  8.  <topology>
  9.   <server-provided>true</server-provided>
  10.   <topology-id>example-ipv4-topology</topology-id>
  11.   <topology-types/>
  12.  </topology>
  13.  <topology>
  14.   <server-provided>true</server-provided>
  15.   <topology-id>example-ipv6-topology</topology-id>
  16.   <topology-types/>
  17.  </topology>
  18.  <topology>
  19.   <server-provided>true</server-provided>
  20.   <topology-id>example-linkstate-topology</topology-id>
  21.   <topology-types/>
  22.  </topology>
  23. </network-topology>


BGP

Network Topology

BGP data as were sent from BGP speaker are listed in three topologies (if all three are configured):


example-linkstate-topology - displays links and nodes advertised through linkstate Update messages

  • Restconf URL
http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-linkstate-topology
  • BA Instance Identifier
InstanceIdentifier<Topology> networkTopologyIId = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class,
new TopologyKey(new TopologyId("example-linkstate-topology")));


example-ipv4-topology - display Ipv4 adresses of nodes in the topology

  • Restconf URL
http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-ipv4-topology
  • BA Instance Identifier
InstanceIdentifier<Topology> networkTopologyIId = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class,
new TopologyKey(new TopologyId("example-ipv4-topology")));


example-ipv6-topology - display Ipv6 adresses of nodes in the topology

  • Restconf URL
http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-ipv6-topology
  • BA Instance Identifier
InstanceIdentifier<Topology> networkTopologyIId = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class,
new TopologyKey(new TopologyId("example-ipv6-topology")));

Route Information Base (RIB)

Another view of BGP data is through BGP RIB, located here:

  • Restconf URL
http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/
  • BA Instance Identifier
KeyedInstanceIdentifier<Rib, RibKey> ribIId = InstanceIdentifier.create(BgpRib.class).child(Rib.class, new RibKey(new RibId("example-bgp-rib")));

This is how the empty output looks like, when address families for IPv4 Unicast, IPv6 Unicast, IPv4 Flowspec, IPv6 Flowspec, IPv4 Labeled Unicast and Linkstate were configured:

  1. <loc-rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
  2.   <tables>
  3.     <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv6-address-family</afi>
  4.     <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
  5.     <attributes>
  6.       <uptodate>false</uptodate>
  7.     </attributes>
  8.     <ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
  9.     </ipv6-routes>
  10.   </tables>
  11.   <tables>
  12.     <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
  13.     <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
  14.     <attributes>
  15.       <uptodate>false</uptodate>
  16.     </attributes>
  17.     <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
  18.     </ipv4-routes>
  19.   </tables>
  20.   <tables>
  21.     <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
  22.     <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">x:flowspec-subsequent-address-family</safi>
  23.     <attributes>
  24.       <uptodate>false</uptodate>
  25.     </attributes>
  26.     <flowspec-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
  27.     </flowspec-routes>
  28.   </tables>
  29.   <tables>
  30.     <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv6-address-family</afi>
  31.     <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">x:flowspec-subsequent-address-family</safi>
  32.     <attributes>
  33.       <uptodate>false</uptodate>
  34.     </attributes>
  35.     <flowspec-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
  36.     </flowspec-ipv6-routes>
  37.   </tables>
  38.   <tables>
  39.     <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
  40.     <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">x:labeled-unicast-subsequent-address-family</safi>
  41.     <attributes>
  42.       <uptodate>false</uptodate>
  43.     </attributes>
  44.     <labeled-unicast-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
  45.     </labeled-unicast-routes>
  46.   </tables>
  47.   <tables>
  48.     <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">x:linkstate-address-family</afi>
  49.     <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">x:linkstate-subsequent-address-family</safi>
  50.     <attributes>
  51.       <uptodate>false</uptodate>
  52.     </attributes>
  53.     <linkstate-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">
  54.     </linkstate-routes>
  55.   </tables>
  56. </loc-rib>

You can see details for each AFI/SAFI by expanding the RESTCONF link:


IPv4 Unicast

  • Restconf URL
http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv4-routes
  • BA Instance Identifier
InstanceIdentifier ipv4UnicastTableIId = InstanceIdentifier.create(BgpRib.class).child(Rib.class,
    new RibKey(new RibId("example-bgp-rib"))).child(LocRib.class).child(Tables.class,
        new TablesKey(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class));
 
InstanceIdentifier<Ipv4Routes> ipv4UnicastRoutesIId = ipv4UnicastTableIId.child(Ipv4Routes.class);


IPv6 Unicast

  • Restconf URL
http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv6-address-family/bgp-types:unicast-subsequent-address-family/ipv6-routes
  • BA Instance Identifier
InstanceIdentifier ipv6UnicastTableIId = InstanceIdentifier.create(BgpRib.class).child(Rib.class,
    new RibKey(new RibId("example-bgp-rib"))).child(LocRib.class).child(Tables.class,
        new TablesKey(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class));
 
InstanceIdentifier<Ipv6Routes> ipv6UnicastRoutesIId = ipv6UnicastTableIId.child(Ipv6Routes.class);


IPv4 Flowspec

  • Restconf URL
http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-routes
  • BA Instance Identifier
InstanceIdentifier ipv4FlowTableIId = InstanceIdentifier.create(BgpRib.class).child(Rib.class,
    new RibKey(new RibId("example-bgp-rib"))).child(LocRib.class).child(Tables.class,
        new TablesKey(Ipv4AddressFamily.class, FlowspecSubsequentAddressFamily.class));
 
InstanceIdentifier<FlowspecRoutes> ipv4FlowRoutesIId = ipv4FlowTableIId.child(FlowspecRoutes.class);


IPv6 Flowspec

  • Restconf URL
http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv6-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-ipv6-routes
  • BA Instance Identifier
InstanceIdentifier ipv6FlowTableIId = InstanceIdentifier.create(BgpRib.class).child(Rib.class,
    new RibKey(new RibId("example-bgp-rib"))).child(LocRib.class).child(Tables.class,
        new TablesKey(Ipv6AddressFamily.class, FlowspecSubsequentAddressFamily.class));
 
InstanceIdentifier<FlowspecIpv6Routes> ipv6FlowRoutesIId = ipv6FlowTableIId.child(FlowspecIpv6Routes.class);


IPv4 Labeled-Unicast

  • Restconf URL
http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes
  • BA Instance Identifier
InstanceIdentifier ipv4LabeledTableIId = InstanceIdentifier.create(BgpRib.class).child(Rib.class,
    new RibKey(new RibId("example-bgp-rib"))).child(LocRib.class).child(Tables.class,
        new TablesKey(Ipv4AddressFamily.class, LabeledUnicastSubsequentAddressFamily.class));
 
InstanceIdentifier<LabeledUnicastRoutes> ipv4LabeledRoutesIId = ipv4LabeledTableIId.child(LabeledUnicastRoutes.class);


Linkstate

  • Restconf URL
http://localhost:8181/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-linkstate:linkstate-address-family/bgp-linkstate:linkstate-subsequent-address-family/linkstate-routes
  • BA Instance Identifier
InstanceIdentifier linkstateTableIId = InstanceIdentifier.create(BgpRib.class).child(Rib.class,
    new RibKey(new RibId("example-bgp-rib"))).child(LocRib.class).child(Tables.class,
        new TablesKey(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class));
 
InstanceIdentifier<LinkstateRoutes> linkstateRoutesIId = linkstateTableIId.child(LinkstateRoutes.class);

PCEP

To get PCEP topology data stored in network-topology

  • Restconf URL
http://localhost:8181/restconf/operational/network-topology:network-topology/topology/pcep-topology
  • BA Instance Identifier
InstanceIdentifier<Topology> networkTopologyIId = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class,
   new TopologyKey(new TopologyId("pcep-topology")));

Each PCC will be displayed as a node:

  1. <node>
  2.  <path-computation-client>
  3.   <ip-address>42.42.42.42</ip-address>
  4.   <state-sync>synchronized</state-sync>
  5.   <stateful-tlv>
  6.    <stateful>
  7.     <initiation>true</initiation>
  8.     <lsp-update-capability>true</lsp-update-capability>
  9.    </stateful>
  10.   </stateful-tlv>
  11.  </path-computation-client>
  12.  <node-id>pcc://42.42.42.42</node-id>
  13. </node>

If some tunnels are configured on the network, they would be displayed on the same page, within a node that initiated the tunnel:

  1. <node>
  2.  <path-computation-client>
  3.   <state-sync>synchronized</state-sync>
  4.   <stateful-tlv>
  5.    <stateful>
  6.     <initiation>true</initiation>
  7.     <lsp-update-capability>true</lsp-update-capability>
  8.    </stateful>
  9.   </stateful-tlv>
  10.   <reported-lsp>
  11.    <name>foo</name>
  12.    <lsp>
  13.     <operational>down</operational>
  14.     <sync>false</sync>
  15.     <ignore>false</ignore>
  16.     <plsp-id>1</plsp-id>
  17.     <create>false</create>
  18.     <administrative>true</administrative>
  19.     <remove>false</remove>
  20.     <delegate>true</delegate>
  21.     <processing-rule>false</processing-rule>
  22.     <tlvs>
  23.     <lsp-identifiers>
  24.       <ipv4>
  25.        <ipv4-tunnel-sender-address>43.43.43.43</ipv4-tunnel-sender-address>
  26.        <ipv4-tunnel-endpoint-address>0.0.0.0</ipv4-tunnel-endpoint-address>
  27.        <ipv4-extended-tunnel-id>0.0.0.0</ipv4-extended-tunnel-id>
  28.       </ipv4>
  29.       <tunnel-id>0</tunnel-id>
  30.       <lsp-id>0</lsp-id>
  31.      </lsp-identifiers>
  32.      <symbolic-path-name>
  33.       <path-name>Zm9v</path-name>
  34.      </symbolic-path-name>
  35.     </tlvs>
  36.    </lsp>
  37.   </reported-lsp>
  38.   <ip-address>43.43.43.43</ip-address>
  39.  </path-computation-client>
  40.  <node-id>pcc://43.43.43.43</node-id>
  41. </node>

Note that, <path-name> tag displays tunnel name in Base64 encoding.

BMP

OpenDaylight's implementation of BGP Monitoring Protocol offers view on monitors and their monitored routers and peers.

  • Restconf URL
http://localhost:8181/restconf/operational/bmp-monitor:bmp-monitor
  • BA Instance Identifier
InstanceIdentifier<BmpMonitor> monitorsIId = InstanceIdentifier.create(BmpMonitor.class);
  • Restconf output might look like this sample:
<bmp-monitor xmlns="urn:opendaylight:params:xml:ns:yang:bmp-monitor">
 <monitor>
  <monitor-id>example-bmp-monitor</monitor-id>
  <router>
  <router-id>127.0.0.11</router-id>
   <status>up</status>
   <peer>
    <peer-id>20.20.20.20</peer-id>
    <as>72</as>
    <type>global</type>
    <peer-session>
     <remote-port>5000</remote-port>
     <timestamp-sec>5</timestamp-sec>
     <status>up</status>
     <local-address>10.10.10.10</local-address>
     <local-port>220</local-port>
    </peer-session>
    <pre-policy-rib>
     <tables>
      <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
      <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
      <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
       <ipv4-route>
        <prefix>10.10.10.0/24</prefix>
         <attributes>
          ...
         </attributes>
       </ipv4-route>
      </ipv4-routes>
      <attributes>
       <uptodate>true</uptodate>
      </attributes>
     </tables>
    </pre-policy-rib>
    <address>10.10.10.10</address>
    <post-policy-rib>
     ...
    </post-policy-rib>
    <bgp-id>20.20.20.20</bgp-id>
    <stats>
     <timestamp-sec>5</timestamp-sec>
     <invalidated-cluster-list-loop>53</invalidated-cluster-list-loop>
     <duplicate-prefix-advertisements>16</duplicate-prefix-advertisements>
     <loc-rib-routes>100</loc-rib-routes>
     <duplicate-withdraws>11</duplicate-withdraws>
     <invalidated-as-confed-loop>55</invalidated-as-confed-loop>
     <adj-ribs-in-routes>10</adj-ribs-in-routes>
     <invalidated-as-path-loop>66</invalidated-as-path-loop>
     <invalidated-originator-id>70</invalidated-originator-id>
     <rejected-prefixes>8</rejected-prefixes>
    </stats>
   </peer>
   <name>name</name>
   <description>description</description>
   <info>some info;</info>
  </router>
 </monitor>
</bmp-monitor>