• 微信公众号:美女很有趣。 工作之余,放松一下,关注即送10G+美女照片!

sdn第三次作业

开发技术 开发技术 4小时前 3次浏览

SDN第三次实验报告

(一)基本要求

1.拓扑文件的存放:

sdn第三次作业

拓扑文件(导出为Python):

#!/usr/bin/env python

from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.link import TCLink, Intf
from subprocess import call


def myNetwork():
    net = Mininet(topo=None,
                  build=False,
                  ipBase='10.0.0.0/8')

    info('*** Adding controllern')
    c0 = net.addController(name='c0',
                           controller=Controller,
                           protocol='tcp',
                           port=6633)

    info('*** Add switchesn')
    s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
    s2 = net.addSwitch('s2', cls=OVSKernelSwitch)


    info('*** Add hostsn')
    h1 = net.addHost('h1', cls=Host, ip='192.168.0.101/24', defaultRoute=None)
    h2 = net.addHost('h2', cls=Host, ip='192.168.0.102/24', defaultRoute=None)
    h3 = net.addHost('h3', cls=Host, ip='192.168.0.103/24', defaultRoute=None)
    h4 = net.addHost('h4', cls=Host, ip='192.168.0.104/24', defaultRoute=None)

    info('*** Add linksn')
    net.addLink(h1, s1, 1, 1)
    net.addLink(h2, s1, 1, 2)
    net.addLink(h3, s2, 1, 1)
    net.addLink(h4, s2, 1, 2)
    net.addLink(s1, s2, 3, 3)

    info('*** Starting networkn')
    net.build()
    info('*** Starting controllersn')
    for controller in net.controllers:
        controller.start()

    info('*** Starting switchesn')
    net.get('s1').start([c0])
    net.get('s2').start([c0])


    info('*** Post configure switches and hostsn')

    CLI(net)
    net.stop()


if __name__ == '__main__':
    setLogLevel('info')
    myNetwork()

抓包:

sdn第三次作业

hello 控制器6633端口—>交换机48056端口

sdn第三次作业

交换机48056端口 —控制器6633端口(支持Openflow1.5)

sdn第三次作业

Fertures Request /Set Config

sdn第三次作业

sdn第三次作业

Features Reply

sdn第三次作业

交互图

sdn第三次作业

3.TCP协议

(二)进阶

在做了在做了


程序员灯塔
转载请注明原文链接:sdn第三次作业
喜欢 (0)