Introduction
ONOS-1.12 RC3 introduces a lot of changes for Multicast. Firstly, the old Multicast Routing subsystem has been moved out from ONOS core and now it is an independent application. The new subsystem already supports dual-homed sinks and multiple-sources through its APIs (CLI/REST). However, Multicast features implemented in Segment Routing application, shipped with ONOS-1.12 RC3, support only H-AGG topology and dual-homed sinks.
As consequence of this, ONOS_APPS needs to be modified:
export ONOS_APPS=drivers,openflow,segmentrouting,fpm,dhcprelay,netcfghostprovider,routeradvertisement,mcast
As regards H-AGG support, this is entirely managed by the Segment Routing application and users won't notice changes in the APIs. While the dual-homing support comes with major changes in the Multicast Routing subsystem. Sink is now identified by an ONOS HostId (MAC/VLAN) and has associated a number of ConnectPoint while in the past we identified the Sink just using the ConnectPoint. Multicast subsystem listen for Host events and according to them modify properly the ConnectPoint associated to the HostId. In particular, it leverages the Host Location which is a collection of ONOS Connectpoint where the Host is attached. This information is maintained updated by ONOS thanks to several discovery mechanisms implemented in the Host subsystem. Following image try to summarize the workflow of the Multicast Routing subsystem after the aforementioned changes:
CLI commands
Hereafter a quick walkthrough of the new CLI implemented in the Multicast Routing subsystem.
Creating a route and adding sinks
In order to add a new Multicast route, we have to use mcast-host-join command and we need to provide following information: i) source address; ii) group address; iii) source connect points; iv) sinks. An example is reported in the following boxr:
mcast-host-join -sAddr * -gAddr 224.0.0.1 -srcs of:0000000000000204/6 -srcs of:0000000000000204/7 -sinks 00:AA:00:00:00:03/None -sinks 00:CC:00:00:00:01/None
As regards -sAddr we can provide * for ASM or an IPAddress for SSM. At the time being we do not enforce the matching of the -sAddr on the data-plane; -gAddr specifies Multicast group address; -srcs identifies the source connect points (in this release we don’t support multiple sources); finally -sinks specifies the sinks of the group, we changed from ConnectPoint to HostId in this release.
Removing a sink
A sink can be removed through mcast-host-delete command, the major difference is that the sinks to be removed is provided through -h option. If -h is not provided the command will issue a route removal
mcast-host-delete -sAddr * -gAddr 224.0.0.1 -h 00:AA:00:00:00:03/None
Modifying a source
In this release, we have also a command to modify the sources of a Multicast group. In particular mcast-source-delete allows to modify the source connect points of a source. If -src is not provided, the command will issue a route removal
mcast-source-delete -sAddr * -gAddr 224.0.0.1 -src of:0000000000000204/6
Removing a route
The removal of a route can be achieved in several ways: i) removing all sources; ii) not providing -h to the mcast-host-delete command; iii) not providing -src option to the mcast-source-delete command.
mcast-source-delete -sAddr * -gAddr 224.0.0.1 -src of:0000000000000204/6 -src of:0000000000000204/7
mcast-host-delete -sAddr * -gAddr 224.0.0.1
mcast-source-delete -sAddr * -gAddr 224.0.0.1
REST APIs
You can find the REST API documentation at http://<ONOS-IP>:8181/onos/v1/docs
Please click the dropdown list and select Multicast API.
We configure and implement Multicast routes through the dedicated rest api. Some of the APIs are outlined here, you can find complete list in the ONOS docs page. The referenced files in these examples can be found in $ONOS_ROOT/apps/mcast/web/resources/jsonExamples
GET Operations
$ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast'
$ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/{group_ip}/{source_ip}/'
$ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sources/{group_ip}/{source_ip}/'
$ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sinks/{group_ip}/{source_ip}/'
$ curl --user onos:rocks -X GET -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast'
POST operations
curl --user onos:rocks -X POST -H 'Content-Type:application/json' http://<controller-ip>:8181/onos/mcast/mcast -d@mcastRoute.json
$ curl --user onos:rocks -X POST -H 'Content-Type:application/json' http://<controller-ip>:8181/onos/mcast/mcast/bulk -d@mcastRoutes.json
$ 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
$ 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
$ curl --user onos:rocks -X POST -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/{group_ip}/{source_ip}/{hostId}' -d@mcastSinksHostId.json
DELETE operations
$ curl --user onos:rocks -X DELETE -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast
$ curl --user onos:rocks -X DELETE -H 'Content-Type:application/json' http://<controller-ip>:8181/onos/mcast/mcast/bulk -d@mcastRoutes.json
$ curl --user onos:rocks -X DELETE -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/{group_ip}/{source_ip}'
$ curl --user onos:rocks -X DELETE -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sources/{group_ip}/{source_ip}/{source_cp}'
$ curl --user onos:rocks -X DELETE -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/sinks/{group_ip}/{source_ip}/{host_id}'
$ curl --user onos:rocks -X DELETE -H 'Accept: application/json' 'http://<controller-ip>:8181/onos/mcast/mcast/{group_ip}/{source_ip}/{source_cp}' -d@mcastSinksHostId.json
JSON Example
Below we find the configuration json for a single Mcast Route
{ "group": "224.0.1.1", "source": "*", "sources": [ "of:0000000000000204/6", "of:0000000000000204/7" ], "sinks": [ "00:CC:00:00:00:01/None", "00:AA:00:00:00:03/None" ] }
Fields:
- group : IP address of the Multicast Group
- 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)
- sources : Array containing the connect points to which the source is connected to.
- 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.
Attachments:
multicast2.png (image/png)
multicast2.png (image/png)
Screenshot 2018-02-28 09.10.19.png (image/png)
Screen Shot 2018-04-05 at 14.33.06.png (image/png)
multicast2.png (image/png)