1.执行控制器端ryu程序
root@ubuntu:/home/renwoxing/Desktop/ryu/ryu/app# ryu-manager --verbose simple_switch_13.py
loading app simple_switch_13.py
loading app ryu.controller.ofp_handler
instantiating app simple_switch_13.py of SimpleSwitch13
instantiating app ryu.controller.ofp_handler of OFPHandler
BRICK SimpleSwitch13
CONSUMES EventOFPSwitchFeatures
CONSUMES EventOFPPacketIn
BRICK ofp_event
PROVIDES EventOFPSwitchFeatures TO {'SimpleSwitch13': set(['config'])}
PROVIDES EventOFPPacketIn TO {'SimpleSwitch13': set(['main'])}
CONSUMES EventOFPPortDescStatsReply
CONSUMES EventOFPHello
CONSUMES EventOFPErrorMsg
CONSUMES EventOFPEchoRequest
CONSUMES EventOFPPortStatus
CONSUMES EventOFPEchoReply
CONSUMES EventOFPSwitchFeatures
2.mininet启动,配置如下:
root@ubuntu:/home/renwoxing/Desktop# mn --topo single,3 --mac --switch ovsk --controller remote -x
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1) (h3, s1)
*** Configuring hosts
h1 h2 h3
*** Running terms on :0.0
*** Starting controller
*** Starting 1 switches
s1
*** Starting CLI:
3.ryu控制器端变化:
connected socket:<eventlet.greenio.base.GreenSocket object at 0x7fe9d10e2a90> address:('127.0.0.1', 59823)
connected socket:<eventlet.greenio.base.GreenSocket object at 0x7fe9d10e2610> address:('127.0.0.1', 59824)
hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x7fe9d10e2490>
move onto config mode
EVENT ofp_event->SimpleSwitch13 EventOFPSwitchFeatures
switch features ev version=0x4,msg_type=0x6,msg_len=0x20,xid=0x390f337d,OFPSwitchFeatures(auxiliary_id=0,capabilities=71,datapath_id=1,n_buffers=256,n_tables=254)
move onto main mode
EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
packet in 1 00:00:00:00:00:01 33:33:00:00:00:02 1
EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
packet in 1 00:00:00:00:00:02 33:33:00:00:00:02 2
EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
packet in 1 00:00:00:00:00:03 33:33:00:00:00:02 3
EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
packet in 1 00:00:00:00:00:01 33:33:00:00:00:02 1
packet in 1 00:00:00:00:00:02 33:33:00:00:00:02 2
EVENT ofp_event->SimpleSwitch13 EventOFPPacketIn
packet in 1 00:00:00:00:00:03 33:33:00:00:00:02 3
4.查看交换机信息: