Merge "Add infrautils release note"
[docs.git] / docs / user-guide / link-aggregation-control-protocol-user-guide.rst
1 Link Aggregation Control Protocol User Guide
2 ============================================
3
4 Overview
5 --------
6
7 This section contains information about how to use the LACP plugin
8 project with OpenDaylight, including configurations.
9
10 Link Aggregation Control Protocol Architecture
11 ----------------------------------------------
12
13 The LACP Project within OpenDaylight implements Link Aggregation Control
14 Protocol (LACP) as an MD-SAL service module and will be used to
15 auto-discover and aggregate multiple links between an OpenDaylight
16 controlled network and LACP-enabled endpoints or switches. The result is
17 the creation of a logical channel, which represents the aggregation of
18 the links. Link aggregation provides link resiliency and bandwidth
19 aggregation. This implementation adheres to IEEE Ethernet specification
20 `802.3ad <http://www.ieee802.org/3/hssg/public/apr07/frazier_01_0407.pdf>`__.
21
22 Configuring Link Aggregation Control Protocol
23 ---------------------------------------------
24
25 This feature can be enabled in the Karaf console of the OpenDaylight
26 Karaf distribution by issuing the following command:
27
28 ::
29
30     feature:install odl-lacp-ui
31
32 .. note::
33
34     1. Ensure that legacy (non-OpenFlow) switches are configured with
35        LACP mode active with a long timeout to allow for the LACP plugin
36        in OpenDaylight to respond to its messages.
37
38     2. Flows that want to take advantage of LACP-configured Link
39        Aggregation Groups (LAGs) must explicitly use a OpenFlow group
40        table entry created by the LACP plugin. The plugin only creates
41        group table entries, it does not program any flows on its own.
42
43 Administering or Managing Link Aggregation Control Protocol
44 -----------------------------------------------------------
45
46 LACP-discovered network inventory and network statistics can be viewed
47 using the following REST APIs.
48
49 1. List of aggregators available for a node:
50
51    ::
52
53        http://<ControllerIP>:8181/restconf/operational/opendaylight-inventory:nodes/node/<node-id>
54
55    Aggregator information will appear within the ``<lacp-aggregators>``
56    XML tag.
57
58 2. To view only the information of an aggregator:
59
60    ::
61
62        http://<ControllerIP>:8181/restconf/operational/opendaylight-inventory:nodes/node/<node-id>/lacp-aggregators/<agg-id>
63
64    The group ID associated with the aggregator can be found inside the
65    ``<lag-groupid>`` XML tag.
66
67    The group table entry information for the ``<lag-groupid>`` added for
68    the aggregator is also available in the ``opendaylight-inventory``
69    node database.
70
71 3. To view physical port information.
72
73    ::
74
75        http://<ControllerIP>:8181/restconf/operational/opendaylight-inventory:nodes/node/<node-id>/node-connector/<node-connector-id>
76
77    Ports that are associated with an aggregator will have the tag
78    ``<lacp-agg-ref>`` updated with valid aggregator information.
79
80 Tutorials
81 ---------
82
83 The below tutorial demonstrates LACP LAG creation for a sample mininet
84 topology.
85
86 Sample LACP Topology creation on Mininet
87 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88
89 ::
90
91     sudo mn --controller=remote,ip=<Controller IP> --topo=linear,1 --switch ovsk,protocols=OpenFlow13
92
93 The above command will create a virtual network consisting of a switch
94 and a host. The switch will be connected to the controller.
95
96 Once the topology is discovered, verify the presence of a flow entry
97 with "dl\_type" set to "0x8809" to handle LACP packets using the below
98 ovs-ofctl command:
99
100 ::
101
102     ovs-ofctl -O OpenFlow13 dump-flows s1
103      OFPST_FLOW reply (OF1.3) (xid=0x2):
104      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
105
106 Configure an additional link between the switch (s1) and host (h1) using
107 the below command on mininet shell to aggregate 2 links:
108
109 ::
110
111     mininet> py net.addLink(s1, net.get('h1'))
112     mininet> py s1.attach('s1-eth2')
113
114 The LACP module will listen for LACP control packets that are generated
115 from legacy switch (non-OpenFlow enabled). In our example, host (h1)
116 will act as a LACP packet generator. In order to generate the LACP
117 control packets, a bond interface has to be created on the host (h1)
118 with mode type set to LACP with long-timeout. To configure bond
119 interface, create a new file bonding.conf under the /etc/modprobe.d/
120 directory and insert the below lines in this new file:
121
122 ::
123
124     alias bond0 bonding
125     options bonding mode=4
126
127 Here mode=4 is referred to LACP and the default timeout is set to long.
128
129 Enable bond interface and associate both physical interface h1-eth0 &
130 h1-eth1 as members of the bond interface on host (h1) using the below
131 commands on the mininet shell:
132
133 ::
134
135     mininet> py net.get('h1').cmd('modprobe bonding')
136     mininet> py net.get('h1').cmd('ip link add bond0 type bond')
137     mininet> py net.get('h1').cmd('ip link set bond0 address <bond-mac-address>')
138     mininet> py net.get('h1').cmd('ip link set h1-eth0 down')
139     mininet> py net.get('h1').cmd('ip link set h1-eth0 master bond0')
140     mininet> py net.get('h1').cmd('ip link set h1-eth1 down')
141     mininet> py net.get('h1').cmd('ip link set h1-eth1 master bond0')
142     mininet> py net.get('h1').cmd('ip link set bond0 up')
143
144 Once the bond0 interface is up, the host (h1) will send LACP packets to
145 the switch (s1). The LACP Module will then create a LAG through exchange
146 of LACP packets between the host (h1) and switch (s1). To view the bond
147 interface output on the host (h1) side:
148
149 ::
150
151     mininet> py net.get('h1').cmd('cat /proc/net/bonding/bond0')
152     Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
153     Bonding Mode: IEEE 802.3ad Dynamic link aggregation
154     Transmit Hash Policy: layer2 (0)
155     MII Status: up
156     MII Polling Interval (ms): 100
157     Up Delay (ms): 0
158     Down Delay (ms): 0
159     802.3ad info
160     LACP rate: slow
161     Min links: 0
162     Aggregator selection policy (ad_select): stable
163     Active Aggregator Info:
164             Aggregator ID: 1
165             Number of ports: 2
166             Actor Key: 33
167             Partner Key: 27
168             Partner Mac Address: 00:00:00:00:01:01
169
170 ::
171
172     Slave Interface: h1-eth0
173     MII Status: up
174     Speed: 10000 Mbps
175     Duplex: full
176     Link Failure Count: 0
177     Permanent HW addr: 00:00:00:00:00:11
178     Aggregator ID: 1
179     Slave queue ID: 0
180
181 ::
182
183     Slave Interface: h1-eth1
184     MII Status: up
185     Speed: 10000 Mbps
186     Duplex: full
187     Link Failure Count: 0
188     Permanent HW addr: 00:00:00:00:00:12
189     Aggregator ID: 1
190     Slave queue ID: 0
191
192 A corresponding group table entry would be created on the OpenFlow
193 switch (s1) with "type" set to "select" to perform the LAG
194 functionality. To view the group entries:
195
196 ::
197
198     mininet>ovs-ofctl -O Openflow13 dump-groups s1
199     OFPST_GROUP_DESC reply (OF1.3) (xid=0x2):
200      group_id=60169,type=select,bucket=weight:0,actions=output:1,output:2
201
202 To apply the LAG functionality on the switches, the flows should be
203 configured with action set to GroupId instead of output port. A sample
204 add-flow configuration with output action set to GroupId:
205
206 ::
207
208     sudo ovs-ofctl -O Openflow13 add-flow s1 dl_type=0x0806,dl_src=SRC_MAC,dl_dst=DST_MAC,actions=group:60169
209