3

I emulated a network topology using mininet. The topology contains two hosts connected by several switches. On host 1 we run a client application which creates a socket and tries to connect to the server application on host 2, it fails however. If I run the client- and server-script locally on one of the two hosts it connects with no problems.

server.py:

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('127.0.0.1', 10021))
s.listen(5)
while 1:
  (clientsocket, address) = s.accept()
  #DO STH.
clientsocket.close()

client.py:

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((args['ip'], 10021))
while 1:
  #DO STH.
s.close()

Here the code used to execute the commands to start the server and client application

topology.py:

server = net.getNodeByName('host2')
client = net.getNodeByName('host1')
server.cmd('./server.py & > serveroutput')
client.cmd('./client.py -i %serverIP > clientfile' % server.getIP())
max
  • 677
  • 1
  • 9
  • 34
  • 1
    All I have is that your connect script fails when connecting to host 2. What is the question? Why is it failing? In that case we need a bit more to go on. Errors for instance are...? – Mr. Concolato Dec 13 '14 at 13:05

2 Answers2

0

Are you using OVS openflow switches in your topology?

If they are openflow enabled, you need to have a SDN controller like Ryu or POX running too. The controller would create a path between the two hosts.

Right host 1 is trying to connect to host 2. Sends some TCP messages to the switch, but the switch doesn't know what to do with so it needs to ask a SDN controller for help. But there is no controller. So the connection failes.

If it was not openflow enabled switches it would have found its way to host 2.

So check if the switch is using openflow.

Ehsan Ab
  • 679
  • 5
  • 16
0

If you don't use a controller, you should configure the OVS's flow table and allow you data flow.Can you check the connectiong between two host using ping and iperf ?

li min
  • 1