In mininet, I was able to make a TCP connection between a server h1
and a host h4
in my custom POX controller c0
as the following:
h1.cmd('python -m SimpleHTTPServer 80 &')
thread.start_new_thread(tcp_thread, h4)
def tcp_thread(src):
for i in range(10):
src.cmd('wget -O - 10.0.0.1')
time.sleep(5)
h4
requests HTTP page from the server and keeps acknowledging the server normally based on TCP standard. Here, I want to be able to force h4
to send ACK
packets using another path between them. I don't have a problem with forwarding or making paths but I do have an issue with how to capture or extract Ack
packets before h4
sending them so I can forward them as I want.
Thank you.
If you have a PacketIn function you can add some lines of code to catch ACK flag
packet = event.parsed
tcp_found = packet.find('tcp')
if tcp_found:
if tcp_found.ACK:
print "ACK found"
# do your things
The ACK flag is a tcp attribute as stated in the POX wiki
TCP (tcp) Attributes: ...... FIN (bool) - True when FIN flag set ACK (bool) - True when ACK flag set ......
To get those attributes we assign the tcp part of the packet to a variable using the find method, then we access the attributes using a dot (.) ex.
variable.attribute
tcp_found.ACK