tylertreat / comcast

Simulating shitty network connections so you can build better systems.
Apache License 2.0
10.3k stars 383 forks source link

Probablistically dropping outbound traffic is a poor simulation of packet loss. #67

Closed kportertx closed 10 months ago

kportertx commented 4 years ago

The kernel sends the client an eperm when tc or iptables drops a packet. In real packet loss, the client wouldn't be made immediately aware that the packet didn't reach its destination. The process I'm testing responds to eperm by closing down the socket and trying again on a new socket.

See https://www.spinics.net/lists/netfilter/msg42592.html.

I worked around this by rerouting the packet to a port, 9999, which hopefully isn't used - this solution probably isn't ideal here.

That said, if the intention is to run these scripts on a machine acting as a router then this isn't an issue.