Search code examples
socketspingscapymininet

Increased Rount Trip Time using Scapy


I have created a network topology such as H1 <-> S1 <-> S2 <-> H2 in Mininet. Where H are Hosts and S are Switches. The network has been created as follows enter image description here

I have set the delay in the network as 1ms. When I run Ping between H1 and H2, I get result such as follows, enter image description here

We can see that the RTT is approx. similar to topology.

If send a packet using Scapy from H1 to H2 using sendp(), the RTT is increasing. I am sending packet as followsenter image description here

If I use socket programming on the same network, then I get RTT = 2ms(approx.) I want to know what is going wrong with Scapy.


Solution

  • I don't think there is anything wrong here. You specified 1ms on your link, the RTT is when a packet comes and then comes back. So you have 1ms * 2 = 2ms. If you want to achieve 1ms RTT you have to specify a 0.5ms latency on the link.