First off ensure you have a "new" XRv or ASR9K load (XR 6.0 or later) and a "new" ODL (Beryllium or later).
Then ensure ODL is running the BGP and PCEP features (by doing "feature:install odl-bgpcep-bgp-all" and "feature:install odl-bgpcep-pcep-all").
Configure BGP on ODL. You have two options here:
- modify ~/etc/opendaylight/karaf/41-bgp-example.xml.
- change the local BGP RIB info. Search for "example-bgp-rib" and change the "local-as" and "bgp-rib-id" values to be your local AS and ODL's IP address.
- add the peer for XRv (one of your XRv nodes needs to be the BGP speaker). Look for the "example-bgp-peer" module, remove the comments around it, and edit the IP address.
- (optionally). If you want XR to be in a different ASN to ODL then add "<peer-role>ebgp</peer-role>" and "<remote-as>XXX</remote-as>" (replacing "XXX" with XR's ASN).
- (optionally). If you want ODL to listen on port 179 (so it can accept inbound connections from XR) then search for "binding-port" and modify the port to be 179 instead of 1790. Note that you'll need to run ODL as root for this to work.
- do an rm -rf on ODL's ~/data and ~/etc/opendaylight/current directories and restart ODL for the changes to take effect.
- PUTting the config from e.g. postman.
1) PUT the RIB: So e.g. PUT to http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:rib-impl/example-bgp-rib with:
{ "module" : [
{
"type": "odl-bgp-rib-impl-cfg:rib-impl",
"name": "example-bgp-rib",
"odl-bgp-rib-impl-cfg:bgp-rib-id": "10.0.0.1",
"odl-bgp-rib-impl-cfg:bgp-dispatcher": {
"type": "odl-bgp-rib-impl-cfg:bgp-dispatcher",
"name": "global-bgp-dispatcher"
},
"odl-bgp-rib-impl-cfg:extensions": {
"type": "odl-bgp-rib-spi-cfg:extensions",
"name": "global-rib-extensions"
},
"odl-bgp-rib-impl-cfg:tcp-reconnect-strategy": {
"type": "protocol-framework:reconnect-strategy-factory",
"name": "example-reconnect-strategy-factory"
},
"odl-bgp-rib-impl-cfg:rib-id": "example-bgp-rib",
"odl-bgp-rib-impl-cfg:session-reconnect-strategy": {
"type": "protocol-framework:reconnect-strategy-factory",
"name": "example-reconnect-strategy-factory"
},
"odl-bgp-rib-impl-cfg:local-table": [
{
"type": "odl-bgp-rib-impl-cfg:bgp-table-type",
"name": "ipv4-unicast"
},
{
"type": "odl-bgp-rib-impl-cfg:bgp-table-type",
"name": "ipv6-unicast"
},
{
"type": "odl-bgp-rib-impl-cfg:bgp-table-type",
"name": "linkstate"
},
{
"type": "odl-bgp-rib-impl-cfg:bgp-table-type",
"name": "ipv4-flowspec"
},
{
"type": "odl-bgp-rib-impl-cfg:bgp-table-type",
"name": "ipv6-flowspec"
},
{
"type": "odl-bgp-rib-impl-cfg:bgp-table-type",
"name": "labeled-unicast"
}
],
"odl-bgp-rib-impl-cfg:data-provider": {
"type": "opendaylight-md-sal-binding:binding-async-data-broker",
"name": "pingpong-binding-data-broker"
},
"odl-bgp-rib-impl-cfg:dom-data-provider": {
"type": "opendaylight-md-sal-dom:dom-async-data-broker",
"name": "pingpong-broker"
},
"odl-bgp-rib-impl-cfg:codec-tree-factory": {
"type": "opendaylight-md-sal-binding:binding-codec-tree-factory",
"name": "runtime-mapping-singleton"
},
"odl-bgp-rib-impl-cfg:local-as": 64496
}
]
}
(remember to change the IP address for the bgp-rib-id, and if needed the local-as)
(also note that for ODL Beryllium and later the "flowspec" stanza is replaced by separate "ipv4-flowspec" and "ipv6-flowspec" stanzas, though of course you only need to include the address families you plan to use. The same applies to the peer config below).
2) PUT the peer - as above only one of the XR nodes needs to speak BGP. Note that you only need to enable the address families that you wish to use (they are listed under "advertized-table").
So e.g. PUT to http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/example-bgp-peer with:
{ "module" : [
{
"type": "odl-bgp-rib-impl-cfg:bgp-peer",
"name": "example-bgp-peer",
"odl-bgp-rib-impl-cfg:host":"10.0.0.2",
"odl-bgp-rib-impl-cfg:initiate-connection": true,
"odl-bgp-rib-impl-cfg:rib": {
"type": "odl-bgp-rib-impl-cfg:rib-instance",
"name": "example-bgp-rib"
},
"odl-bgp-rib-impl-cfg:peer-registry": {
"type": "odl-bgp-rib-impl-cfg:bgp-peer-registry",
"name": "global-bgp-peer-registry"
},
"odl-bgp-rib-impl-cfg:advertized-table": [
{
"type": "odl-bgp-rib-impl-cfg:bgp-table-type",
"name": "ipv4-unicast"
},
{
"type": "odl-bgp-rib-impl-cfg:bgp-table-type",
"name": "linkstate"
}
]
}
]
}
(again remember to change the IP address for the host)
Now configure BGP on XRv. So e.g.
router bgp 64496
bgp router-id 10.0.0.2
address-family link-state link-state
!
neighbor 10.0.0.1
remote-as 64496
address-family link-state link-state
!
Ensure XRv also has ISIS or OSPF routes distributed into BGP-LS using the following command within ISIS or OSPF:
distribute bgp-ls
Now verify that the BGP session comes up. In ODL you ought to be able to do a GET on e.g.: http://localhost:8181/restconf/operational/network-topology:network-topology/topology/example-linkstate-topology and see BGP-LS topology info.
Now configure PCE-P on all of your XRv instances. under "mpls traffic-eng" you want something like:
pce
peer ipv4 10.0.0.1
!
stateful-client
instantiation
delegation
!
!
auto-tunnel pcc
tunnel-id min 101 max 200
Note that for PCE-P to come up your ODL instance will need to be able to route back to the loopback addresses in your XRv network. If those are e.g. in 192.168.0.0/24 then go to the ODL host and do something like:
sudo route add -net 192.168.0.0/24 gw 10.0.0.2
if you want this to persist after a reboot then edit /etc/network/interfaces (this is assuming Ubuntu) and add:
up route add -net 192.168.0.0/24 gw 10.0.0.2
Alternatively you can configure XR to use a different source interface for PCE-P using "mpls traffic-eng pce peer source ipv4 a.b.c.d" and selecting e.g. the address of the management interface.
Then check PCE-P has come up on ODL by looking at e.g. http://localhost:8181/restconf/operational/network-topology:network-topology/topology/pcep-topology. You should see a list of PCE-P nodes. If not then look for ESTABLISHED inbound connections to port 4189 on the ODL host and if they're missing then verify you can ping the router loopbacks and that there are no filters in e.g. iptables blocking inbound connections.
Having done all this you can start adding LSPs etc.
There are two modes for PCE-P LSPs
Firstly the LSP may be configured in XR and delegated to PCE-P. So the LSP will be configured something like:
interface tunnel-te1
ipv4 unnumbered Loopback0
signalled-name foo
autoroute announce
!
destination 192.168.0.4
pce
delegation
!
!
So then the LSP can be brought up by using the update-lsp RPC (http://localhost:8181/restconf/operations/network-topology-pcep/update-lsp):
{
"input" : {
"node" : "pcc://192.168.0.1",
"name" : "foo",
"network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]",
"arguments": {
"lsp": {
"administrative": "true",
"delegate": "true"
},
"ero" : {
"subobject" : [
{
"loose" : "false",
"ip-prefix" : { "ip-prefix" : "192.168.99.2/32" }
},
{
"loose" : "false",
"ip-prefix" : { "ip-prefix" : "192.168.0.4/32" }
}
]
}
}
}
}
(note that there will be one sub-object per link the LSP traverses - using the address of the far end of the link - plus one for the loopback address of the egress router).
The response to the RPC should be empty (i.e. '{ "output": {} }').
Once you have done this the LSP should be visible under the PCC in the pcep-topology, or by doing a "show mpls traffic-eng tunnels" in XR.
Alternatively the LSP may be created/deleted dynamically by ODL using the add-lsp RPC (http://localhost:8181/restconf/operations/network-topology-pcep/add-lsp):
{
"input": {
"node": "pcc://192.168.0.1",
"name": "bar",
"network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]",
"arguments": {
"odl-pcep-ietf-stateful07:lsp" : {
"delegate" : "true",
"administrative" : "true"
},
"endpoints-obj": {
"ipv4": {
"source-ipv4-address": "192.168.0.1",
"destination-ipv4-address": "192.168.0.4"
}
},
"ero" : {
"subobject" : [
{
"loose" : "false",
"ip-prefix" : {
"ip-prefix" : "192.168.99.2/32"
}
},
{
"loose" : "false",
"ip-prefix" : {
"ip-prefix" : "192.168.0.4/32"
}
}
]
}
}
}
}
Again the LSP should then be visible in the pcep-topology and in XR. In XR the tunnel number will be in the range given in the MPLS-TE config for dynamic tunnels.
you can still update the LSP (e.g. to change path or to add bandwidth) using update-lsp:
{
"input" : {
"node" : "pcc://192.168.0.1",
"name" : "bar",
"network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]",
"arguments": {
"lsp": {
"administrative": "true",
"delegate": "true"
},
"bandwidth": {
"bandwidth": "QvoAAA=="
},
"ero" : {
"subobject" : [
{
"loose" : "false",
"ip-prefix" : { "ip-prefix" : "192.168.99.2/32" }
},
{
"loose" : "false",
"ip-prefix" : { "ip-prefix" : "192.168.0.2/32" }
}
]
}
}
}
}
(note that a full ERO must still be given even if not changing the path).
you can then delete the LSP if required using the remove-lsp RPC (http://localhost:8181/restconf/operations/network-topology-pcep/remove-lsp):
{
"input" : {
"node" : "pcc://192.168.0.1",
"name" : "bar",
"network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
}
}
Note that one constraint with ODL is that dynamically-generated LSPs don't support autoroute (as autoroute isn't part of the standard). But there are Cisco-proprietary extensions available (e.g. in Cisco OSC) to enable that. E.g. include the following within "arguments", "lsp":
"tlvs" : {
"vs-tlv" : {
"enterprise-number" : 9,
"pcep-cisco-specific:fcid" : 1
}
}
(you'll also need to configure "mpls traffic-eng pce stateful-client cisco-extension" on XR)
Enjoy!