zoukankan      html  css  js  c++  java
  • 2019 SDN上机第4次作业

    1.解压配置Java环境

    sudo gedit ~/.bashrc
    在bashrc文件底部添加java路径

    2.安装插件


    安装feature
    feature:install odl-restconf odl-l2switch-switch-ui odl-openflowplugin-all odl-mdsal-apidocs odl-dlux-core odl-dlux-node odl-dlux-yangui

    3.用Python编写代码

    from mininet.topo import Topo
    class Mytopo(Topo):
        def __init__(self):
            Topo.__init__(self)
            sw=self.addSwitch('s1')
            count=1
            for i in range(3):
                    host = self.addHost('h{}'.format(count))
                    self.addLink(host,sw,1,count)
                    count = count + 1
    topos = {'mytopo': (lambda:Mytopo())}
    

    执行以下命令
    sudo mn --custom /home/mowei/1.py --topo mytopo --controller=remote,ip=127.0.0.1,port=6633 --switch ovsk,protocols=OpenFlow13

    测试连通性

    4.浏览器访问http://127.0.0.1:8181/index.html进入ODL图形化界面


    在mininet中使用links查看端口

    在Opendaylight下设置相关参数下发流表


    h2 ping h3
    20s内ping不通,20s后ping通

    5.借助Postman通过OpenDayLight的北向接口下发流表,再利用OpenDayLight北向接口查看已下发的流表。


    将id改为2,并把url中的flow id也改为2,点击send

    改为GET后send查看刚刚下发的流表

  • 相关阅读:
    SGU 275. To xor or not to xor
    4364: [IOI2014]wall砖墙
    3211: 花神游历各国
    5248: [2018多省省队联测]一双木棋
    3106: [cqoi2013]棋盘游戏
    POJ 1568 Find the Winning Move
    P3527 [POI2011]MET-Meteors
    P2617 Dynamic Rankings
    3262: 陌上花开
    1176: [Balkan2007]Mokia
  • 原文地址:https://www.cnblogs.com/0x06c0/p/11923331.html
Copyright © 2011-2022 走看看