SDN第二次上机作业

1.安装floodlight

2.生成拓扑并连接控制器floodlight,利用控制器floodlight查看图形拓扑

生成拓扑代码:

from mininet.topo import Topo

class MyTopo( Topo ):
    "Simple topology example."

    def __init__( self ):
        "Create custom topo."

        # Initialize topology
        Topo.__init__( self )

        # Add hosts and switches
        host1 = self.addHost( 'h1' )
        host2 = self.addHost( 'h2' )
        host3 = self.addHost( 'h3' )
        switch1 = self.addSwitch( 's1' )
        switch2 = self.addSwitch( 's2' )
        switch3 = self.addSwitch( 's3' )
        switch4 = self.addSwitch( 's4' )

        # Add links
        self.addLink( host1, switch2 )
        self.addLink( host2, switch3 )
        self.addLink( host3, switch4 )
        self.addLink( switch1, switch2 )
        self.addLink( switch1, switch3 )
        self.addLink( switch1, switch4 )


topos = { 'mytopo': ( lambda: MyTopo() ) }

运行代码,测试连通性

floodlight查看拓扑图

3.利用字符界面下发流表,使得‘h1’和‘h2’ ping 不通

4.利用字符界面下发流表,通过测试‘h1’和‘h3’的联通性,来验证openflow的hardtime机制

posted @ 2017-12-06 17:17  龙套1997  阅读(893)  评论(0编辑  收藏  举报