首先启动floodlight控制器和预装有mininet的虚拟机

控制器:192.168.56.1

虚拟机:192.168.56.99


启动控制器日志:

09:46:08.359 INFO [n.f.c.m.FloodlightModuleLoader:main] Loading default modules
09:46:09.756 INFO [n.f.c.i.Controller:main] Controller role set to MASTER
09:46:09.806 INFO [n.f.c.i.Controller:main] Flush switches on reconnect -- Disabled
09:46:12.733 INFO [n.f.l.i.LinkDiscoveryManager:main] Setting autoportfast feature to OFF
09:46:13.494 INFO [o.s.s.i.c.FallbackCCProvider:main] Cluster not yet configured; using fallback local configuration
09:46:13.495 INFO [o.s.s.i.SyncManager:main] [32767] Updating sync configuration ClusterConfig [allNodes={32767=Node [hostname=localhost, port=6642, nodeId=32767, domainId=32767]}, authScheme=CHALLENGE_RESPONSE, keyStorePath=/etc/floodlight/auth_credentials.jceks, keyStorePassword is unset]
09:46:13.799 INFO [o.s.s.i.r.RPCService:main] Listening for internal floodlight RPC on localhost/127.0.0.1:6642
09:46:14.458 INFO [n.f.c.i.Controller:main] Listening for switch connections on 0.0.0.0/0.0.0.0:6633
09:46:18.488 INFO [n.f.j.JythonServer:debugserver-main] Starting DebugServer on :6655


虚拟机中启动mininet,控制器设置为192.168.56.1

mn --controller=remote --ip=192.168.56.1 --port=6633

frontpage_diagram.png

可以更改参数改变网络拓扑的情况具体操作方法见mininet文档。

可以通过ssh -X转发方式连接到虚拟机上,打开虚拟机中的wireshark,抓包分析openflow包。

可以在虚拟机中配置虚拟交换机的流表项:

dpctl add-flow tcp:127.0.0.1:6634 in_port=1,actions=output:1