Updated BGPCEP file 46/11646/1
authorMathieu Lemay <mlemay@inocybe.com>
Mon, 29 Sep 2014 01:02:55 +0000 (21:02 -0400)
committerMathieu Lemay <mlemay@inocybe.com>
Mon, 29 Sep 2014 01:02:55 +0000 (21:02 -0400)
Content by Shahida

Change-Id: Ib1ef8efa3096844918b51aeaab0179ab67cfcdbc
Signed-off-by: Mathieu Lemay <mlemay@inocybe.com>
manuals/user-guide/src/main/asciidoc/addons/bgpcep.adoc

index 96bc4f6ad9cb2f30deac2de89e4adcc36f08d52b..0b36c9241a1b2d5a88ca3a44b69a4368580b1d10 100644 (file)
@@ -1,4 +1,270 @@
-==  BGPCEP
+==  BGP LS PCEP
 
-https://wiki.opendaylight.org/view/BGP_LS_PCEP:Helium_User_Guide
+This chapter has the following sections:
 
+* BGP
+* PCEP
+
+OpenDaylight comes pre-configured in the installation. You can find it in the opendaylight/configuration/initial directory and it consists of two files:
+
+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. +
+
+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.
+
+*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.*
+
+. Adjust values for initial BGP Open message
++
+
+[literal]
+<module>
+    <type>prefix:rib-impl</type>
+    <name>example-bgp-rib</name>
+    <rib-id>example-bgp-rib</rib-id>
+    <local-as>64496</local-as>         // Our AS number, we use this in best path selection
+    <bgp-id>192.0.2.2</bgp-id>         // Our BGP identifier, we use this in best path selection
+       
+. Specify IP address of your BGP speaker
+
+[literal]
+<module>
+    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+    <name>example-bgp-peer</name>
+    <host>192.0.2.1</host>                         // IP address or hostname of the speaker
+    <holdtimer>180</holdtimer>
+
+You can also add more BGP peers with different instance name and hostname.
+
+[literal]
+<module>
+    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+    <name>example-bgp-peer2</name>
+    <host>192.0.2.2</host>
+    <holdtimer>180</holdtimer>
+
+[start = 3]    
+. Configure connection attributes (all in milliseconds)
+
+[literal]
+<module>
+   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:reconnectstrategy">prefix:timed-reconnect-strategy</type>
+   <name>example-reconnect-strategy</name>
+   <min-sleep>1000</min-sleep>             // Minimum sleep time in between reconnect tries
+   <max-sleep>180000</max-sleep>           // Maximum sleep time in between reconnect tries
+   <sleep-factor>2.00</sleep-factor>       // Power factor of the sleep time between reconnect tries
+   <connect-time>5000</connect-time>       // How long we should wait for the TCP connect attempt, overrides default connection timeout dictated by TCP retransmits
+   <executor>
+       <type xmlns:netty="urn:opendaylight:params:xml:ns:yang:controller:netty">netty:netty-event-executor</type>
+       <name>global-event-executor</name>
+   </executor>
+</module>
+
+
+=== BGP speaker configuration +
+
+Previous entries addressed the configuration of a BGP connection initiated by ODL. ODL also supports BGP Speaker functionality and accepts incoming BGP connections. 
+
+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].
+
+---------------------
+<module>
+   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-acceptor</type>
+   <name>bgp-peer-server</name>
+   <!--Default parameters-->
+    <!--<binding-address>0.0.0.0</binding-address>-->
+    <!--<binding-port>179</binding-port>-->
+   <bgp-dispatcher>
+       <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-dispatcher</type>
+       <name>global-bgp-dispatcher</name>
+   </bgp-dispatcher>
+   <!--Drops or accepts incoming BGP connection, every BGP Peer that should be accepted needs to be added to this registry-->
+   <peer-registry>
+       <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
+       <name>global-bgp-peer-registry</name>
+   </peer-registry>
+</module>
+---------------------
+
+. Changing speaker configuration
+
+* 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.
+* 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.
+. Configuring incoming BGP connections
+
+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). 
+
+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_:
+[literal]
+
+<module>
+    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+    <name>example-bgp-peer</name>
+    <host>192.0.2.1</host>
+    ...
+    <peer-registry>
+        <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
+        <name>global-bgp-peer-registry</name>
+    </peer-registry>
+    ...
+</module>
+
+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. 
+
+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:
+
+[literal]
+<module>
+    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+    <name>example-bgp-peer</name>
+    <host>192.0.2.1</host>                         // IP address or hostname of the speaker
+    <holdtimer>180</holdtimer>
+    <initiate-connection>false</initiate-connection>  // Connection will not be initiated by ODL
+    ...
+</module>
+
+The attribute initiate-connection is optional with the default value set to *true*.
+
+*Application peer configuration* +
+
+Application peer is a special type of BGP peer. It has own BGP RIB. This RIB can be populated through RESTCONF. 
+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.
+
+[literal]
+<module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-application-peer</type>
+ <name>example-bgp-peer-app</name>
+ <bgp-id>10.1.9.9</bgp-id> <!-- Your local BGP-ID that will be used in BGP Best Path Selection algorithm -->
+ <target-rib>
+  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
+  <name>example-bgp-rib</name> <!-- RIB where the changes from application RIB should be propagated -->
+ </target-rib>
+ <application-rib-id>example-app-rib</application-rib-id>  <!-- Your application RIB identifier -->
+ <data-broker>
+  <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
+  <name>binding-data-broker</name>
+ </data-broker>
+</module>
+
+== PCEP
+OpenDaylight is pre-configured with baseline PCEP configuration. The default shipped configuration will start a PCE server on port 4189.
+
+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
+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
+
+=== Configure draft versions +
+
+There are already two extensions for PCEP: 
+https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-09[draft-ietf-pce-stateful-pce] - in versions 02 and 07 
+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.
+
+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.
+
+Complete the following steps in order to get stateful02 PCEP connection running and synchronized.
+
+To use older version: 
+. 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]:
+
+[literal]
+ <!-- This block is draft-ietf-pce-stateful-pce-07 + draft-ietf-pce-inititated-pce-00 -->
+ <!--extension>
+  <type>pcepspi:extension</type>
+  <name>pcep-parser-ietf-stateful07</name>
+ </extension>
+ <extension>
+  <type>pcepspi:extension</type>
+  <name>pcep-parser-ietf-initiated00</name>
+ </extension-->
+ <!-- This block is draft-ietf-pce-stateful-pce-02 + draft-crabbe-pce-inititated-pce-00 -->
+<extension>
+ <type xmlns:pcepspi="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">pcepspi:extension</type>
+ <name>pcep-parser-ietf-stateful02</name>
+</extension>
+<extension>
+ <type xmlns:pcepspi="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">pcepspi:extension</type>
+ <name>pcep-parser-crabbe-initiated00</name>
+</extension>
+
+. In the same file, make sure the proposal matches your chosen draft version. Change _stateful07-proposal_ to _stateful02-proposal_:
+
+[literal]
+
+<pcep-session-proposal-factory>
+    <type>pcep:pcep-session-proposal-factory</type>
+    <name>stateful02-proposal</name>
+</pcep-session-proposal-factory>
+
+. 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_:
+[literal]
+<stateful-plugin>
+    <type>prefix:pcep-topology-stateful</type>
+    <name>stateful02</name>
+</stateful-plugin>
+
+=== Configure PCEP segment routing
+http://tools.ietf.org/html/draft-sivabalan-pce-segment-routing-02[draft-sivabalan-pce-segment-routing-02] PCEP extension for Segment Routing
+
+PCEP Segment Routing initial configuration:
+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] +
+
+* To use Segment Routing uncomment two commented blocks + 
+
+* Activate parsers/serializes extension: +
+
+** Create _pcep-parser-segment-routing02_ instance
+** Reconfigure (inject into list of extensions) global-pcep-extensions
+
+[literal]
+<module>
+    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:sr02:cfg">prefix:pcep-parser-segment-routing02</type>
+    <name>pcep-parser-segment-routing02</name>
+</module>
+<module>
+    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">prefix:pcep-extensions-impl</type>
+    <name>global-pcep-extensions</name>
+    <extension>
+        <type xmlns:pcepspi="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">pcepspi:extension</type>
+        <name>pcep-parser-segment-routing02</name>
+    </extension>
+</module>
+.
+.
+.
+<services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+    <service>
+        <type xmlns:pcepspi="urn:opendaylight:params:xml:ns:yang:controller:pcep:spi">pcepspi:extension</type>
+        <instance>
+            <name>pcep-parser-segment-routing02</name>
+            <provider>/config/modules/module[name='pcep-parser-segment-routing02']/instance[name='pcep-parser-segment-routing02']</provider>
+        </instance>
+    </service>
+</services>
+
+* Advertise Segment Routing capability in Open Message:
+** Instantiate pcep-session-proposal-factory-sr02
+** Reconfigure _global-pcep-dispatcher_
+
+[literal]
+<module>
+    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:sr02:cfg">prefix:pcep-session-proposal-factory-sr02</type>
+    <name>pcep-session-proposal-factory-sr02</name>
+</module>
+<module>
+    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:pcep:impl">prefix:pcep-dispatcher-impl</type>
+    <name>global-pcep-dispatcher</name>
+    <pcep-session-proposal-factory>
+        <type xmlns:pcep="urn:opendaylight:params:xml:ns:yang:controller:pcep">pcep:pcep-session-proposal-factory</type>
+        <name>pcep-session-proposal-factory-sr02</name>
+    </pcep-session-proposal-factory>
+</module>
+.
+.
+.
+<services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+    <service>
+        <type xmlns:pcep="urn:opendaylight:params:xml:ns:yang:controller:pcep">pcep:pcep-session-proposal-factory</type>
+        <instance>
+            <name>pcep-session-proposal-factory-sr02</name>
+            <provider>/config/modules/module[name='pcep-session-proposal-factory-sr02']/instance[name='pcep-session-proposal-factory-sr02']</provider>
+        </instance>
+    </service>
+</services>