官术网_书友最值得收藏!

How to do it...

Perform the following steps:

  1. Start the OpenDaylight distribution using the karaf script. Using this script will give you access to the Karaf CLI:
$ ./bin/karaf 
  1. 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.

  1. 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"
  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. Test the created end-to-end link.

Pick the Mininet-VM you want and ping the other one.

主站蜘蛛池模板: 交城县| 明星| 财经| 平塘县| 枣庄市| 江川县| 乌兰浩特市| 冕宁县| 河东区| 赣州市| 乌拉特后旗| 保山市| 马龙县| 肃南| 武强县| 如皋市| 繁峙县| 阳泉市| 高雄市| 鄂温| 琼结县| 苍溪县| 巫山县| 郯城县| 西昌市| 泰顺县| 徐汇区| 葫芦岛市| 甘孜| 奎屯市| 鹤山市| 静宁县| 天柱县| 甘泉县| 长汀县| 互助| 广东省| 泽州县| 慈利县| 深泽县| 云和县|