Minor fixes and adding unit testing for validators
[packetcable.git] / docs / PacketCableDev.wiki.txt
1 << [[PacketCablePCMM:Main | Main]] 
2
3 [[Project_Proposals:PacketCablePCMM| Project Proposal]] >>
4
5 [[Project_Proposals:PacketCablePCMM|Release_Plan_Helium]] >>
6
7
8 =Developer and Testing (*Preliminary*)=
9 == Specification ==
10
11 [http://www.cablelabs.com/wp-content/uploads/specdocs/PKT-SP-MM-I05-091029.pdf PacketCable™ Specification Multimedia Specification PKT-SP-MM-I05-091029]
12 == Current Bug List ==
13 [https://bugs.opendaylight.org/buglist.cgi?bug_status=__open__&content=packetcable List bugs]
14
15 == System Overview ==
16 These components introduce a DOCSIS QoS Service Flow management using the PCMM protocol.  The driver component is responsible for the PCMM/COPS/PDP functionality required to service requests from PacketCable Provider and FlowManager.  Requests are transposed into PCMM Gate Control messages and transmitted via COPS to the CMTS. This plugin adheres to the PCMM/COPS/PDP functionality defined in the CableLabs specification.  PacketCable solution is an MDSAL compliant component.
17
18 [[File:Screenshot6.png]]
19
20 == Packetcable Components ==
21 packetcable is comprised of three OpendayLight bundles
22
23 {| class="wikitable"
24 |-
25 ! Bundle !! Description
26 |-
27 | packetcable-model || Contains the YANG information model for flows and nodes
28 |-
29 | packetcable-provider || Provider hosts the model processing, RESTCONF, API implmentation, and brokers requests to driver
30 |-
31 | packetcable-driver || The codec for transforming the model into the appropriate PCMM Gate message for flows and CMTS connections.
32 |}
33
34 [[File:Screenshot7.png]]
35
36 See [https://git.opendaylight.org/gerrit/gitweb?p=packetcable.git;a=tree;f=packetcable-model/src/main/yang YANG Model]
37
38 == Download and Install ==
39
40 Current instructions pertain to RC0
41
42 === Download===
43 [http://nexus.opendaylight.org/content/groups/staging/org/opendaylight/integration/distribution-karaf/0.2.0-Helium-RC0/distribution-karaf-0.2.0-Helium-RC0.zip Download RC0]
44
45 === Unzip ===
46 <pre>
47 unzip distribution-karaf-0.2.0-Helium-RC0.zip
48 </pre>
49
50 === Clean out the local .m2 ===
51
52 Karaf can mistakenly pick up artifacts from your local .m2, so
53 <pre>
54 rm -rf ~/.m2/repository/org/opendaylight
55 </pre>
56
57 === Run Karaf ===
58 <pre>
59 cd distribution-karaf-0.2.0-Helium-RC0/bin/
60 ./karaf
61 </pre>
62
63 == Prepare to Test == 
64
65 === What features should we install? ===
66
67 <pre>
68 opendaylight-user@root>feature:install odl-l2switch-switch odl-restconf odl-mdsal-broker odl-restconf odl-adsal-all odl-openflowplugin-flow-services odl-openflowjava-protocol odl-ovsdb-all  odl-openflow-nxm-extensions odl-adsal-compatibility  odl-dlux-core odl-packetcable-all odl-mdsal-apidocs odl-mdsal-xsql
69 </pre>
70
71 === How is ODL auto starting a series of bundles using Karaf? ===
72
73 Edit etc/org.apache.karaf.features.cfg ‘featuresBoot' 
74 <pre>
75 #
76 # Comma separated list of features to install at startup
77 #
78 featuresBoot=config,standard,region,package,kar,ssh,management,odl-l2switch-switch,odl-restconf,odl-mdsal-broker,odl-restconf,odl-adsal-all,odl-openflowplugin-flow-services,odl-openflowjava-protocol,odl-ovsdb-all,odl-openflow-nxm-extensions,odl-adsal-compatibility,,odl-dlux-core,odl-packetcable-all,odl-mdsal-apidocs,odl-mdsal-xsql
79
80 </pre>
81
82 === How can I create a system service to start Karaf? ===
83
84 Install http://karaf.apache.org/manual/latest/users-guide/wrapper.html
85 <pre>
86 opendaylight-user@root>feature:install service-wrapper
87 opendaylight-user@root>wrapper:install --help
88 DESCRIPTION
89         wrapper:install
90
91 Install the container as a system service in the OS.
92
93 SYNTAX
94         wrapper:install [options]
95
96 OPTIONS
97         -d, --display
98                 The display name of the service.
99                 (defaults to karaf)
100         --help
101                 Display this help message
102         -s, --start-type
103                 Mode in which the service is installed. AUTO_START or DEMAND_START (Default: AUTO_START)
104                 (defaults to AUTO_START)
105         -n, --name
106                 The service name that will be used when installing the service. (Default: karaf)
107                 (defaults to karaf)
108         -D, --description
109                 The description of the service.
110                 (defaults to )
111
112 opendaylight-user@root> wrapper:install
113 Creating file: /home/user/odl/distribution-karaf-0.2.0-Helium-RC0/bin/karaf-wrapper
114 Creating file: /home/user/odl/distribution-karaf-0.2.0-Helium-RC0/bin/karaf-service
115 Creating file: /home/user/odl/distribution-karaf-0.2.0-Helium-RC0/etc/karaf-wrapper.conf
116 Creating file: /home/user/odl/distribution-karaf-0.2.0-Helium-RC0/lib/libwrapper.so
117 Creating file: /home/user/odl/distribution-karaf-0.2.0-Helium-RC0/lib/karaf-wrapper.jar
118 Creating file: /home/user/odl/distribution-karaf-0.2.0-Helium-RC0/lib/karaf-wrapper-main.jar
119
120 Setup complete.  You may wish to tweak the JVM properties in the wrapper configuration file:
121 /home/user/odl/distribution-karaf-0.2.0-Helium-RC0/etc/karaf-wrapper.conf
122 before installing and starting the service.
123
124
125 Ubuntu/Debian Linux system detected:
126   To install the service:
127     $ ln -s /home/user/odl/distribution-karaf-0.2.0-Helium-RC0/bin/karaf-service /etc/init.d/
128
129   To start the service when the machine is rebooted:
130     $ update-rc.d karaf-service defaults
131
132   To disable starting the service when the machine is rebooted:
133     $ update-rc.d -f karaf-service remove
134
135   To start the service:
136     $ /etc/init.d/karaf-service start
137
138   To stop the service:
139     $ /etc/init.d/karaf-service stop
140
141   To uninstall the service :
142     $ rm /etc/init.d/karaf-service
143
144 </pre>
145
146 TODO:  Stops and dies
147
148 == Accessing User Interface Assets  ==
149
150
151 === Explore UI ===
152 http://localhost:8181/dlux/index.html
153
154 Sign in
155
156 [[File:Screenshot4.png||Dlux Login]]
157
158 Manage Flows
159
160 [[File:Screenshot3.png|500x600px||Dlux Flows]]
161
162 Manage Nodes
163
164 [[File:Screenshot2.png|500x600px||Dlux Nodes]]
165
166 === Explore and exercise the PacketCable REST API ===
167 http://localhost:8181/apidoc/explorer/index.html
168
169 [[ #RESTCONF_API_Explorer | See Explorer ]]
170
171 == How do I get external access to UI assets? ==
172
173 TODO:  Short answer is you don't.
174
175 Using Ubuntu 14.04LTS, install haproxy
176
177 <pre>
178 sudo apt-get install haproxy
179 </pre>
180
181 Ensure haproxy is enabled.
182
183 <pre>
184 cat /etc/default/haproxy 
185 # Set ENABLED to 1 if you want the init script to start haproxy.
186 ENABLED=1
187 # Add extra flags here.
188 #EXTRAOPTS="-de -m 16"
189 </pre>
190
191 Add configuration to /etc/haproxy/haproxy.cfg to proxy from port 8191 to localhost:8181 
192
193 <pre>
194 frontend public
195   bind *:8191
196   default_backend www
197
198 backend www
199   timeout server 30s
200   server www1 127.0.0.1:8181
201 </pre>
202
203 Debug mode
204 <pre>
205  sudo /etc/init.d/haproxy stop
206  sudo /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -VVVV -db
207 </pre>
208
209 Let'er rip
210 <pre>
211  sudo /etc/init.d/haproxy restart
212  sudo /etc/init.d/haproxy status
213 </pre>
214
215 == Tools for Testing ==
216
217 === RESTCONF API Explorer ===
218
219 http://localhost:8181/apidoc/explorer/index.html
220
221 Add a CMTS to Opendaylight Inventory
222
223 [[File:Screenshot1.png|Add CMTS using RESTCONF Explorer]]
224
225
226 === Postman ===
227
228 [https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en Configure the Chrome browser]
229
230 [https://git.opendaylight.org/gerrit/gitweb?p=packetcable.git;a=tree;f=packetcable-client  Download and import sample packetcable collection]
231
232
233 [[File:Screenshot5.png|Postman]]
234
235 === Custom Testsuite ===
236
237 Most of the [https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin::Python_test_scripts Openflow tests for RESTCONF] can be adapted for PCMM and service flow testing.  [https://git.opendaylight.org/gerrit/gitweb?p=packetcable.git;a=tree;f=packetcable-client Browse this folder] for WIP of tests and examples used for minimum acceptance testing.
238
239 ==== restconfapi.py ====
240
241 Scripted series of packetcable actions testing minimum compliance.
242
243 For example,  
244 # Add CMTS, 
245 # Add IPv4 Flow 1, 
246 # Add IPv6 Flow 2, 
247 # Delete Flow 2, 
248 # Delete Flow 1, 
249 # Delete CMTS 1
250
251 Other flows can be formulated and added to create a regression test of what kind of flows are interesting for use cases.  Multicast?
252
253 ==== flow_config_perf_pcmm.py ====
254
255 For load testing there is this nice tool that could be repurpose to load test a CMTS.  TODO: Adapt this script for load testing PCMM on a CMTS.
256
257 === Yang-IDE ===
258
259 [https://github.com/xored/yang-ide/wiki/Setup-and-build Setup and Build Yang-IDE for Eclipse]
260
261
262 == Using Wireshark to Trace PCMM ==
263
264 # To start wireshark with privileges issue the following command: <pre>sudo wireshark &</pre>
265 # Select the interface to monitor.
266 # Use the Filter to only display COPS messages by applying “cops” in the filter field. 
267
268 [[File:Screenshot8.png]]
269
270 == Debugging and Verifying DQoS Gate (Flows) on the CMTS ==
271
272 [http://books.google.com/books?id=zNnCLUa8CHQC&pg=PA701&lpg=PA701&dq=show+packetcable+gate  This book] serves as a good reference.  Below are some of the most useful CMTS commands to verify flows have been enabled on the CMTS.
273
274 === Cisco ===
275
276 [http://www.cisco.com/c/en/us/td/docs/cable/cmts/cmd_ref/b_cmts_cable_cmd_ref.pdf Cisco CMTS Cable Command Reference]
277
278 === Find the Cable Modem ===
279
280 <pre>
281 10k2-DSG#show cable modem
282                                                                                   D
283 MAC Address    IP Address      I/F           MAC           Prim RxPwr  Timing Num I
284                                              State         Sid  (dBmv) Offset CPE P
285 0010.188a.faf6 0.0.0.0         C8/0/0/U0     offline       1    0.00   1482   0   N
286 74ae.7600.01f3 10.32.115.150   C8/0/10/U0    online        1    -0.50  1431   0   Y
287 0010.188a.fad8 10.32.115.142   C8/0/10/UB    w-online      2    -0.50  1507   1   Y
288 000e.0900.00dd 10.32.115.143   C8/0/10/UB    w-online      3    1.00   1677   0   Y
289 e86d.5271.304f 10.32.115.168   C8/0/10/UB    w-online      6    -0.50  1419   1   Y
290 </pre>
291
292 === Show PCMM Plugin Connection ===
293
294 <pre>
295 10k2-DSG#show packetcabl ?
296   cms     Gate Controllers connected to this PacketCable client
297   event   Event message server information
298   gate    PacketCable gate information
299   global  PacketCable global information
300
301 10k2-DSG#show packetcable cms
302 GC-Addr        GC-Port  Client-Addr    COPS-handle  Version PSID Key PDD-Cfg
303
304
305 10k2-DSG#show packetcable cms
306 GC-Addr        GC-Port  Client-Addr    COPS-handle  Version PSID Key PDD-Cfg
307 10.32.0.240    54238    10.32.15.3     0x4B9C8150/1    4.0   0    0   0   
308 </pre>
309
310 === Show COPS Messages ===
311
312  <pre>debug cops details</pre>
313
314 === Use CM Mac Address to List Service Flows ===
315
316 <pre>
317 10k2-DSG#show cable modem    
318                                                                                   D
319 MAC Address    IP Address      I/F           MAC           Prim RxPwr  Timing Num I
320                                              State         Sid  (dBmv) Offset CPE P
321 0010.188a.faf6 ---             C8/0/0/UB     w-online      1    0.50   1480   1   N
322 74ae.7600.01f3 10.32.115.150   C8/0/10/U0    online        1    -0.50  1431   0   Y
323 0010.188a.fad8 10.32.115.142   C8/0/10/UB    w-online      2    -0.50  1507   1   Y
324 000e.0900.00dd 10.32.115.143   C8/0/10/UB    w-online      3    0.00   1677   0   Y
325 e86d.5271.304f 10.32.115.168   C8/0/10/UB    w-online      6    -0.50  1419   1   Y
326
327
328 10k2-DSG#show cable modem 000e.0900.00dd service-flow
329                                                  
330
331 SUMMARY:
332 MAC Address    IP Address      Host          MAC           Prim  Num Primary    DS
333                                Interface     State         Sid   CPE Downstream RfId
334 000e.0900.00dd 10.32.115.143   C8/0/10/UB    w-online      3     0   Mo8/0/2:1  2353
335
336
337 Sfid  Dir Curr  Sid   Sched  Prio MaxSusRate  MaxBrst     MinRsvRate  Throughput 
338           State       Type
339 23    US  act   3     BE     0    0           3044        0           39         
340 30    US  act   16    BE     0    500000      3044        0           0          
341 24    DS  act   N/A   N/A    0    0           3044        0           17         
342
343
344
345 UPSTREAM SERVICE FLOW DETAIL:
346
347 SFID  SID   Requests   Polls      Grants     Delayed    Dropped    Packets   
348                                              Grants     Grants
349 23    3     784        0          784        0          0          784       
350 30    16    0          0          0          0          0          0         
351
352
353 DOWNSTREAM SERVICE FLOW DETAIL:
354
355 SFID  RP_SFID QID    Flg Policer               Scheduler             FrwdIF    
356                          Xmits      Drops      Xmits      Drops
357 24    33019   131550     0          0          777        0          Wi8/0/2:2
358
359 Flags Legend:
360 $: Low Latency Queue (aggregated)
361 ~: CIR Queue
362 </pre>
363
364 === Deleting a PCMM Gate Message from the CMTS ===
365
366 <pre>10k2-DSG#test cable dsd  000e.0900.00dd 30</pre>
367
368 === Find service flows ===
369 All gate controllers currently connected to the PacketCable client are displayed
370 <pre>
371 show cable modem 00:11:22:33:44:55 service flow   ????
372 show cable modem
373 </pre>
374
375
376 === Debug and display PCMM Gate messages ===
377 <pre>
378 debug packetcable gate control
379 debug packetcable gate events
380 show packetcable gate summary
381 show packetcable global
382 show packetcable cms
383 </pre>
384
385 === Debug COPS messages ===
386 <pre>
387 debug cops detail
388 debug packetcable cops
389 debug cable dynamic_qos trace
390 </pre>
391
392 === Arris ===
393
394