blob: a33fe3ce5882b621f34f3c0b88ca12e7d07b3540 [file] [log] [blame]
Charles Chan9e5c6172019-09-07 11:24:54 -07001Multicast
2=========
Charles Chan3d8c0ce2019-09-09 11:11:47 -07003
4Trellis supports IP multicast in an classic SDN way.
5**None of the common IP multicast protocols (e.g. IGMP, PIM) is used when calculating the multicast tree internally**.
6Instead, benefiting from SDN, Trellis calculates the multicast tree in a centralized way and program the switches accordingly. Having said that, it doesn't prevent us from using common IP multicast protocols to communicate with externals.
7
8Here's a summary of multicast features Trellis supports.
9
10- Support both **IPv4 and IPv6** multicast
11- Support **multi-stage** topology
12- Support **dual-homed sinks** (with failure recovery)
13- Support **multiple sources**
14
15.. image:: ../images/config-mcast.png
Charles Chan33bac082019-09-12 01:07:51 -070016 :width: 1000px
Charles Chan3d8c0ce2019-09-09 11:11:47 -070017
18.. note::
19 Dual-homed sinks and multiple sources support comes with major changes in the Multicast Routing subsystem.
20 **Sink and sources are now identified by an ONOS HostId (MAC/VLAN)** and has associated a number of ConnectPoint while in the past we identified the sinks and the sources just using one ConnectPoint.
21 Multicast subsystem listen for Host events and according to them modify properly the ConnectPoint associated to the HostId.
22 In particular, it leverages the Host Location which is a collection of ONOS ConnectPoint where the Host is attached.
23 This information is maintained updated by ONOS thanks to several discovery mechanisms implemented in the Host subsystem.
24 Following image try to summarize the work flow of the Multicast Routing subsystem after the aforementioned changes:
25
26 .. image:: ../images/config-mcast-internal.png
27 :width: 600px
28 :align: center
29
Charles Chan33bac082019-09-12 01:07:51 -070030.. caution::
31 We should avoid using reserved Multicast groups. Please check here for the reserved values: http://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml
32
Charles Chan3d8c0ce2019-09-09 11:11:47 -070033
34Activate Multicast
35------------------
36The multicast service need to be activated by the following command:
37
38.. code-block:: console
39
40 onos> app activate mcast
41
42You can also add ``mcast`` into ``$ONOS_APPS`` environment variable such that it gets started automatically every time.
43
44
45CLI commands
46------------
47
48Creating a route and adding sinks
49^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50In order to add a new Multicast route, we have to use ``mcast-host-join`` command and we need to provide following information:
511) **source address**; 2) **group address**; 3) **sources** ; 4) **sinks**.
52Here's an example:
53
54.. code-block:: console
55
56 onos> mcast-host-join -sAddr * -gAddr 224.0.0.1 -srcs 00:AA:00:00:00:01/None -srcs 00:AA:00:00:00:05/None -sinks 00:AA:00:00:00:03/None -sinks 00:CC:00:00:00:01/None
57
58- ``-sAddr``: we can provide **\* for ASM** or an **IP address for SSM**.
59 At the time being we do not enforce the matching of the -sAddr on the data-plane;
60- ``-gAddr`` specifies Multicast group address
61- ``-srcs`` identifies the source we changed from ConnectPoint to HostId in this release.
62- ``-sinks`` specifies the sinks of the group, we changed from ConnectPoint to HostId in this release.
63
64
65Removing a sink
66^^^^^^^^^^^^^^^
67A sink can be removed through ``mcast-sink-delete`` command.
68The major difference is that the sinks to be removed is provided through ``-h`` option.
69If ``-h`` is not provided the command will issue a route removal.
70
71.. code-block:: console
72
73 onos> mcast-sink-delete -sAddr * -gAddr 224.0.0.1 -h 00:AA:00:00:00:03/None
74
75
76Modifying a source
77^^^^^^^^^^^^^^^^^^
78We also provide a command to modify the sources of a Multicast group.
79In particular ``mcast-source-delete`` allows to modify the source connect points of a source.
80If ``-src`` is not provided, the command will issue a route removal
81
82.. code-block:: console
83
84 onos> mcast-source-delete -sAddr * -gAddr 224.0.0.1 -src 00:AA:00:00:00:01/None
85
86
87Removing a route
88^^^^^^^^^^^^^^^^
89The removal of a route can be achieved in several ways:
90
911. **removing all sources**
92
93 .. code-block:: console
94
95 onos> mcast-source-delete -sAddr * -gAddr 224.0.0.1 -src 00:AA:00:00:00:01/None -src 00:AA:00:00:00:05/None
96
972. **not providing -h to the mcast-host-delet** command
98
99 .. code-block:: console
100
101 onos> mcast-sink-delete -sAddr * -gAddr 224.0.0.1
102
1033. **not providing -src option to the mcast-source-delete** command.
104
105 .. code-block:: console
106
107 onos> mcast-source-delete -sAddr * -gAddr 224.0.0.1
108
109
110REST APIs
111---------
112You can find the REST API documentation at ``http://<ONOS-IP>:8181/onos/v1/docs``.
113Please click the drop down list and select Multicast API.
114
115.. image:: ../images/config-mcast-rest.png
116
117We configure and implement multicast routes through the dedicated REST API.
118Some of the APIs are outlined here, you can find complete list in the ONOS docs page.
119The referenced files in these examples can be found in ``$ONOS_ROOT/apps/mcast/web/src/main/resources/jsonExamples``
120
121GET operations
122^^^^^^^^^^^^^^
123
124- Get all routes
125
126 .. code-block:: console
127
128 $ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast'
129
130- Get a specific route
131
132 .. code-block:: console
133
134 $ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/{group_ip}/{source_ip}/'
135
136- Get all source connect point for a route
137
138 .. code-block:: console
139
140 $ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sources/{group_ip}/{source_ip}/'
141
142- Get all sink connect points for a route
143
144 .. code-block:: console
145
146 $ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sinks/{group_ip}/{source_ip}/'
147
148- Get all connect points for a given host Id in a given route
149
150 .. code-block:: console
151
152 $ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast'
153
154
155POST operations
156^^^^^^^^^^^^^^^
157
158- Single route post
159
160 .. code-block:: console
161
162 $ curl --user onos:rocks -X POST -H 'Content-Type:application/json' http://<controller-ip>:8181/onos/mcast/mcast -d@mcastRoute.json
163
164- Bulk routes post
165
166 .. code-block:: console
167
168 $ curl --user onos:rocks -X POST -H 'Content-Type:application/json' http://<controller-ip>:8181/onos/mcast/mcast/bulk -d@mcastRoutes.json
169
170- Add a specific set of source connect points to a given route
171
172 .. code-block:: console
173
174 $ curl --user onos:rocks -X POST -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sources/{group_ip}/{source_ip}/' -d@mcastSources.json
175
176- Add a specific set of host Ids as sinks to a given route
177
178 .. code-block:: console
179
180 $ curl --user onos:rocks -X POST -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sinks/{group_ip}/{source_ip}/' -d@mcastSinks.json
181
182- Add a specific set of connect points from a host source for a given route
183
184 .. code-block:: console
185
186 $ curl --user onos:rocks -X POST -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sources/{group_ip}/{source_ip}/{hostId}' -d@mcastSourcesHostId.json
187
188- Add a specific set of connect points from a host sink from a given route
189
190 .. code-block:: console
191
192 $ curl --user onos:rocks -X POST -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sinks/{group_ip}/{source_ip}/{hostId}' -d@mcastSinksHostId.json
193
194
195DELETE operations
196^^^^^^^^^^^^^^^^^
197
198- Remove all routes
199
200 .. code-block:: console
201
Zack Williams4d900762020-01-21 11:00:35 -0700202 $ curl --user onos:rocks -X DELETE -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast'
Charles Chan3d8c0ce2019-09-09 11:11:47 -0700203
204- Bulk route removal
205
206 .. code-block:: console
207
208 $ curl --user onos:rocks -X DELETE -H 'Content-Type:application/json' http://<controller-ip>:8181/onos/mcast/mcast/bulk -d@mcastRoutes.json
209
210- Remove a specific route given group and ip
211
212 .. code-block:: console
213
214 $ curl --user onos:rocks -X DELETE -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/{group_ip}/{source_ip}'
215
216- Remove a specific source from a given route
217
218 .. code-block:: console
219
220 $ curl --user onos:rocks -X DELETE -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sources/{group_ip}/{source_ip}/{host_id}'
221
222- Remove a specific sink from a given route
223
224 .. code-block:: console
225
226 $ curl --user onos:rocks -X DELETE -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sinks/{group_ip}/{source_ip}/{host_id}'
227
228
229JSON Example
230^^^^^^^^^^^^
231Below we find the configuration json for a single multicast route.
232
233.. code-block:: json
234
235 {
236 "group": "224.0.1.1",
237 "source": "*",
238 "sources": [
239 "00:AA:00:00:00:01/None",
240 "00:AA:00:00:00:05/None"
241 ],
242 "sinks": [
243 "00:CC:00:00:00:01/None",
244 "00:AA:00:00:00:03/None"
245 ]
246 }
247
248- ``group``: IP address of the Multicast Group
249- ``source``: IP address of the Multicast source. If specified (e.g. 10.0.1.1) we will treat this route as SSM (Single Source Multicast), if instead * is used the route will be ASM (Any Source Multicast)
250- ``sources``: Array containing the connect points to which the source is connected to.
251- ``sinks``: Array containing a set of Hosts that we want as sinks of the multicast stream. ONOS will automatically handle the connect points of these hosts if they are single or dual homed.
252
253