LACP user guide updated.
[docs.git] / manuals / user-guide / src / main / asciidoc / lacp / lacp-user.adoc
1 == Link Aggregation Control Protocol User Guide
2
3 === Overview
4 This section contains information about how to use the LACP plugin project with OpenDaylight, including configurations.
5
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].
8
9 === Configuring Link Aggregation Control Protocol
10
11 This feature can be enabled in the Karaf console of the OpenDaylight Karaf distribution by issuing the following command:
12
13  feature:install odl-lacp-ui
14
15 [NOTE]
16 ====
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.
19 ====
20
21 === Administering or Managing Link Aggregation Control Protocol
22 LACP-discovered network inventory and network statistics can be viewed using the following REST APIs.
23
24 1. List of aggregators available for a node:
25 +
26  http://<ControllerIP>:8181/restconf/operational/opendaylight-inventory:nodes/node/<node-id>
27 +
28 Aggregator information will appear within the +<lacp-aggregators>+ XML tag.
29
30 2. To view only the information of an aggregator:
31 +
32  http://<ControllerIP>:8181/restconf/operational/opendaylight-inventory:nodes/node/<node-id>/lacp-aggregators/<agg-id>
33 +
34 The group ID associated with the aggregator can be found inside the +<lag-groupid>+ XML tag.
35 +
36 The group table entry information for the +<lag-groupid>+ added for the aggregator is also available in the +opendaylight-inventory+ node database.
37
38 3. To view physical port information.
39 +
40  http://<ControllerIP>:8181/restconf/operational/opendaylight-inventory:nodes/node/<node-id>/node-connector/<node-connector-id>
41 +
42 Ports that are associated with an aggregator will have the tag +<lacp-agg-ref>+ updated with valid aggregator information.
43
44 === Tutorials
45 The below tutorial demonstrates LACP LAG creation for a sample mininet topology.
46
47 ==== Sample LACP Topology creation on Mininet
48  sudo mn --controller=remote,ip=<Controller IP> --topo=linear,1 --switch ovsk,protocols=OpenFlow13
49
50 The above command will create a virtual network consisting of a switch and a host. The switch will be connected to the controller.
51
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:
53
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
57
58 Configure an additional link between the switch (s1) and host (h1) using the below command on mininet shell to aggregate 2 links:
59
60  mininet> py net.addLink(s1, net.get('h1'))
61  mininet> py s1.attach('s1-eth2')
62
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:
65
66         alias bond0 bonding
67         options bonding mode=4
68
69 Here mode=4 is referred to LACP and the default timeout is set to long.
70
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:
72
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')
81
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:
83
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)
88  MII Status: up
89  MII Polling Interval (ms): 100
90  Up Delay (ms): 0
91  Down Delay (ms): 0
92  802.3ad info
93  LACP rate: slow
94  Min links: 0
95  Aggregator selection policy (ad_select): stable
96  Active Aggregator Info:
97          Aggregator ID: 1
98          Number of ports: 2
99          Actor Key: 33
100          Partner Key: 27
101          Partner Mac Address: 00:00:00:00:01:01
102  
103  Slave Interface: h1-eth0
104  MII Status: up
105  Speed: 10000 Mbps
106  Duplex: full
107  Link Failure Count: 0
108  Permanent HW addr: 00:00:00:00:00:11
109  Aggregator ID: 1
110  Slave queue ID: 0
111  
112  Slave Interface: h1-eth1
113  MII Status: up
114  Speed: 10000 Mbps
115  Duplex: full
116  Link Failure Count: 0
117  Permanent HW addr: 00:00:00:00:00:12
118  Aggregator ID: 1
119  Slave queue ID: 0
120
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:
122
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
126
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:
128
129  sudo ovs-ofctl -O Openflow13 add-flow s1 dl_type=0x0806,dl_src=SRC_MAC,dl_dst=DST_MAC,actions=group:60169