Openflow南向接口协议分析

  • 一、创建环境(ubuntu2204)

  • 二、启动控制器

  • 1、启动opendaylight

  • root@yyq-virtual-machine:/home/yyq# cd opendaylight/
    root@yyq-virtual-machine:/home/yyq/opendaylight# cd distribution-karaf-0.6.4-Carbon
    root@yyq-virtual-machine:/home/yyq/opendaylight/distribution-karaf-0.6.4-Carbon# cd bin/
    root@yyq-virtual-machine:/home/yyq/opendaylight/distribution-karaf-0.6.4-Carbon/bin# . karaf
    Apache Karaf starting up. Press Enter to open the shell now...
    100% [========================================================================]

    Karaf started in 25s. Bundle stats: 363 active, 363 total
                                                                                               
        ________                       ________                .__  .__       .__     __       
        \_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_     
         /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\    
        /    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |      
        \_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|      
                \/|__|        \/     \/        \/     \/\/            /_____/      \/          
                                                                                               

    Hit '<tab>' for a list of available commands
    and '[cmd] --help' for help on a specific command.
    Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.

    opendaylight-user@root>

  • 2、用netstat查看端口(主要查看6633和6653)

  • root@yyq-virtual-machine:/home/yyq# netstat -ntlp |grep 6633
    tcp6       0      0 :::6633                 :::*                    LISTEN      3670/java           
    root@yyq-virtual-machine:/home/yyq# netstat -ntlp |grep 6653
    tcp6       0      0 :::6653        (listen代表正在监听)
  • 3、用浏览器测试web端口

  • IP地址:8181/index.html#/login(用户名和密码都是admin)
  • 三、创建mn虚拟环境

  • 1、启动虚拟环境

  • root@yyq-virtual-machine:/home/yyq# mn --controller=remote,ip=192.168.87.130 --switch=ovsk,protocols=OpenFlow13(这里的ip地址每个人根据自己实际情况都是不一样的)
    *** Creating network
    *** Adding controller
    Connecting to remote controller at 192.168.87.130:6653
    *** Adding hosts:
    h1 h2 
    *** Adding switches:
    s1 
    *** Adding links:
    (h1, s1) (h2, s1) 
    *** Configuring hosts
    h1 h2 
    *** Starting controller
    c0 
    *** Starting 1 switches
    s1 ...
    *** Starting CLI:
  • 2、在Linux终端查看端口交换机

  • root@yyq-virtual-machine:/home/yyq# ovs-vsctl show
    1540ba6b-9f63-4ba3-8df4-0d053718cb6f
        Bridge s1
            Controller "ptcp:6654"
            Controller "tcp:192.168.87.130:6653"
                is_connected: true(这里的true说明连接成功)
            fail_mode: secure
            Port s1
                Interface s1
                    type: internal
            Port s1-eth2
                Interface s1-eth2
            Port s1-eth1
                Interface s1-eth1
        ovs_version: "2.17.9"
  • 3、在mn虚拟环境中用pingall测试

  • 4、在浏览器查看拓扑

  • (说明控制器已经和交换机成功建立连接)
  • 四、安装抓包工具

  • apt install wireshark
  • 五、打开抓包工具进行抓包

  • 在mininet终端下执行pingall即可
  • 69
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值