SDN fourth operation on board

1. Unzip the installation OpenDayLight controller (this experiment consistent use of Beryllium version)

After installing the plug-in installation ODL

2.3 with Python script to build a topology, the controller is connected OpenDayLight

Topology is shown:

Python code:

from mininet.topo import Topo
class Mytopo(Topo):
    def __init__(self):
        Topo.__init__(self)
        sw=self.addSwitch('s1')
        count=1
        for i in range(3):
                host = self.addHost('h{}'.format(count))
                self.addLink(host,sw,1,count)
                count = count + 1
topos = {'mytopo': (lambda:Mytopo())}

After pingall input detecting connectivity topology structures, while the controller side view topology:


3. The following table WEB UI hair flow controller provided after the inner h2 20s ping nowhere recovery h3,20s

Input links, view port connectivity, port 2 can be seen that the switch is connected h2

Input id node, table and flow in Yang UI interface, access port is set to 2, ethernet-type is set to 0x0800, the source address is set ipv4-march as 10.0.0.2/32, destination address 10.0.0.3/32

and the action instruction order is set to 0

Time delay is set to 20s, table id is set to 0, since there is no flow table issued over other priority temporarily disposed so

Start h2 ping h3 issued after the flow meter to check the connectivity disconnected from the circumstances of the recovery, we can see the first 4 seconds to start, interrupt 20 seconds before resuming communications

4. Postman by means of an interface to the north OpenDayLight hair flow table, view, North reuse OpenDayLight issued to the interface flow table

Click Preview in DLUX interface, copy the code

Close DLUX interface, but keep ODL open, open Postman, enter the account password authorization, URL and then write code, the interface implementation calls ODL

Preview as follows:

{
    "flow": [
        {
            "id": "1",
            "match": {
                "in-port": "2",
                "ethernet-match": {
                    "ethernet-type": {
                        "type": "2048"
                    }
                },
                "ipv4-destination": "10.0.0.3/32"
            },
            "instructions": {
                "instruction": [
                    {
                        "order": "0",
                        "apply-actions": {
                            "action": [
                                {
                                    "order": "0",
                                    "drop-action": {}
                                }
                            ]
                        }
                    }
                ]
            },
            "hard-timeout": "20",
            "table_id": "0"
        }
    ]
}

Start again h2 ping h3, under Postman hair flow meter to check the connectivity disconnected from the circumstances of the recovery, you can see 5 seconds starts, interrupted for 20 seconds before resuming communications

Guess you like

Origin www.cnblogs.com/yumesinyo/p/11930389.html