1

I have a small python program which acts like a virtual switch. Now I want to integrate it so that it could be controlled by a openflow controller POX.

  1. I am wondering how would I exchange msg between switch and POX? Do I create a socket and bind it to port 6633(default port POX runs on) and send all the further openflow packets using that socket? How could I "connect" to pox.

  2. What packets I need to send to build and maintain the connection? I receive INFO:openflow.of_01:[None 1] closed
    INFO:openflow.of_01:[None 2] closed
    ...
    every time I sent a openflow packet.

  3. how to test my switch without configuring the controller? (lets say i have several switches connecting to one controller, and I wish that they could communicate with each other).

Chi
  • 55
  • 9

1 Answers1

0
  1. Unless specified otherwise POX is running on the TCP port 6633 (once it is running, you can check with netstat -tnlp | grep python on linux). You need to open a socket from you virtual switch to that port:

    controllerIpAddr = "127.0.0.1"
    controllerPort = "6633"
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((controllerIpAddr, controllerPort))
    

    Then you use that socket for your Openflow traffic

  2. I don't really understand that question but if you're asking how to test your switch without configuring OpenFlow I recommend using learning switches: ./pox.py forwarding.l2_learning.

CaptainCap
  • 334
  • 2
  • 13
  • For Q.2 I think you get what i was asking. So my switch need to :1. send initiate openflow packet 2. process the pkt from controller.(manage flowtable). and the learning switch will do the routing and reply the request from my switch without and configuration? I will check the openflow protocol to determine the details of the packet i need to send from my switch then. Thank you. – Chi May 20 '15 at 01:53