I'm aware of two projects that might fit your needs:

https://github.com/tylertreat/Comcast calls out iptables or ipfw or 
otherwise depending on the underlying OS "to simulate common network 
problems like latency, bandwidth restrictions, and 
dropped/reordered/corrupted packets."

https://github.com/shopify/toxiproxy is "A TCP proxy to simulate network 
and system conditions for chaos and resiliency testing".

Toxiproxy is probably closer to what you're looking for, but I haven't used 
it personally. It seems to be written in Go so they may expose something 
akin to net.Pipe.

On Thursday, May 4, 2017 at 2:46:43 AM UTC-7, Chris Hopkins wrote:
>
> Hi,
> Before I re-invent the wheel:
> We've (all) used net.Pipe to model a network connection in testbenches. 
> For my purposes it would be handy if I had one that was more realistic. 
> i.e. it dropped some packets and re-ordered some, maybe even duplicated a 
> few, added (random) delays to sending etc.
> Now it doesn't have to be realistic from a benchmarking perspective, it 
> would just be good to make sure my application can cope with the sort of 
> nonsense a real application does.
>
> Does such a thing already exist?
>
> I mocked up a rough attempt at one based on net.Pipe, but the issue seemed 
> to be that I had visibility of io.Writer/Reader calls. This meant that I 
> couldn't guarantee that one call to the UnreliablePipe corresponded to one 
> packet. In fact what seemed to be happening was that I often got a fragment 
> of a packet as the Writer broke up the packet into multiple calls(This 
> might be an artefact of how I was structuring the buffers, needs debugging).
> As I say before I go too far down this particular rabbit hole I thought I 
> should ask if anyone is aware of solving this problem already.
>
> Any thoughts?
>
> Many Thanks
>
> Chris
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to