• SDN第二次上机作业


    作业链接

    安装floodlight

    教程

    打开网页localhost:8080/ui/pages/index.html

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

    #!/usr/bin/python
     
    from mininet.topo import Topo
    from mininet.net import Mininet
    from mininet.node import RemoteController,CPULimitedHost
    from mininet.link import TCLink
    from mininet.util import dumpNodeConnections
     
    class MyTopo( Topo ):
        "Simple topology example."
     
        def __init__( self ):
            "Create custom topo."
     
            # Initialize topology
            Topo.__init__( self )
    
            #add hosts
            host1 = self.addHost('h1')
            host2 = self.addHost('h2')
            host3 = self.addHost('h3')
            
            #add switch
            switch1 = self.addSwitch('s1')
            switch2 = self.addSwitch('s2')
            switch3 = self.addSwitch('s3') 
            switch4 = self.addSwitch('s4')
            
            #add link 
    	self.addLink(host1,switch2,1,1)
    	self.addLink(host2,switch3,1,1)
    	self.addLink(host3,switch4,1,1)
    	self.addLink(switch1,switch2,1,2)       
    	self.addLink(switch1,switch3,2,2)
    	self.addLink(switch1,switch4,3,2)
            
    topos = { 'mytopo': ( lambda: MyTopo() ) }
    

    结果:

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

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

    初始连通性:

    下发具有hardtime的流表:

    测试结果:

  • 相关阅读:
    volatile用法
    static用法
    sizeof用法
    C语言void关键字的深刻含义
    extern用法
    const用法
    attribute用法
    Task的运行过程分析
    Android BroadcastReceiver实例Demo(有序广播的发送)
    旅行-许巍
  • 原文地址:https://www.cnblogs.com/suefen/p/7993827.html
Copyright © 2020-2023  润新知