noxrepo / pox

The POX network software platform
https://noxrepo.github.io/pox-doc/html/
Apache License 2.0
619 stars 470 forks source link

wget send two identical http requests packetin #252

Closed neethiRamaiah closed 2 years ago

neethiRamaiah commented 3 years ago

Hi murphy A single time run cmd "h1 wget -O - h2" generates two identical packetin packet at the same time [00:00:00:00:00:01>00:00:00:00:00:02 IP] [00:00:00:00:00:01>00:00:00:00:00:02 IP] #output of event.parse of both the packetin that has arrived at the same time

i am suppose to call a function for anyone of the packetin packet. an attempt of counting the number of packet has been futile because both the packet happen to take the same count number.

so please suggest me how i could differenciate it and only call fucntion for anyone and ignore the second packet

MurphyMc commented 3 years ago

First question is why there are two. Are both packet-ins coming from the same switch? Have you looked at the traffic with Wireshark or something to see if you could tell if there are actually two packets?

neethiRamaiah commented 3 years ago

ya had a look at wireshark , there is one http packet and two tcp protocol packet with port 80 as the destination as shown below. i am not sure how to obtaim only http specific packet

1 0.000000000 10.0.0.1 10.0.0.2 TCP 74 50376 → 80 [SYN] Seq=0 Win=42340 Len=0 MSS=1460 SACK_PERM=1 TSval=3792006818 TSecr=0 WS=512

2 0.029535730 10.0.0.2 10.0.0.1 TCP 74 80 → 50376 [SYN, ACK] Seq=0 Ack=1 Win=43440 Len=0 MSS=1460 SACK_PERM=1 TSval=1906848128 TSecr=3792006818 WS=512

3 0.029562923 10.0.0.1 10.0.0.2 TCP 66 50376 → 80 [ACK] Seq=1 Ack=1 Win=42496 Len=0 TSval=3792006847 TSecr=1906848128

4 0.030201649 10.0.0.1 10.0.0.2 HTTP 201 GET / HTTP/1.1

5 0.032185443 10.0.0.2 10.0.0.1 TCP 221 80 → 50376 [PSH, ACK] Seq=1 Ack=136 Win=43520 Len=155 TSval=1906848135 TSecr=3792006848 [TCP segment of a reassembled PDU]

6 0.032244318 10.0.0.1 10.0.0.2 TCP 66 50376 → 80 [ACK] Seq=136 Ack=156 Win=42496 Len=0 TSval=3792006850 TSecr=1906848135

7 0.032292438 10.0.0.2 10.0.0.1 TCP 1514 80 → 50376 [ACK] Seq=156 Ack=136 Win=43520 Len=1448 TSval=1906848136 TSecr=3792006848 [TCP segment of a reassembled PDU]

8 0.032342929 10.0.0.1 10.0.0.2 TCP 66 50376 → 80 [ACK] Seq=136 Ack=1604 Win=41984 Len=0 TSval=3792006850 TSecr=1906848136

9 0.032306424 10.0.0.2 10.0.0.1 HTTP 790 HTTP/1.0 200 OK (text/html)

10 0.033180727 10.0.0.1 10.0.0.2 TCP 66 50376 → 80 [FIN, ACK] Seq=136 Ack=2329 Win=42496 Len=0 TSval=3792006851 TSecr=1906848136

11 0.033211895 10.0.0.2 10.0.0.1 TCP 66 80 → 50376 [ACK] Seq=2329 Ack=137 Win=43520 Len=0 TSval=1906848137 TSecr=3792006851

12 0.033645497 10.0.0.2 10.0.0.1 TCP 66 80 → 50376 [ACK] Seq=1 Ack=136 Win=43520 Len=0 TSval=1906848134 TSecr=3792006848

On Fri, Oct 23, 2020 at 12:47 PM Murphy notifications@github.com wrote:

First question is why there are two. Are both packet-ins coming from the same switch? Have you looked at the traffic with Wireshark or something to see if you could tell if there are actually two packets?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/noxrepo/pox/issues/252#issuecomment-715556381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKT7IT5D6WETZ4FBDHVRA7LSMHMTLANCNFSM4S453VFA .

MurphyMc commented 3 years ago

It's been a while, but is the output you're showing above ("[00:00:00:00:00:01>00:00:00:00:00:02 IP]") from just doing like... print(event.parsed)? Try print(event.parsed.dump()).

neethiRamaiah commented 3 years ago

thanks murphy , problem solved, i put a counter in the function that was called so worked out thank you again

On Sat, Oct 24, 2020 at 1:30 AM Murphy notifications@github.com wrote:

It's been a while, but is the output you're showing above ("[00:00:00:00:00:01>00:00:00:00:00:02 IP]") from just doing like... print(event.parsed)? Try print(event.parsed.dump()).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/noxrepo/pox/issues/252#issuecomment-715881007, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKT7IT3D37RIC3UIQACGT3TSMKGDRANCNFSM4S453VFA .