How to do it...
Perform the following steps:
- Start the OpenDaylight distribution using the karaf script. Using this script will give you access to the Karaf CLI:
$ ./bin/karaf
- Install the user-facing feature responsible for pulling in all dependencies needed to connect an OpenFlow switch:
opendaylight-user@root>feature:install odl-unimgr-ui
It might take a minute or so to complete the installation.
- Connect the OvS instance to OpenDaylight in either passive or active mode:
- Log in to Mininet-VM using these credentials:
- Username: mininet
- Password: mininet
- Connect both OvS using active mode:
$ sudo ovs-vsctl set-manager tcp:${CONTROLLER_IP}:6640
Here, ${CONTROLLER_IP} is the IP address of the host running OpenDaylight.
- Our virtual switch is now connected to OpenDaylight:
mininet@mininet-vm:~$ sudo ovs-vsctl show
0b8ed0aa-67ac-4405-af13-70249a7e8a96
Manager "tcp:192.168.0.115:6640"
is_connected: true
ovs_version: "2.4.0"
- Create the first User Network Interface (UNI):
You will need the device's IP address and MAC address. To get those from the Mininet-VM, you can use the ifconfig command.
The UNI creation is a REST call made against the controller; make sure to replace ${DEVICE_IP} and ${DEVICE_IP} with the appropriate information. The request has the following configuration:
- Type: PUT
- Headers:
Authorization: Basic YWRtaW46YWRtaW4=
- URL: http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:uni/node/uni:%2F%2F${DEVICE_IP}
- Payload:
{
"network-topology:node": [
{
"node-id": "uni://${DEVICE_IP}",
"speed":
{
"speed-10M": 1
},
"uni:mac-layer": "IEEE 802.3-2005",
"uni:physical-medium": "UNI TypeFull Duplex 2 Physical
Interface",
"uni:mtu-size": 0,
"uni:type": "",
"uni:mac-address": "${DEVICE_MAC_ADDRESS}",
"uni:ip-address": "${DEVICE_IP}",
"uni:mode": "Full Duplex"
}
]
}
You should expect the status code 200 OK.
- Repeat the same operation in the previous step for the second device.
This UNI creation will result in having a create ovsbr0 bridge on the virtual switch, of the type internal.
- Create the Ethernet Virtual Connection (EVC):
As of now, the EVC creation is layer 3-based, thus you will need IP addresses of the two endpoints of the link (the two UNIs created in the previous step).
You will have to define an ${EVC_ID} as an integer. Make sure to replace ${DEVICE_1_IP} and ${DEVICE_1_IP} with the appropriate information.
The request to create the EVC is as follows:
- Type: PUT
- Headers:
Authorization: Basic YWRtaW46YWRtaW4=
- URL: http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:evc/link/evc:%2F%2F${EVC_ID}
- Payload:
{
"link":[
{
"link-id":"evc://${EVC_ID}",
"source":{
"source-node":"/network
-topology/topology/node/uni://${DEVICE_1_IP}"
},
"destination":{
"dest-node":"/network
-topology/topology/node/uni://${DEVICE_2_IP}"
},
"cl-unimgr-mef:uni-source":[
{
"order":"0",
"ip-address":"${DEVICE_1_IP}"
}
],
"cl-unimgr-mef:uni-dest":[
{
"order":"0",
"ip-address":"${DEVICE_2_IP}"
}
],
"cl-unimgr-mef:cos-id":"string",
"cl-unimgr-mef:ingress-bw":{
"speed-10G":{
}
},
"cl-unimgr-mef:egress-bw":{
"speed-10G":{
}
}
}
]
}
You should expect the status code 200 OK.
- Let's look at the resulting topology on our switches:
- First device:
mininet@mininet-vm:~$ sudo ovs-vsctl show
1077578e-f495-46a1-a96b-441223e7cc22
Manager "tcp:192.168.0.115:6640"
is_connected: true
Bridge "ovsbr0"
Port "eth1"
Interface "eth1"
Port "gre1"
Interface "gre1"
type: gre
options: {remote_ip="192.168.0.118"}
Port "ovsbr0"
Interface "ovsbr0"
type: internal
ovs_version: "2.3.1"
- Second device:
mininet@mininet-vm:~$ sudo ovs-vsctl show
0b8ed0aa-67ac-4405-af13-70249a7e8a96
Manager "tcp:192.168.0.115:6640"
is_connected: true
Bridge "ovsbr0"
Port "ovsbr0"
Interface "ovsbr0"
type: internal
Port "eth1"
Interface "eth1"
Port "gre1"
Interface "gre1"
type: gre
options: {remote_ip="192.168.0.117"}
ovs_version: "2.4.0"
Under the ovsbr0 bridge that was created, we can see the gre1 port being the endpoint of the created GRE tunnel, with the remote_ip specified.
The eth1 port is intended to be the device port.
- Test the created end-to-end link.
Pick the Mininet-VM you want and ping the other one.