1
votes

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).

1

1 Answers

0
votes
  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.