Migrate NatApp user docs to rst
[docs.git] / manuals / user-guide / src / main / asciidoc / openflowplugin / odl-ofp-end-to-end-groups.adoc
1 [[note]]
2 ===== NOTE
3
4 Groups are NOT SUPPORTED in current (2.0.0) version of
5 http://www.openvswitch.org/download[openvswitch]. See
6
7 * http://openvswitch.org/releases/NEWS-2.0.0
8 * http://comments.gmane.org/gmane.linux.network.openvswitch.general/3251
9
10 For testing group feature please use for example <<odl-ofp-end-to-end-inventory_introduction-introduction,
11 CPQD>> virtual switch.
12
13 ===== Instructions
14 ====== Learn End to End for Inventory
15
16 <<odl-ofp-end-to-end-inventory_introduction-introduction,End to End Inventory>>
17
18 ====== Check inventory
19
20 Run CPqD with support for OF 1.3 as described in <<odl-ofp-end-to-end-inventory_introduction-introduction,End to End Inventory>>
21
22 Make sure you see the openflow:1 node come up as described in <<odl-ofp-end-to-end-inventory_introduction-introduction,End to End Inventory>>
23
24 ====== Group Strategy
25
26 Current way to flush a group to switch looks like this: 
27
28 . create MD-SAL modeled group and commit it into dataStore using two phase commit
29 . FRM gets notified and invokes corresponding rpc (addGroup) on particular service provider (if suitable provider for given node registered)
30 . the provider (plugin in this case) transforms MD-SAL modeled group into OF-API modeled group
31 . OF-API modeled group is then flushed into OFLibrary
32 . OFLibrary encodes group into particular version of wire protocol and sends it to particular switch
33 . check on CPqD if group is installed
34
35 ====== Push your Group
36
37 * With PostMan:
38 ** Set
39 *** Content-Type: application/xml
40 *** Accept: application/xml
41 ** Use URL: "http://<ip-address>:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/1"
42 ** PUT
43 ** Use Body:
44
45 [source,xml]
46 -----
47 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
48 <group xmlns="urn:opendaylight:flow:inventory">
49     <group-type>group-all</group-type>
50     <buckets>
51         <bucket>
52             <action>
53                 <pop-vlan-action/>
54                 <order>0</order>
55             </action>
56             <bucket-id>12</bucket-id>
57             <watch_group>14</watch_group>
58             <watch_port>1234</watch_port>
59         </bucket>
60         <bucket>
61             <action>
62                 <set-field>
63                     <ipv4-source>100.1.1.1</ipv4-source>
64                 </set-field>
65                 <order>0</order>
66             </action>
67             <action>
68                 <set-field>
69                     <ipv4-destination>200.71.9.5210</ipv4-destination>
70                 </set-field>
71                 <order>1</order>
72             </action>
73             <bucket-id>13</bucket-id>
74             <watch_group>14</watch_group>
75             <watch_port>1234</watch_port>
76         </bucket>
77     </buckets>
78     <barrier>false</barrier>
79     <group-name>Foo</group-name>
80     <group-id>1</group-id>
81 </group>
82 -----
83
84 NOTE: If you want to try a different group id, make sure the URL and the body stay in sync. For example, if you wanted to try: group-id 20 you'd change the URL to "http://<ip-address>:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/20" but you would also need to update the <group-id>20</group-id> in the body to match.
85
86 NOTE: <ip-address> :Provide the IP Address of the machine on which the controller is running.
87
88
89 ====== Check for your group on the switch
90
91 * See your group on your cpqd switch:
92
93 ----
94 COMMAND: sudo dpctl tcp:127.0.0.1:6000 stats-group
95
96 SENDING:
97 stat_req{type="grp", flags="0x0", group="all"}
98
99
100 RECEIVED:
101 stat_repl{type="grp", flags="0x0", stats=[
102 {group="1", ref_cnt="0", pkt_cnt="0", byte_cnt="0", cntrs=[{pkt_cnt="0", byte_cnt="0"}, {pkt_cnt="0", byte_cnt="0"}]}]}
103 ----
104
105 ====== Check for your group in the controller config via RESTCONF
106
107 * See your configured group in POSTMAN with
108 ** URL http://<ip-address>:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/1
109 ** GET
110 ** You should no longer need to set Accept
111 ** Note: <ip-address> :Provide the IP Address of the machine on which the controller is running.
112
113 ====== Look for your group stats in the controller operational data via RESTCONF
114
115 * See your operational group stats in POSTMAN with
116 ** URL http://<ip-address>:8080/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/group/1
117 ** GET
118 ** Note: <ip-address> :Provide the IP Address of the machine on which the controller is running.
119
120 ===== Discovering and testing Group Types
121
122 Currently, the openflowplugin has a test-provider that allows you to push various groups through the system from the OSGI command line. Once those groups have been pushed through, you can see them as examples and then use them to see in the config what a particular group example looks like.
123
124 ===== Using addGroup
125
126 From the
127
128 ----
129 cd openflowplugin/distribution/base/target/distributions-openflowplugin-base-0.0.1-SNAPSHOT-osgipackage/opendaylight
130 ./run.sh
131 ----
132
133 Point your CPqD at the controller as described above.
134
135 once you can see your node (probably openflow:1 if you've been following along) in the inventory, at the OSGI command line try running:
136
137 ----
138 addGroup openflow:1
139 ----
140
141 This will install a group in the switch. You can check whether the group is installed or not.
142
143 Once you've done that, use
144
145 * GET
146 * Accept: application/xml
147 * URL: "http://<ip-address>:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/1"
148 ** Note: <ip-address> :Provide the IP Address of the machine on which the controller is running.
149
150 NOTE: Before attempting to PUT a group you have created via addGroup, please change its URL and body to, for example, use group 1 instead of group 2 or another Group Id, so that they don't collide.
151
152 NOTE: There are several test command providers and the one handling groups is OpenflowpluginGroupTestCommandProvider. Methods, which can be use as commands in OSGI-console have prefix '_'.
153
154
155 ===== Example Group
156
157 Examples for XML for various Group Types can be found in the test-scripts bundle of the plugin code with names g1.xml, g2.xml and g3.xml.