Does Scapy bypass Dummynet (IPFW in general)?
It really looks like it does. I'm adding a large extra delay to each outgoing and incoming packet, and everything slows down apart from packets sent with Scapy.
$ ipfw add pipe 1 from any to any
$ ipfw pipe 1 config delay 500ms
$ ping www.google.com
PING www.l.google.com (173.194.34.18) 56(84) bytes of data.
64 bytes from par03s02-in-f18.1e100.net (173.194.34.18): icmp_req=1 ttl=54 time=1011 ms
64 bytes from par03s02-in-f18.1e100.net (173.194.34.18): icmp_req=2 ttl=54 time=1010 ms
So it seems OK. But as soon as I send packets with Scapy, here's what happens:
>>> from scapy.all import *
>>> p = IP(dst="www.google.com", ttl=1) / TCP(sport=222, dport=2999)
>>> ans,unans = sr(p*3)
>>> ans[0][1].time - ans[0][0].sent_time
0.0002701282501220703 #usual value for such RTT
Is there any way to force it to pass through dummynet?
EDIT If only I had another machine at my disposal, I could use dummynet there and direct all my traffic to it, before it gets into the Internet. I would prefer to do everything locally, though.
The author of Scapy replied to me in Scapy's mailing list:
It worked! Here's the paragraph from the above link :