ODL-SDNi carbon release notes
[docs.git] / docs / user-guide / network-intent-composition-(nic)-user-guide.rst
1 Network Intent Composition (NIC) User Guide
2 ===========================================
3
4 Overview
5 --------
6
7 Network Intent Composition (NIC) is an interface that allows clients to
8 express a desired state in an implementation-neutral form that will be
9 enforced via modification of available resources under the control of
10 the OpenDaylight system.
11
12 This description is purposely abstract as an intent interface might
13 encompass network services, virtual devices, storage, etc.
14
15 The intent interface is meant to be a controller-agnostic interface so
16 that "intents" are portable across implementations, such as OpenDaylight
17 and ONOS. Thus an intent specification should not contain implementation
18 or technology specifics.
19
20 The intent specification will be implemented by decomposing the intent
21 and augmenting it with implementation specifics that are driven by local
22 implementation rules, policies, and/or settings.
23
24 Network Intent Composition (NIC) Architecture
25 ---------------------------------------------
26
27 The core of the NIC architecture is the intent model, which specifies
28 the details of the desired state. It is the responsibility of the NIC
29 implementation transforms this desired state to the resources under the
30 control of OpenDaylight. The component that transforms the intent to the
31 implementation is typically referred to as a renderer.
32
33 For the Boron release, multiple, simultaneous renderers will not be
34 supported. Instead either the VTN or GBP renderer feature can be
35 installed, but not both.
36
37 For the Boron release, the only actions supported are "ALLOW" and
38 "BLOCK". The "ALLOW" action indicates that traffic can flow between the
39 source and destination end points, while "BLOCK" prevents that flow;
40 although it is possible that an given implementation may augment the
41 available actions with additional actions.
42
43 Besides transforming a desired state to an actual state it is the
44 responsibility of a renderer to update the operational state tree for
45 the NIC data model in OpenDaylight to reflect the intent which the
46 renderer implemented.
47
48 Configuring Network Intent Composition (NIC)
49 --------------------------------------------
50
51 For the Boron release there is no default implementation of a renderer,
52 thus without an additional module installed the NIC will not function.
53
54 Administering or Managing Network Intent Composition (NIC)
55 ----------------------------------------------------------
56
57 There is no additional administration of management capabilities related
58 to the Network Intent Composition features.
59
60 Interactions
61 ------------
62
63 A user can interact with the Network Intent Composition (NIC) either
64 through the RESTful interface using standard RESTCONF operations and
65 syntax or via the Karaf console CLI.
66
67 REST
68 ~~~~
69
70 Configuration
71 ^^^^^^^^^^^^^
72
73 The Network Intent Composition (NIC) feature supports the following REST
74 operations against the configuration data store.
75
76 -  POST - creates a new instance of an intent in the configuration
77    store, which will trigger the realization of that intent. An ID
78    *must* be specified as part of this request as an attribute of the
79    intent.
80
81 -  GET - fetches a list of all configured intents or a specific
82    configured intent.
83
84 -  DELETE - removes a configured intent from the configuration store,
85    which triggers the removal of the intent from the network.
86
87 Operational
88 ^^^^^^^^^^^
89
90 The Network Intent Composition (NIC) feature supports the following REST
91 operations against the operational data store.
92
93 -  GET - fetches a list of all operational intents or a specific
94    operational intent.
95
96 Karaf Console CLI
97 ~~~~~~~~~~~~~~~~~
98
99 This feature provides karaf console CLI command to manipulate the intent
100 data model. The CLI essentailly invokes the equivalent data operations.
101
102 intent:add
103 ^^^^^^^^^^
104
105 Creates a new intent in the configuration data tree
106
107 ::
108
109     DESCRIPTION
110             intent:add
111
112         Adds an intent to the controller.
113
114     Examples: --actions [ALLOW] --from <subject> --to <subject>
115               --actions [BLOCK] --from <subject>
116
117     SYNTAX
118             intent:add [options]
119
120     OPTIONS
121             -a, --actions
122                     Action to be performed.
123                     -a / --actions BLOCK/ALLOW
124                     (defaults to [BLOCK])
125             --help
126                     Display this help message
127             -t, --to
128                     Second Subject.
129                     -t / --to <subject>
130                     (defaults to any)
131             -f, --from
132                     First subject.
133                     -f / --from <subject>
134                     (defaults to any)
135
136 intent:delete
137 ^^^^^^^^^^^^^
138
139 Removes an existing intent from the system
140
141 ::
142
143     DESCRIPTION
144             intent:remove
145
146         Removes an intent from the controller.
147
148     SYNTAX
149             intent:remove id
150
151     ARGUMENTS
152             id  Intent Id
153
154 intent:list
155 ^^^^^^^^^^^
156
157 Lists all the intents in the system
158
159 ::
160
161     DESCRIPTION
162             intent:list
163
164         Lists all intents in the controller.
165
166     SYNTAX
167             intent:list [options]
168
169     OPTIONS
170             -c, --config
171                     List Configuration Data (optional).
172                     -c / --config <ENTER>
173             --help
174                     Display this help message
175
176 intent:show
177 ^^^^^^^^^^^
178
179 Displayes the details of a single intent
180
181 ::
182
183     DESCRIPTION
184             intent:show
185
186         Shows detailed information about an intent.
187
188     SYNTAX
189             intent:show id
190
191     ARGUMENTS
192             id  Intent Id
193
194 intent:map
195 ^^^^^^^^^^
196
197 List/Add/Delete current state from/to the mapping service.
198
199 ::
200
201     DESCRIPTION
202             intent:map
203
204             List/Add/Delete current state from/to the mapping service.
205
206     SYNTAX
207             intent:map [options]
208
209              Examples: --list, -l [ENTER], to retrieve all keys.
210                        --add-key <key> [ENTER], to add a new key with empty contents.
211                        --del-key <key> [ENTER], to remove a key with it's values."
212                        --add-key <key> --value [<value 1>, <value 2>, ...] [ENTER],
213                          to add a new key with some values (json format).
214     OPTIONS
215            --help
216                Display this help message
217            -l, --list
218                List values associated with a particular key.
219            -l / --filter <regular expression> [ENTER]
220            --add-key
221                Adds a new key to the mapping service.
222            --add-key <key name> [ENTER]
223            --value
224                Specifies which value should be added/delete from the mapping service.
225            --value "key=>value"... --value "key=>value" [ENTER]
226                (defaults to [])
227            --del-key
228                Deletes a key from the mapping service.
229            --del-key <key name> [ENTER]
230
231 NIC Usage Examples
232 ------------------
233
234 Default Requirements
235 ~~~~~~~~~~~~~~~~~~~~
236
237 Start mininet, and create three switches (s1, s2, and s3) and four hosts
238 (h1, h2, h3, and h4) in it.
239
240 Replace <Controller IP> based on your environment.
241
242 ::
243
244     $  sudo mn --mac --topo single,2 --controller=remote,ip=<Controller IP>
245
246 ::
247
248      mininet> net
249      h1 h1-eth0:s2-eth1
250      h2 h2-eth0:s2-eth2
251      h3 h3-eth0:s3-eth1
252      h4 h4-eth0:s3-eth2
253      s1 lo:  s1-eth1:s2-eth3 s1-eth2:s3-eth3
254      s2 lo:  s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
255      s3 lo:  s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
256
257 Downloading and deploy Karaf distribution
258 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259
260 -  Get the Boron distribution.
261
262 -  Unzip the downloaded zip distribution.
263
264 -  To run the Karaf.
265
266 ::
267
268     ./bin/karaf
269
270 -  Once the console is up, type as below to install feature.
271
272 ::
273
274     feature:install odl-nic-core-mdsal odl-nic-console odl-nic-listeners
275
276 Simple Mininet topology
277 -----------------------
278
279 .. code:: python
280
281     !/usr/bin/python
282
283     from mininet.topo import Topo
284
285     class SimpleTopology( Topo ):
286         "Simple topology example."
287
288         def __init__( self ):
289             "Create custom topo."
290
291
292         Topo.__init__( self )
293
294
295             Switch1 = self.addSwitch( 's1' )
296             Switch2 = self.addSwitch( 's2' )
297             Switch3 = self.addSwitch( 's3' )
298             Switch4 = self.addSwitch( 's4' )
299             Host11 = self.addHost( 'h1' )
300             Host12 = self.addHost( 'h2' )
301             Host21 = self.addHost( 'h3' )
302             Host22 = self.addHost( 'h4' )
303             Host23 = self.addHost( 'h5' )
304             Service1 = self.addHost( 'srvc1' )
305
306
307             self.addLink( Host11, Switch1 )
308             self.addLink( Host12, Switch1 )
309             self.addLink( Host21, Switch2 )
310             self.addLink( Host22, Switch2 )
311             self.addLink( Host23, Switch2 )
312             self.addLink( Switch1, Switch2 )
313             self.addLink( Switch2, Switch4 )
314             self.addLink( Switch4, Switch3 )
315             self.addLink( Switch3, Switch1 )
316             self.addLink( Switch3, Service1 )
317             self.addLink( Switch4, Service1 )
318
319
320     topos = { 'simpletopology': ( lambda: SimpleTopology() ) }
321
322 -  Initialize topology
323
324 -  Add hosts and switches
325
326 -  Host used to represent the service
327
328 -  Add links
329
330     Source: https://gist.github.com/vinothgithub15/315d0a427d5afc39f2d7
331
332 How to configure VTN Renderer
333 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
334
335 The section demonstrates allow or block packets of the traffic within a
336 VTN Renderer, according to the specified flow conditions.
337
338 The table below lists the actions to be applied when a packet matches
339 the condition:
340
341 +----------------+-----------------------------------------------------------+
342 | Action         | Function                                                  |
343 +================+===========================================================+
344 | Allow          | Permits the packet to be forwarded normally.              |
345 +----------------+-----------------------------------------------------------+
346 | Block          | Discards the packet preventing it from being forwarded.   |
347 +----------------+-----------------------------------------------------------+
348
349 Requirement
350 ^^^^^^^^^^^
351
352 -  Before execute the follow steps, please, use default requirements.
353    See section `Default Requirements <#_default_requirements>`__.
354
355 Configuration
356 ^^^^^^^^^^^^^
357
358 Please execute the following curl commands to test network intent using
359 mininet:
360
361 Create Intent
362 '''''''''''''
363
364 To provision the network for the two hosts(h1 and h2) and demonstrates
365 the action allow.
366
367 ::
368
369     curl -v --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X PUT http://localhost:8181/restconf/config/intent:intents/intent/b9a13232-525e-4d8c-be21-cd65e3436034 -d '{ "intent:intent" : { "intent:id": "b9a13232-525e-4d8c-be21-cd65e3436034", "intent:actions" : [ { "order" : 2, "allow" : {} } ], "intent:subjects" : [ { "order":1 , "end-point-group" : {"name":"10.0.0.1"} }, { "order":2 , "end-point-group" : {"name":"10.0.0.2"}} ] } }'
370
371 To provision the network for the two hosts(h2 and h3) and demonstrates
372 the action allow.
373
374 ::
375
376     curl -v --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X PUT http://localhost:8181/restconf/config/intent:intents/intent/b9a13232-525e-4d8c-be21-cd65e3436035 -d '{ "intent:intent" : { "intent:id": "b9a13232-525e-4d8c-be21-cd65e3436035", "intent:actions" : [ { "order" : 2, "allow" : {} } ], "intent:subjects" : [ { "order":1 , "end-point-group" : {"name":"10.0.0.2"} }, { "order":2 , "end-point-group" : {"name":"10.0.0.3"}} ] } }'
377
378 Verification
379 ''''''''''''
380
381 As we have applied action type allow now ping should happen between
382 hosts (h1 and h2) and (h2 and h3).
383
384 ::
385
386      mininet> pingall
387      Ping: testing ping reachability
388      h1 -> h2 X X
389      h2 -> h1 h3 X
390      h3 -> X h2 X
391      h4 -> X X X
392
393 Update the intent
394 '''''''''''''''''
395
396 To provision block action that indicates traffic is not allowed between
397 h1 and h2.
398
399 ::
400
401     curl -v --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X PUT http://localhost:8181/restconf/config/intent:intents/intent/b9a13232-525e-4d8c-be21-cd65e3436034 -d '{ "intent:intent" : { "intent:id": "b9a13232-525e-4d8c-be21-cd65e3436034", "intent:actions" : [ { "order" : 2, "block" : {} } ], "intent:subjects" : [ { "order":1 , "end-point-group" : {"name":"10.0.0.1"} }, { "order":2 , "end-point-group" : {"name":"10.0.0.2"}} ] } }'
402
403 Verification
404 ''''''''''''
405
406 As we have applied action type block now ping should not happen between
407 hosts (h1 and h2).
408
409 ::
410
411      mininet> pingall
412      Ping: testing ping reachability
413      h1 -> X X X
414      h2 -> X h3 X
415      h3 -> X h2 X
416      h4 -> X X X
417
418 .. note::
419
420     Old actions and hosts are replaced by the new action and hosts.
421
422 Delete the intent
423 '''''''''''''''''
424
425 Respective intent and the traffics will be deleted.
426
427 ::
428
429     curl -v --user "admin":"admin" -H "Accept: application/json" -H     "Content-type: application/json" -X DELETE http://localhost:8181/restconf/config/intent:intents/intent/b9a13232-525e-4d8c-be21-cd65e3436035
430
431 Verification
432 ''''''''''''
433
434 Deletion of intent and flow.
435
436 ::
437
438      mininet> pingall
439      Ping: testing ping reachability
440      h1 -> X X X
441      h2 -> X X X
442      h3 -> X X X
443      h4 -> X X X
444
445 .. note::
446
447     Ping between two hosts can also be done using MAC Address
448
449 To provision the network for the two hosts(h1 MAC address and h2 MAC
450 address).
451
452 ::
453
454     curl -v --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X PUT http://localhost:8181/restconf/config/intent:intents/intent/b9a13232-525e-4d8c-be21-cd65e3436035 -d '{ "intent:intent" : { "intent:id": "b9a13232-525e-4d8c-be21-cd65e3436035", "intent:actions" : [ { "order" : 2, "allow" : {} } ], "intent:subjects" : [ { "order":1 , "end-point-group" : {"name":"6e:4f:f7:27:15:c9"} }, { "order":2 , "end-point-group" : {"name":"aa:7d:1f:4a:70:81"}} ] } }'
455
456 How to configure Redirect Action
457 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
458
459 The section explains the redirect action supported in NIC. The redirect
460 functionality supports forwarding (to redirect) the traffic to a service
461 configured in SFC before forwarding it to the destination.
462
463 .. figure:: ./images/nic/Service_Chaining.png
464    :alt: REDIRECT SERVICE
465
466    REDIRECT SERVICE
467
468 Following steps explain Redirect action function:
469
470 -  Configure the service in SFC using the SFC APIs.
471
472 -  Configure the intent with redirect action and the service information
473    where the traffic needs to be redirected.
474
475 -  The flows are computed as below
476
477    1. First flow entry between the source host connected node and the
478       ingress node of the configured service.
479
480    2. Second flow entry between the egress Node id the configured
481       service and the ID and destination host connected host.
482
483    3. Third flow entry between the destination host node and the source
484       host node.
485
486 Requirement
487 ^^^^^^^^^^^
488
489 -  Save the mininet `Simple Mininet
490    topology <#_simple_mininet_topology>`__ script as redirect\_test.py
491
492 -  Start mininet, and create switches in it.
493
494 Replace <Controller IP> based on your environment.
495
496 ::
497
498     sudo mn --controller=remote,ip=<Controller IP>--custom redirect_test.py --topo mytopo2
499
500 ::
501
502      mininet> net
503      h1 h1-eth0:s1-eth1
504      h2 h2-eth0:s1-eth2
505      h3 h3-eth0:s2-eth1
506      h4 h4-eth0:s2-eth2
507      h5 h5-eth0:s2-eth3
508      srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
509      s1 lo:  s1-eth1:h1-eth0 s1-eth2:h2-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
510      s2 lo:  s2-eth1:h3-eth0 s2-eth2:h4-eth0 s2-eth3:h5-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
511      s3 lo:  s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0
512      s4 lo:  s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1
513      c0
514
515 Starting the Karaf
516 ^^^^^^^^^^^^^^^^^^
517
518 -  Before execute the following steps, please, use the default
519    requirements. See section `Downloading and deploy Karaf
520    distribution <#_default_requirements>`__.
521
522 Configuration
523 ^^^^^^^^^^^^^
524
525 Mininet
526 '''''''
527
528 .. figure:: ./images/nic/Redirect_flow.png
529    :alt: CONFIGURATION THE NETWORK IN MININET
530
531    CONFIGURATION THE NETWORK IN MININET
532
533 -  Configure srvc1 as service node in the mininet environment.
534
535 Please execute the following commands in the mininet console (where
536 mininet script is executed).
537
538 ::
539
540      srvc1 ip addr del 10.0.0.6/8 dev srvc1-eth0
541      srvc1 brctl addbr br0
542      srvc1 brctl addif br0 srvc1-eth0
543      srvc1 brctl addif br0 srvc1-eth1
544      srvc1 ifconfig br0 up
545      srvc1 tc qdisc add dev srvc1-eth1 root netem delay 200ms
546
547 Configure service in SFC
548 ''''''''''''''''''''''''
549
550 The service (srvc1) is configured using SFC REST API. As part of the
551 configuration the ingress and egress node connected the service is
552 configured.
553
554 ::
555
556     curl -i -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data '{
557       "service-functions": {
558         "service-function": [
559           {
560             "name": "srvc1",
561             "sf-data-plane-locator": [
562               {
563                 "name": "Egress",
564                 "service-function-forwarder": "openflow:4"
565               },
566               {
567                 "name": "Ingress",
568                 "service-function-forwarder": "openflow:3"
569               }
570             ],
571             "nsh-aware": false,
572             "type": "delay"
573           }
574         ]
575       }
576     }' -X PUT --user admin:admin http://localhost:8181/restconf/config/service-function:service-functions/
577
578 **SFF RESTCONF Request**
579
580 Configuring switch and port information for the service functions.
581
582 ::
583
584     curl -i -H "Content-Type: application/json" -H "Cache-Control: no-cache" --data '{
585       "service-function-forwarders": {
586         "service-function-forwarder": [
587           {
588             "name": "openflow:3",
589             "service-node": "OVSDB2",
590             "sff-data-plane-locator": [
591               {
592                 "name": "Ingress",
593                 "data-plane-locator":
594                 {
595                     "vlan-id": 100,
596                     "mac": "11:11:11:11:11:11",
597                     "transport": "service-locator:mac"
598                 },
599                 "service-function-forwarder-ofs:ofs-port":
600                 {
601                     "port-id" : "3"
602                 }
603               }
604             ],
605             "service-function-dictionary": [
606               {
607                 "name": "srvc1",
608                 "sff-sf-data-plane-locator":
609                 {
610                     "sf-dpl-name" : "openflow:3",
611                     "sff-dpl-name" : "Ingress"
612                 }
613               }
614             ]
615           },
616           {
617             "name": "openflow:4",
618             "service-node": "OVSDB3",
619             "sff-data-plane-locator": [
620               {
621                 "name": "Egress",
622                 "data-plane-locator":
623                 {
624                     "vlan-id": 200,
625                     "mac": "44:44:44:44:44:44",
626                     "transport": "service-locator:mac"
627                 },
628                 "service-function-forwarder-ofs:ofs-port":
629                 {
630                     "port-id" : "3"
631                 }
632               }
633             ],
634             "service-function-dictionary": [
635               {
636                 "name": "srvc1",
637                 "sff-sf-data-plane-locator":
638                 {
639                     "sf-dpl-name" : "openflow:4",
640                     "sff-dpl-name" : "Egress"
641                 }
642               }
643             ]
644           }
645         ]
646       }
647     }' -X PUT --user admin:admin http://localhost:8181/restconf/config/service-function-forwarder:service-function-forwarders/
648
649 CLI Command
650 '''''''''''
651
652 To provision the network for the two hosts (h1 and h5).
653
654 Demonstrates the redirect action with service name srvc1.
655
656 ::
657
658     intent:add -f <SOURCE_MAC> -t <DESTINATION_MAC> -a REDIRECT -s <SERVICE_NAME>
659
660 Example:
661
662 ::
663
664     intent:add -f 32:bc:ec:65:a7:d1 -t c2:80:1f:77:41:ed -a REDIRECT -s srvc1
665
666 Verification
667 ''''''''''''
668
669 -  As we have applied action type redirect now ping should happen
670    between hosts h1 and h5.
671
672 ::
673
674      mininet> h1 ping h5
675      PING 10.0.0.5 (10.0.0.5) 56(84) bytes of data.
676      64 bytes from 10.0.0.5: icmp_seq=2 ttl=64 time=201 ms
677      64 bytes from 10.0.0.5: icmp_seq=3 ttl=64 time=200 ms
678      64 bytes from 10.0.0.5: icmp_seq=4 ttl=64 time=200 ms
679
680 The redirect functionality can be verified by the time taken by the ping
681 operation (200ms). The service srvc1 configured using SFC introduces
682 200ms delay. As the traffic from h1 to h5 is redirected via the srvc1,
683 the time taken by the traffic from h1 to h5 will take about 200ms.
684
685 -  Flow entries added to nodes for the redirect action.
686
687 ::
688
689      mininet> dpctl dump-flows
690      *** s1 ------------------------------------------------------------------------
691      NXST_FLOW reply (xid=0x4):
692      cookie=0x0, duration=9.406s, table=0, n_packets=6, n_bytes=588, idle_age=3, priority=9000,in_port=1,dl_src=32:bc:ec:65:a7:d1, dl_dst=c2:80:1f:77:41:ed actions=output:4
693      cookie=0x0, duration=9.475s, table=0, n_packets=6, n_bytes=588, idle_age=3, priority=9000,in_port=3,dl_src=c2:80:1f:77:41:ed, dl_dst=32:bc:ec:65:a7:d1 actions=output:1
694      cookie=0x1, duration=362.315s, table=0, n_packets=144, n_bytes=12240, idle_age=4, priority=9500,dl_type=0x88cc actions=CONTROLLER:65535
695      cookie=0x1, duration=362.324s, table=0, n_packets=4, n_bytes=168, idle_age=3, priority=10000,arp actions=CONTROLLER:65535,NORMAL
696      *** s2 ------------------------------------------------------------------------
697      NXST_FLOW reply (xid=0x4):
698      cookie=0x0, duration=9.503s, table=0, n_packets=6, n_bytes=588, idle_age=3, priority=9000,in_port=3,dl_src=c2:80:1f:77:41:ed, dl_dst=32:bc:ec:65:a7:d1 actions=output:4
699      cookie=0x0, duration=9.437s, table=0, n_packets=6, n_bytes=588, idle_age=3, priority=9000,in_port=5,dl_src=32:bc:ec:65:a7:d1, dl_dst=c2:80:1f:77:41:ed actions=output:3
700      cookie=0x3, duration=362.317s, table=0, n_packets=144, n_bytes=12240, idle_age=4, priority=9500,dl_type=0x88cc actions=CONTROLLER:65535
701      cookie=0x3, duration=362.32s, table=0, n_packets=4, n_bytes=168, idle_age=3, priority=10000,arp actions=CONTROLLER:65535,NORMAL
702      *** s3 ------------------------------------------------------------------------
703      NXST_FLOW reply (xid=0x4):
704      cookie=0x0, duration=9.41s, table=0, n_packets=6, n_bytes=588, idle_age=3, priority=9000,in_port=2,dl_src=32:bc:ec:65:a7:d1, dl_dst=c2:80:1f:77:41:ed actions=output:3
705      *** s4 ------------------------------------------------------------------------
706      NXST_FLOW reply (xid=0x4):
707      cookie=0x0, duration=9.486s, table=0, n_packets=6, n_bytes=588, idle_age=3, priority=9000,in_port=3,dl_src=32:bc:ec:65:a7:d1, dl_dst=c2:80:1f:77:41:ed actions=output:1
708
709 How to configure QoS Attribute Mapping
710 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
711
712 This section explains how to provision QoS attribute mapping constraint
713 using NIC OF-Renderer.
714
715 The QoS attribute mapping currently supports DiffServ. It uses a 6-bit
716 differentiated services code point (DSCP) in the 8-bit differentiated
717 services field (DS field) in the IP header.
718
719 +----------------+-----------------------------------------------------------+
720 | Action         | Function                                                  |
721 +================+===========================================================+
722 | Allow          | Permits the packet to be forwarded normally, but allows   |
723 |                | for packet header fields, e.g., DSCP, to be modified.     |
724 +----------------+-----------------------------------------------------------+
725
726 The following steps explain QoS Attribute Mapping function:
727
728 -  Initially configure the QoS profile which contains profile name and
729    DSCP value.
730
731 -  When a packet is transferred from a source to destination, the flow
732    builder evaluates whether the transferred packet matches the
733    condition such as action, endpoints in the flow.
734
735 -  If the packet matches the endpoints, the flow builder applies the
736    flow matching action and DSCP value.
737
738 Requirement
739 ^^^^^^^^^^^
740
741 -  Before execute the following steps, please, use the default
742    requirements. See section `Default
743    Requirements <#_default_requirements>`__.
744
745 Configuration
746 ^^^^^^^^^^^^^
747
748 Please execute the following CLI commands to test network intent using
749 mininet:
750
751 -  To apply the QoS constraint, configure the QoS profile.
752
753 ::
754
755     intent:qosConfig -p <qos_profile_name> -d <valid_dscp_value>
756
757 Example:
758
759 ::
760
761     intent:qosConfig -p High_Quality -d 46
762
763 .. note::
764
765     Valid DSCP value ranges from 0-63.
766
767 -  To provision the network for the two hosts (h1 and h3), add intents
768    that allows traffic in both directions by execute the following CLI
769    command.
770
771 Demonstrates the ALLOW action with constraint QoS and QoS profile name.
772
773 ::
774
775     intent:add -a ALLOW -t <DESTINATION_MAC> -f <SOURCE_MAC> -q QOS -p <qos_profile_name>
776
777 Example:
778
779 ::
780
781     intent:add -a ALLOW -t 00:00:00:00:00:03 -f 00:00:00:00:00:01 -q QOS -p High_Quality
782     intent:add -a ALLOW -t 00:00:00:00:00:01 -f 00:00:00:00:00:03 -q QOS -p High_Quality
783
784 Verification
785 ''''''''''''
786
787 -  As we have applied action type ALLOW now ping should happen between
788    hosts h1 and h3.
789
790 ::
791
792      mininet> h1 ping h3
793      PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
794      64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
795      64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
796      64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
797
798 -  Verification of the flow entry and ensuring the mod\_nw\_tos is part
799    of actions.
800
801 ::
802
803      mininet> dpctl dump-flows
804      *** s1 ------------------------------------------------------------------------
805      NXST_FLOW reply (xid=0x4):
806      cookie=0x0, duration=21.873s, table=0, n_packets=3, n_bytes=294, idle_age=21, priority=9000,dl_src=00:00:00:00:00:03,dl_dst=00:00:00:00:00:01 actions=NORMAL,mod_nw_tos:184
807      cookie=0x0, duration=41.252s, table=0, n_packets=3, n_bytes=294, idle_age=41, priority=9000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:03 actions=NORMAL,mod_nw_tos:184
808
809 Requirement
810 ~~~~~~~~~~~
811
812 -  Before execute the follow steps, please, use default requirements.
813    See section `Default Requirements <#_default_requirements>`__.
814
815 How to configure Log Action
816 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
817
818 This section demonstrates log action in OF Renderer. This demonstration
819 aims at enabling communication between two hosts and logging the flow
820 statistics details of the particular traffic.
821
822 Configuration
823 ^^^^^^^^^^^^^
824
825 Please execute the following CLI commands to test network intent using
826 mininet:
827
828 -  To provision the network for the two hosts (h1 and h3), add intents
829    that allows traffic in both directions by execute the following CLI
830    command.
831
832 ::
833
834     intent:add –a ALLOW -t <DESTINATION_MAC> -f <SOURCE_MAC>
835
836 Example:
837
838 ::
839
840     intent:add -a ALLOW -t 00:00:00:00:00:03 -f 00:00:00:00:00:01
841     intent:add -a ALLOW -t 00:00:00:00:00:01 -f 00:00:00:00:00:03
842
843 -  To log the flow statistics details of the particular traffic.
844
845 ::
846
847     intent:add –a LOG -t <DESTINATION_MAC> -f <SOURCE_MAC>
848
849 Example:
850
851 ::
852
853     intent:add -a LOG -t 00:00:00:00:00:03 -f 00:00:00:00:00:01
854
855 Verification
856 ''''''''''''
857
858 -  As we have applied action type ALLOW now ping should happen between
859    hosts h1 and h3.
860
861 ::
862
863      mininet> h1 ping h3
864      PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
865      64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
866      64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
867      64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
868
869 -  To view the flow statistics log details such as, byte count, packet
870    count and duration, check the karaf.log.
871
872 ::
873
874     2015-12-15 22:56:20,256 | INFO | lt-dispatcher-23 | IntentFlowManager | 264 - org.opendaylight.nic.of-renderer - 1.1.0.SNAPSHOT | Creating block intent for endpoints: source00:00:00:00:00:01 destination 00:00:00:00:00:03
875     2015-12-15 22:56:20,252 | INFO | lt-dispatcher-29 | FlowStatisticsListener | 264 - org.opendaylight.nic.of-renderer - 1.1.0.SNAPSHOT | Flow Statistics gathering for Byte Count:Counter64 [_value=238]
876     2015-12-15 22:56:20,252 | INFO | lt-dispatcher-29 | FlowStatisticsListener | 264 - org.opendaylight.nic.of-renderer - 1.1.0.SNAPSHOT | Flow Statistics gathering for Packet Count:Counter64 [_value=3]
877     2015-12-15 22:56:20,252 | INFO | lt-dispatcher-29 | FlowStatisticsListener | 264 - org.opendaylight.nic.of-renderer - 1.1.0.SNAPSHOT | Flow Statistics gathering for Duration in Nano second:Counter32 [_value=678000000]
878     2015-12-15 22:56:20,252 | INFO | lt-dispatcher-29 | FlowStatisticsListener | 264 - org.opendaylight.nic.of-renderer - 1.1.0.SNAPSHOT | Flow Statistics gathering for Duration in Second:Counter32 [_value=49]
879