zoukankan      html  css  js  c++  java
  • SDN2

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

    (1)创建SDNtest2.py文档

    from mininet.topo import Topo
     
    class MyTopo( Topo ):
     
        def __init__( self ):
     
            # Initialize topology
            Topo.__init__( self )
            
            switch1 = self.addSwitch('switch1')
            switch2 = self.addSwitch('switch2')
    
            h1 = self.addHost('h1')
            h2 = self.addHost('h2')
            h3 = self.addHost('h3')
            h4 = self.addHost('h4')
            h5 = self.addHost('h5')
            h6 = self.addHost('h6')
    
            self.addLink(h1,switch1,1,1)
            self.addLink(h2,switch1,1,2)
            self.addLink(h3,switch1,1,3)
            self.addLink(switch1,switch2,4,4)
            self.addLink(h4,switch2,1,1)
            self.addLink(h5,switch2,1,2)
            self.addLink(h6,switch2,1,3)
    
    topos = { 'mytopo': ( lambda: MyTopo() ) }
    

    (2)输入如下命令,创建拓扑

    sudo mn --custom ./SDNtest2.py --topo mytopo --controller=remote,ip=127.0.0.1,port=6653 --switch ovsk,protocols=OpenFlow13
    

    (3)使用pingall命令测试所有节点连通性

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

    自己的虚拟机上没安装OVS,又重新安装了老师的镜像在上面做实验(╥﹏╥)

    • h1 -- h4互通

    • h2 -- h5互通

    • h3 -- h6互通

    • 其余主机不通

    • 将主机1,2,3进入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
    
    • 将主机4,5,6进入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抓包,分析验证特定报文

  • 相关阅读:
    JAVA heap space 内存溢出
    S数据导入
    全部物料的交期都要加上两天 V_OUT_PR
    S初始化生产环境数据
    修改邮件通知模板
    java 工具类使用
    Nginx 搭建图片服务器
    java 枚举类型 Enum
    aop设计原理(转)
    Callable+ThreadPoolExecutor实现多线程并发并获得返回值(转)
  • 原文地址:https://www.cnblogs.com/JasonL-S/p/11809650.html
Copyright © 2011-2022 走看看