1 == Link Aggregation Control Protocol User Guide
4 This section contains information about how to use the LACP plugin project with OpenDaylight, including configurations.
6 === Link Aggregation Control Protocol Architecture
7 The LACP Project within OpenDaylight implements Link Aggregation Control Protocol (LACP) as an MD-SAL service module and will be used to auto-discover and aggregate multiple links between an OpenDaylight controlled network and LACP-enabled endpoints or switches. The result is the creation of a logical channel, which represents the aggregation of the links. Link aggregation provides link resiliency and bandwidth aggregation. This implementation adheres to IEEE Ethernet specification link:http://www.ieee802.org/3/hssg/public/apr07/frazier_01_0407.pdf[802.3ad].
9 === Configuring Link Aggregation Control Protocol
11 This feature can be enabled in the Karaf console of the OpenDaylight Karaf distribution by issuing the following command:
13 feature:install odl-lacp-ui
17 1. Ensure that legacy (non-OpenFlow) switches are configured with LACP mode active with a long timeout to allow for the LACP plugin in OpenDaylight to respond to its messages.
18 2. Flows that want to take advantage of LACP-configured Link Aggregation Groups (LAGs) must explicitly use a OpenFlow group table entry created by the LACP plugin. The plugin only creates group table entries, it does not program any flows on its own.
21 === Administering or Managing Link Aggregation Control Protocol
22 LACP-discovered network inventory and network statistics can be viewed using the following REST APIs.
24 1. List of aggregators available for a node:
26 http://<ControllerIP>:8181/restconf/operational/opendaylight-inventory:nodes/node/<node-id>
28 Aggregator information will appear within the +<lacp-aggregators>+ XML tag.
30 2. To view only the information of an aggregator:
32 http://<ControllerIP>:8181/restconf/operational/opendaylight-inventory:nodes/node/<node-id>/lacp-aggregators/<agg-id>
34 The group ID associated with the aggregator can be found inside the +<lag-groupid>+ XML tag.
36 The group table entry information for the +<lag-groupid>+ added for the aggregator is also available in the +opendaylight-inventory+ node database.
38 3. To view physical port information.
40 http://<ControllerIP>:8181/restconf/operational/opendaylight-inventory:nodes/node/<node-id>/node-connector/<node-connector-id>
42 Ports that are associated with an aggregator will have the tag +<lacp-agg-ref>+ updated with valid aggregator information.
45 The below tutorial demonstrates LACP LAG creation for a sample mininet topology.
47 ==== Sample LACP Topology creation on Mininet
48 sudo mn --controller=remote,ip=<Controller IP> --topo=linear,1 --switch ovsk,protocols=OpenFlow13
50 The above command will create a virtual network consisting of a switch and a host. The switch will be connected to the controller.
52 Once the topology is discovered, verify the presence of a flow entry with "dl_type" set to "0x8809" to handle LACP packets using the below ovs-ofctl command:
54 ovs-ofctl -O OpenFlow13 dump-flows s1
55 OFPST_FLOW reply (OF1.3) (xid=0x2):
56 cookie=0x300000000000001e, duration=60.067s, table=0, n_packets=0, n_bytes=0, priority=5,dl_dst=01:80:c2:00:00:02,dl_type=0x8809 actions=CONTROLLER:65535
58 Configure an additional link between the switch (s1) and host (h1) using the below command on mininet shell to aggregate 2 links:
60 mininet> py net.addLink(s1, net.get('h1'))
61 mininet> py s1.attach('s1-eth2')
63 The LACP module will listen for LACP control packets that are generated from legacy switch (non-OpenFlow enabled). In our example, host (h1) will act as a LACP packet generator.
64 In order to generate the LACP control packets, a bond interface has to be created on the host (h1) with mode type set to LACP with long-timeout. To configure bond interface, create a new file bonding.conf under the /etc/modprobe.d/ directory and insert the below lines in this new file:
67 options bonding mode=4
69 Here mode=4 is referred to LACP and the default timeout is set to long.
71 Enable bond interface and associate both physical interface h1-eth0 & h1-eth1 as members of the bond interface on host (h1) using the below commands on the mininet shell:
73 mininet> py net.get('h1').cmd('modprobe bonding')
74 mininet> py net.get('h1').cmd('ip link add bond0 type bond')
75 mininet> py net.get('h1').cmd('ip link set bond0 address <bond-mac-address>')
76 mininet> py net.get('h1').cmd('ip link set h1-eth0 down')
77 mininet> py net.get('h1').cmd('ip link set h1-eth0 master bond0')
78 mininet> py net.get('h1').cmd('ip link set h1-eth1 down')
79 mininet> py net.get('h1').cmd('ip link set h1-eth1 master bond0')
80 mininet> py net.get('h1').cmd('ip link set bond0 up')
82 Once the bond0 interface is up, the host (h1) will send LACP packets to the switch (s1). The LACP Module will then create a LAG through exchange of LACP packets between the host (h1) and switch (s1). To view the bond interface output on the host (h1) side:
84 mininet> py net.get('h1').cmd('cat /proc/net/bonding/bond0')
85 Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
86 Bonding Mode: IEEE 802.3ad Dynamic link aggregation
87 Transmit Hash Policy: layer2 (0)
89 MII Polling Interval (ms): 100
95 Aggregator selection policy (ad_select): stable
96 Active Aggregator Info:
101 Partner Mac Address: 00:00:00:00:01:01
103 Slave Interface: h1-eth0
107 Link Failure Count: 0
108 Permanent HW addr: 00:00:00:00:00:11
112 Slave Interface: h1-eth1
116 Link Failure Count: 0
117 Permanent HW addr: 00:00:00:00:00:12
121 A corresponding group table entry would be created on the OpenFlow switch (s1) with "type" set to "select" to perform the LAG functionality. To view the group entries:
123 mininet>ovs-ofctl -O Openflow13 dump-groups s1
124 OFPST_GROUP_DESC reply (OF1.3) (xid=0x2):
125 group_id=60169,type=select,bucket=weight:0,actions=output:1,output:2
127 To apply the LAG functionality on the switches, the flows should be configured with action set to GroupId instead of output port. A sample add-flow configuration with output action set to GroupId:
129 sudo ovs-ofctl -O Openflow13 add-flow s1 dl_type=0x0806,dl_src=SRC_MAC,dl_dst=DST_MAC,actions=group:60169