lost and found ( for me ? )

Ubuntu13.10: install floodlight and connect it to an openvswitch

Here is how to install floodlight and get information over REST API.


Reference


I have already installed openvsiwtch and associate br0 with eth0.
ii  openvswitch-sw 1.10.2-0ubun amd64        Open vSwitch switch implementatio


Here is how to install openvswitch and integrate it with KVM.
http://lost-and-found-narihiro.blogspot.jp/2014/02/ubuntu-1310-install-use-openvswitch.html


# ovs-vsctl show
41d09907-b8ac-4000-817c-41571e987aea
   Bridge "br0"
       Port "br0"
           Interface "br0"
               type: internal
       Port "eth0"
           Interface "eth0"
   ovs_version: "1.10.2"


install floodlight and run.
# git clone git://github.com/floodlight/floodlight.git
# cd floodlight/


# ant
Buildfile: /home/hattori/Git_works/floodlight/build.xml


init:
   [mkdir] Created dir: /home/hattori/Git_works/floodlight/target/bin
   [mkdir] Created dir: /home/hattori/Git_works/floodlight/target/bin-test
   [mkdir] Created dir: /home/hattori/Git_works/floodlight/target/lib
BUILD SUCCESSFUL
Total time: 19 seconds
#


# java -jar target/floodlight.jar
01:43:37.754 INFO [n.f.c.m.FloodlightModuleLoader:main] Loading default modules
01:43:38.359 INFO [n.f.c.i.Controller:main] Controller role set to MASTER
01:43:38.367 INFO [n.f.c.i.Controller:main] Flush switches on reconnect -- Disabled


set controller
# ovs-vsctl set-controller br0 tcp:127.0.0.1


# ovs-vsctl show
41d09907-b8ac-4000-817c-41571e987aea
   Bridge "br0"
   Controller "tcp:127.0.0.1"
           is_connected: true
       Port "br0"
           Interface "br0"
               type: internal
       Port "eth0"
           Interface "eth0"
   ovs_version: "1.10.2"



start a VM which is using br0.


virsh # start ubuntu1310-vm1


Here is xml file of the VM.


virsh # dumpxml ubuntu1310-vm1
  <interface type='bridge'>
     <mac address=''/>
     <source bridge='br0'/>
     <virtualport type='openvswitch'>
       <parameters interfaceid='3a76a16f-3478-47b9-8783-798b655a6f6c'/>
     </virtualport>
     <target dev='vnet0'/>


Get information over REST API.
http://www.openflowhub.org/display/floodlightcontroller/Floodlight+REST+API
# ovs-ofctl dump-flows br0
NXST_FLOW reply (xid=0x4):
cookie=0x20000000000000, duration=3.183s, table=0, n_packets=278, n_bytes=364166, idle_timeout=5, idle_age=0, priority=0,in_port=1,vlan_tci=0x0000,dl_src=00:24:a5:c0:45:50,dl_dst=52:54:00:1c:ca:06 actions=output:2
cookie=0x20000000000000, duration=5.471s, table=0, n_packets=8, n_bytes=596, idle_timeout=5, idle_age=1, priority=0,in_port=LOCAL,vlan_tci=0x0000,dl_src=78:e7:d1:7f:84:b7,dl_dst=00:24:a5:c0:45:50 actions=output:1
cookie=0x20000000000000, duration=3.178s, table=0, n_packets=154, n_bytes=20185, idle_timeout=5, idle_age=0, priority=0,in_port=2,vlan_tci=0x0000,dl_src=52:54:00:1c:ca:06,dl_dst=00:24:a5:c0:45:50 actions=output:1
cookie=0x20000000000000, duration=5.473s, table=0, n_packets=10, n_bytes=752, idle_timeout=5, idle_age=1, priority=0,in_port=1,vlan_tci=0x0000,dl_src=00:24:a5:c0:45:50,dl_dst=78:e7:d1:7f:84:b7 actions=LOCAL
#



# curl http://127.0.0.1:8080/wm/core/controller/switches/json
[{"harole":"MASTER","ports":[{"portNumber":1,"hardwareAddress":"78:e7:d1:7f:84:b7","name":"eth0","config":0,"state":0,"currentFeatures":520,"advertisedFeatures":3775,"supportedFeatures":703,"peerFeatures":0},{"portNumber":2,"hardwareAddress":"fe:54:00:1c:ca:06","name":"vnet0","config":0,"state":0,"currentFeatures":130,"advertisedFeatures":0,"supportedFeatures":0,"peerFeatures":0},{"portNumber":65534,"hardwareAddress":"78:e7:d1:7f:84:b7","name":"br0","config":0,"state":0,"currentFeatures":0,"advertisedFeatures":0,"supportedFeatures":0,"peerFeatures":0}],"buffers":256,"description":{"software":"1.10.2","hardware":"Open vSwitch","manufacturer":"Nicira, Inc.","serialNum":"None","datapath":"None"},"capabilities":199,"inetAddress":"/127.0.0.1:48743","connectedSince":1393260497136,"dpid":"00:00:78:e7:d1:7f:84:b7","actions":4095,"attributes":{"supportsOfppFlood":true,"supportsNxRole":true,"FastWildcards":4194303,"supportsOfppTable":true}}



flooglight logs
:# java -jar target/floodlight.jar
01:43:37.754 INFO [n.f.c.m.FloodlightModuleLoader:main] Loading default modules
01:43:38.359 INFO [n.f.c.i.Controller:main] Controller role set to MASTER
01:43:38.367 INFO [n.f.c.i.Controller:main] Flush switches on reconnect -- Disabled
01:43:47.280 INFO [n.f.l.i.LinkDiscoveryManager:main] Setting autoportfast feature to OFF
01:43:47.550 INFO [o.s.s.i.c.FallbackCCProvider:main] Cluster not yet configured; using fallback local configuration
01:43:47.551 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]
01:43:47.655 INFO [o.s.s.i.r.RPCService:main] Listening for internal floodlight RPC on localhost/127.0.0.1:6642
01:43:47.822 INFO [n.f.c.i.Controller:main] Listening for switch connections on 0.0.0.0/0.0.0.0:6633
01:43:51.980 INFO [n.f.j.JythonServer:debugserver-main] Starting DebugServer on :6655
01:48:16.102 INFO [n.f.c.i.OFChannelHandler:New I/O server worker #2-1] New switch connection from /127.0.0.1:48742
01:48:16.116 ERROR [n.f.c.i.OFChannelHandler:New I/O server worker #2-1] Disconnecting switch [/127.0.0.1:48742 DPID[?]] due to IO Error: Broken pipe
01:48:16.116 INFO [n.f.c.i.OFChannelHandler:New I/O server worker #2-1] Disconnected switch [/127.0.0.1:48742 DPID[?]]
01:48:17.099 INFO [n.f.c.i.OFChannelHandler:New I/O server worker #2-2] New switch connection from /127.0.0.1:48743
01:48:17.136 INFO [n.f.c.i.OFChannelHandler:New I/O server worker #2-2] Switch OFSwitchBase [/127.0.0.1:48743 DPID[00:00:78:e7:d1:7f:84:b7]] bound to class class net.floodlightcontroller.core.internal.OFSwitchImpl, writeThrottle=false, description Switch Desc - Vendor: Nicira, Inc.  Model: Open vSwitch  Make: None  Version: 1.10.2  S/N: None
01:48:17.140 INFO [n.f.c.OFSwitchBase:New I/O server worker #2-2] Clearing all flows on switch OFSwitchBase [/127.0.0.1:48743 DPID[00:00:78:e7:d1:7f:84:b7]]
01:48:17.144 WARN [n.f.c.i.C.s.notification:main] Switch 00:00:78:e7:d1:7f:84:b7 connected.





delete the controller


# ovs-vsctl del-controller br0


# ovs-vsctl show
41d09907-b8ac-4000-817c-41571e987aea
   Bridge "br0"
       Port "br0"
           Interface "br0"
               type: internal
       Port "vnet0"
           Interface "vnet0"
       Port "eth0"
           Interface "eth0"
   ovs_version: "1.10.2"



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.