• 2019 SDN上机第2次作业


    1. 利用mininet创建如下拓扑,要求拓扑支持OpenFlow 1.3协议,主机名、交换机名以及端口对应正确,请给出拓扑Mininet执行结果,展示端口连接情况

    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 ):
    
        def __init__( self ):
            Topo.__init__( self )
            s = []
            for i in range( 2 ):
                    sw = self.addSwitch( 's{}'.format( i + 1 ) )
                    s.append( sw )
    
            count = 1
            for sw1 in s:
                    for i in range(3):
                        host = self.addHost( 'h{}'.format( count ) )
                        self.addLink( sw1, host )
                        count += 1
        self.addLink(s[0],s[1])
    topos = { 'mytopo': ( lambda: MyTopo() ) }
    

    查看连通性

    2. 直接在Open vSwitch下发流表,实现如下连通性要求,请逐条说明所下发的流表含义

    #将h1,h2,h3进入s1的包打上vlan tag,转发端口4
    sudo ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,in_port=1,actions=push_vlan:0x8100,set_field:4096->vlan_vid,output:4
    sudo ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,in_port=2,actions=push_vlan:0x8100,set_field:4097->vlan_vid,output:4
    sudo ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,in_port=3,actions=push_vlan:0x8100,set_field:4098->vlan_vid,output:4
    #将从端口4的包去除vlan tag, 并根据tag进行转发
    sudo ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,dl_vlan=0,actions=pop_vlan,output:1
    sudo ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,dl_vlan=1,actions=pop_vlan,output:2
    sudo ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,dl_vlan=2,actions=pop_vlan,output:3
    #将h4,h5,h6进入s2的包打上vlan tag,转发端口4
    sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,in_port=1,actions=push_vlan:0x8100,set_field:4096->vlan_vid,output:4
    sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,in_port=2,actions=push_vlan:0x8100,set_field:4097->vlan_vid,output:4
    sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,in_port=3,actions=push_vlan:0x8100,set_field:4098->vlan_vid,output:4
    #将从端口4的包去除vlan tag, 并根据tag进行转发
    sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,dl_vlan=0,actions=pop_vlan,output:1
    sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,dl_vlan=1,actions=pop_vlan,output:2
    sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,dl_vlan=2,actions=pop_vlan,output:3
    

    3. 直接在Open vSwitch查看流表,提交OVS命令执行结果

    4. 提交主机连通性测试结果,验证流表的有效性

    5. 利用Wireshark抓包,分析验证特定报文

  • 相关阅读:
    ubuntu 修改mysql 5.7数据库密码
    maven 配置
    数据仓库的命名规范
    mysql 之 在查询字段中得出分钟数
    mysql 之 timestampdiff() 函数 ,得到间隔分钟数
    linux 服务器上下载文件到本地
    mysql 之 时间格式 今年的第一天,去年的第一天
    mysql 之 str_to_date ()函数 和date_format()函数
    网络不可用时~更改DNS并刷新
    mysql之 round()函数 , concat()函数
  • 原文地址:https://www.cnblogs.com/Jamwong/p/11832580.html
Copyright © 2020-2023  润新知