5 OpenDaylight comes pre-configured in the installation. You can find it in the opendaylight/configuration/initial directory and it consists of two files:
7 https://jenkins.opendaylight.org/integration/view/Integration%20jobs/job/integration-master-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/serviceprovider/target/distributions-serviceprovider-0.2.0-SNAPSHOT-osgipackage/opendaylight/configuration/initial/31-bgp.xml[31-bgp.xml], which defines the basic parser and RIB support. Unless you need to add a new AFI/SAFI, you should keep this file as is. +
9 https://jenkins.opendaylight.org/integration/view/Integration%20jobs/job/integration-master-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/serviceprovider/target/distributions-serviceprovider-0.2.0-SNAPSHOT-osgipackage/opendaylight/configuration/initial/41-bgp-example.xml[41-bgp-example.xml], which contains a sample configuration which needs to be customized to your deployment.
11 *Currently the configuration for BGP peer is ignored in the configuration, to prevent the client from starting with default configuration. Therefore the first step is to uncomment ALL the commented parts in this file.*
13 . Adjust values for initial BGP Open message
18 <type>prefix:rib-impl</type>
19 <name>example-bgp-rib</name>
20 <rib-id>example-bgp-rib</rib-id>
21 <local-as>64496</local-as> // Our AS number, we use this in best path selection
22 <bgp-id>192.0.2.2</bgp-id> // Our BGP identifier, we use this in best path selection
24 . Specify IP address of your BGP speaker
28 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
31 <name>example-bgp-peer</name>
32 <host>192.0.2.1</host> // IP address or hostname of the speaker
33 <holdtimer>180</holdtimer>
35 You can also add more BGP peers with different instance name and hostname.
39 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
42 <name>example-bgp-peer2</name>
43 <host>192.0.2.2</host>
44 <holdtimer>180</holdtimer>
47 . Configure connection attributes (all in milliseconds)
51 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:reconnectstrategy">
52 prefix:timed-reconnect-strategy
54 <name>example-reconnect-strategy</name>
55 <min-sleep>1000</min-sleep> // Minimum sleep time in between reconnect tries
56 <max-sleep>180000</max-sleep> // Maximum sleep time in between reconnect tries
57 <sleep-factor>2.00</sleep-factor> // Power factor of the sleep time between reconnect tries
58 <connect-time>5000</connect-time> // How long we should wait for the TCP connect attempt, overrides default connection timeout dictated by TCP retransmits
60 <type xmlns:netty="urn:opendaylight:params:xml:ns:yang:controller:netty">
61 netty:netty-event-executor
63 <name>global-event-executor</name>
68 ==== BGP speaker configuration +
70 Previous entries addressed the configuration of a BGP connection initiated by ODL. ODL also supports BGP Speaker functionality and accepts incoming BGP connections.
72 The configuration of BGP speaker is located in https://jenkins.opendaylight.org/integration/view/Integration%20jobs/job/integration-master-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/serviceprovider/target/distributions-serviceprovider-0.2.0-SNAPSHOT-osgipackage/opendaylight/configuration/initial/41-bgp-example.xml[41-bgp-example.xml].
76 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
77 prefix:bgp-peer-acceptor
79 <name>bgp-peer-server</name>
80 <!--Default parameters-->
81 <!--<binding-address>0.0.0.0</binding-address>-->
82 <!--<binding-port>179</binding-port>-->
84 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
87 <name>global-bgp-dispatcher</name>
89 <!--Drops or accepts incoming BGP connection, every BGP Peer that should be accepted needs to be added to this registry-->
91 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
92 prefix:bgp-peer-registry
94 <name>global-bgp-peer-registry</name>
99 . Changing speaker configuration
101 * Changing binding address: Uncomment tag binding-address and change the address to e.g. 127.0.0.1. The default binding address is 0.0.0.0.
102 * Changing binding port: Uncomment tag binding-port and change the port to e.g. 1790. The default binding port is 179 as specified in BGP RFC.
103 . Configuring incoming BGP connections
105 By default, the *BGP speaker drops all BGP connections from unknown BGP peers*. The decision is made in component bgp-peer-registry that is injected into the speaker (The registry is configured in 31-bgp.xml).
107 To add BGP Peer configuration into the registry, it is necessary to configure regular BGP peer just like in example in https://jenkins.opendaylight.org/integration/view/Integration%20jobs/job/integration-master-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/serviceprovider/target/distributions-serviceprovider-0.2.0-SNAPSHOT-osgipackage/opendaylight/configuration/initial/41-bgp-example.xml[41-bgp-example.xml]. Notice that the BGP peer depends on the same _bgp-peer-registry as bgp-speaker_:
111 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
114 <name>example-bgp-peer</name>
115 <host>192.0.2.1</host>
118 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
119 prefix:bgp-peer-registry
121 <name>global-bgp-peer-registry</name>
126 BGP peer registers itself into the registry, which allows incoming BGP connections handled by the _bgp-speaker_. (Config attribute _peer-registry_ is optional for now to preserve backwards compatibility). With this configuration, the connection to 192.0.2.1 is initiated by ODL but will also be accepted from 192.0.2.1. In case both connections are being established, only one of them will be preserved and the other will be dropped. The connection initiated from device with lower bgp id will be dropped by the registry.
128 There is a way to configure the peer only for incoming connections (The connection will not be initiated by the ODL, ODL will only wait for incoming connection from the peer. The peer is identified by its IP address). To configure peer only for incoming connection add attribute _initiate-connection_ to peer configuration:
132 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
135 <name>example-bgp-peer</name>
136 <host>192.0.2.1</host> // IP address or hostname of the speaker
137 <holdtimer>180</holdtimer>
138 <initiate-connection>false</initiate-connection> // Connection will not be initiated by ODL
142 The attribute initiate-connection is optional with the default value set to *true*.
144 *Application peer configuration* +
146 Application peer is a special type of BGP peer. It has own BGP RIB. This RIB can be populated through RESTCONF.
147 If ODL is set as BGP speaker, the changes are sent to other BGP clients as well. To properly configure application peer, add following lines to https://jenkins.opendaylight.org/integration/view/Integration%20jobs/job/integration-master-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/serviceprovider/target/distributions-serviceprovider-0.2.0-SNAPSHOT-osgipackage/opendaylight/configuration/initial/41-bgp-example.xml[41-bgp-example.xml] and make appropriate changes.
151 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
152 prefix:bgp-application-peer
154 <name>example-bgp-peer-app</name>
155 <bgp-id>10.1.9.9</bgp-id> <!-- Your local BGP-ID that will be used in BGP Best Path Selection algorithm -->
157 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
160 <name>example-bgp-rib</name> <!-- RIB where the changes from application RIB should be propagated -->
162 <application-rib-id>example-app-rib</application-rib-id> <!-- Your application RIB identifier -->
164 <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
165 binding:binding-async-data-broker
167 <name>binding-data-broker</name>
172 OpenDaylight is pre-configured with baseline PCEP configuration. The default shipped configuration will start a PCE server on port 4189.
174 https://jenkins.opendaylight.org/integration/view/Integration%20jobs/job/integration-master-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/serviceprovider/target/distributions-serviceprovider-0.2.0-SNAPSHOT-osgipackage/opendaylight/configuration/initial/32-pcep.xml[32-pcep.xml] - basic PCEP configuration, including session parameters
175 https://jenkins.opendaylight.org/integration/view/Integration%20jobs/job/integration-master-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/serviceprovider/target/distributions-serviceprovider-0.2.0-SNAPSHOT-osgipackage/opendaylight/configuration/initial/39-pcep-provider.xml[39-pcep-provider.xml] - configuration for PCEP provider
177 ==== Configure draft versions +
179 There are already two extensions for PCEP:
180 https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-09[draft-ietf-pce-stateful-pce] - in versions 02 and 07
181 https://tools.ietf.org/html/draft-ietf-pce-pce-initiated-lsp-01[draft-ietf-pce-pce-initiated-lsp] - versions crabbe-initiated-00 and ietf-initiated-00.
183 NOTE: It is important to load the extensions with compatible versions because they extend each other. In this case crabbe-initiated-00 is compatible with stateful-02 and ietf-initiated-00 is compatible with stateful-07. Default configuration is to use newest versions of the drafts.
185 Complete the following steps in order to get stateful02 PCEP connection running and synchronized.
187 To use older version:
188 . Switch commented code to ignore stateful-7 and ietf-initiated-00 versions in https://jenkins.opendaylight.org/integration/view/Integration%20jobs/job/integration-master-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/serviceprovider/target/distributions-serviceprovider-0.2.0-SNAPSHOT-osgipackage/opendaylight/configuration/initial/32-pcep.xml[32-pcep.xml]:
191 <!-- This block is draft-ietf-pce-stateful-pce-07 + draft-ietf-pce-inititated-pce-00 -->
193 <type>pcepspi:extension</type>
194 <name>pcep-parser-ietf-stateful07</name>
197 <type>pcepspi:extension</type>
198 <name>pcep-parser-ietf-initiated00</name>
200 <!-- This block is draft-ietf-pce-stateful-pce-02 + draft-crabbe-pce-inititated-pce-00 -->
202 <type xmlns:pcepspi="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">
205 <name>pcep-parser-ietf-stateful02</name>
208 <type xmlns:pcepspi="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">
211 <name>pcep-parser-crabbe-initiated00</name>
214 . In the same file, make sure the proposal matches your chosen draft version. Change _stateful07-proposal_ to _stateful02-proposal_:
218 <pcep-session-proposal-factory>
219 <type>pcep:pcep-session-proposal-factory</type>
220 <name>stateful02-proposal</name>
221 </pcep-session-proposal-factory>
223 . In https://jenkins.opendaylight.org/integration/view/Integration%20jobs/job/integration-master-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/serviceprovider/target/distributions-serviceprovider-0.2.0-SNAPSHOT-osgipackage/opendaylight/configuration/initial/39-pcep-provider.xml[39-pcep-provider.xml], stateful-plugin also needs to match. Change _stateful07_ to _stateful02_:
226 <type>prefix:pcep-topology-stateful</type>
227 <name>stateful02</name>
230 ==== Configure PCEP segment routing
231 http://tools.ietf.org/html/draft-sivabalan-pce-segment-routing-02[draft-sivabalan-pce-segment-routing-02] PCEP extension for Segment Routing
233 PCEP Segment Routing initial configuration:
234 https://jenkins.opendaylight.org/bgpcep/job/bgpcep-nightly/ws/pcep/controller-config/src/main/resources/initial/33-pcep-segment-routing.xml[33-pcep-segment-routing.xml] +
236 * To use Segment Routing uncomment two commented blocks +
238 * Activate parsers/serializes extension: +
240 ** Create _pcep-parser-segment-routing02_ instance
241 ** Reconfigure (inject into list of extensions) global-pcep-extensions
245 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:sr02:cfg">
246 prefix:pcep-parser-segment-routing02
248 <name>pcep-parser-segment-routing02</name>
251 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">
252 prefix:pcep-extensions-impl
254 <name>global-pcep-extensions</name>
256 <type xmlns:pcepspi="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">
259 <name>pcep-parser-segment-routing02</name>
265 <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
267 <type xmlns:pcepspi="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">
271 <name>pcep-parser-segment-routing02</name>
272 <provider>/config/modules/module[name='pcep-parser-segment-routing02']/instance[name='pcep-parser-segment-routing02']</provider>
277 * Advertise Segment Routing capability in Open Message:
278 ** Instantiate pcep-session-proposal-factory-sr02
279 ** Reconfigure _global-pcep-dispatcher_
283 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:sr02:cfg">
284 prefix:pcep-session-proposal-factory-sr02
286 <name>pcep-session-proposal-factory-sr02</name>
289 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:impl">
290 prefix:pcep-dispatcher-impl
292 <name>global-pcep-dispatcher</name>
293 <pcep-session-proposal-factory>
294 <type xmlns:pcep="urn:opendaylight:params:xml:ns:yang:controller:pcep">
295 pcep:pcep-session-proposal-factory
297 <name>pcep-session-proposal-factory-sr02</name>
298 </pcep-session-proposal-factory>
303 <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
305 <type xmlns:pcep="urn:opendaylight:params:xml:ns:yang:controller:pcep">
306 pcep:pcep-session-proposal-factory
309 <name>pcep-session-proposal-factory-sr02</name>
310 <provider>/config/modules/module[name='pcep-session-proposal-factory-sr02']/instance[name='pcep-session-proposal-factory-sr02']</provider>