Changes between Version 10 and Version 11 of Internal/OpenFlow/Notes


Ignore:
Timestamp:
Aug 5, 2009, 12:57:06 AM (15 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/Notes

    v10 v11  
    216216 * when creating a socket in Ruby you need a port number, but it is a passive connection (ptcp) - the port can be anything
    217217 * pick apart either OF reference system or NOX for handshake code
     218
     219=== picking at OFP (8/4) ===
     220!OpenFlow data structure is defined under /include/openflow/openflow.h .
     221
     222Whether it is NOX or the !Openflow Regression Suite it is all in lots of C. Trying to make Ruby work with C seemed a bit too messy for our own good, so we sent an email to the NOX developer's mailing list in hopes of some elucidation of how to create a Ruby interface to !OpenFlow, instead of Python (which is what NOX does, as described [http://noxrepo.org/wp/?page_id=2 here])
     223
     224==== some experimentation with Ruby sockets ====
     225
     226The switch will keep trying to contact a controller, regardless of whether the controller is active. This happens once every 15 seconds or so, and can be seen with a very simple script that listens on TCP 6633 (the default !OpenFlow port) on the console's !OpenFlow VLAN interface, which has the IP address 172.16.100.1:
     227
     228{{{
     229#!/usr/bin/ruby -w
     230require 'socket'
     231
     232# allow the switch to try to establish a connection
     233ofpsock = TCPserver.new("172.16.100.1", 6633)
     234
     235#listen to see what port the switch is using
     236while (session = ofpsock.accept)
     237        t = Time.now   # to see interval of messages
     238        peer = session.peeraddr
     239        puts "#{peer[1]}  #{peer[2]}    #{t.to_s.split[3]}"
     240session.close
     241end
     242
     243
     244}}}
     245
     246You get:
     247{{{
     24855354   172.16.100.10     20:53:22
     24955353   172.16.100.10     20:53:37
     25055352   172.16.100.10     20:53:52
     25155351   172.16.100.10     20:54:07
     252...
     253}}}
     254
     255The first column shows the switch's port. 172.16.100.10 is the vlan interface IP address for the Openflow VLAN on the switch, so you know it is the !OpenFlow switch trying to establish a connection with the controller. To be honest it's not clear if the timestamps would reflect the speed of the code or the activity of the switch.
     256
     257
    218258 
    219259