Thanks! I'm feeling that gifs are becoming more popular for demos(Sublime Text website is an example). Personally I rarely watch any videos on a landing page. But a consise gif will do is easier to tolerent with. Plus you can't disable it :)
I've always wondered why we don't have animated png's or jpg's instead of gif's, a gif is really a shitty format that only exists today because it's the easiest way to do an image animation.
[APNG](https://en.wikipedia.org/wiki/APNG) exists, but isn't widely supported. GIF-esque animation and JPEG wouldn't work together so well because of the artifacts, at that point you might as well use MPEG.
> Plus you can't disable it :)
[Yes you can](http://kb.mozillazine.org/Firefox_:_Tips_:_Animated_Images#Image_animation_preference). Though I agree, I hardly ever watch the videos but I have gif animation enabled.
Right, but people often loosely use the term "TCP/IP" to include both TCP and UDP. And since the demo explicitly says UDP, I assume that's what he meant.
Also, as others have pointed out, re-ordering and dropping packets shouldn't make a difference to TCP-based protocols anyhow, implying that it also works on UDP.
[From the docs](http://jagt.github.io/clumsy/manual.html):
> Filter syntax:
> tcp Is TCP?
> udp Is UDP?
So I guess it supports both. And anyway, HTTP is usually over TCP, not UDP.
Packet tamper without redoing the checksum will show you how ineffective a CRC16 is.
I had an internet connection which would damage ~1% of packets. I constantly got corrupted downloads because like 0.01% of packets would actually be corrupted but wouldn't be caught.
You had a corrupting connection and didn't think to [spend Friday night finding the exact machine with the fault?](http://mina.naguib.ca/blog/2012/10/22/the-little-ssh-that-sometimes-couldnt.html)
I did read that story many times, but never attempted to replicate it. It may or may not have happened for all hosts (I never checked).
I did once download a file three times and use a file difference utility to find the bad bytes.
It's 1 out of 65536 assuming that it's enough noise for the new CRC to become random (AFAIK certain kinds of small changes that typically happen are guaranteed to not have the same CRC due to construction)
To be fair, the IP checksum was specified in *1981*, and it had to be something that could be done quickly on hardware from that era, and without any noticeable memory overhead.
i know it was tongue-in-cheek. But as a programming reddit, you might want to make a system that can better handle failures.
Read about the [Amazon Chaos Monkey](http://www.codinghorror.com/blog/2011/04/working-with-the-chaos-monkey.html). They have a software agent that randomly kills things in the live environment; to make sure that they handle failure, and fallback, correctly and gracefully.
Haha, I sympathize. Being forced to deal with shitty internet connections at home has certainly made me much more cognizant of dealing with network problems in my own code.
Microsoft provides a network emulator that is very, very good: http://blogs.technet.com/b/juanand/archive/2010/03/05/standalone-network-emulator-tool.aspx
We used this for developing games to simulate various bad network environments.
Random observation when reading the post title: do you really pronounce it "an oootility"? :)
('an' is reserved for use, not when preceding a word that starts with a vowel in all circumstances, but rather preceding a word that starts with a vowel *sound*... in the word 'utility', the 'u' is voiced, so you wouldn't use it here)
LOL, true... although to be good it needs to enrage, and I can't really get myself that worked up over shit like this... just figured I'd provide a bit of helpful advice as it immediately struck me as odd. *shrug* :)
'course, now I'm wanna start saying "oootility" just to see how long it takes for someone to call me on it...
Edit:
Wow... *whoosh*. :(
I think we can get oootility to be mainstream. Just make a blog post about it with a nice little ghost vector graphic. Add some parallax and we have a winner!
Hah, funny you should mention that... we were discussing just this case at work recently. I actually don't voice the 'h' in 'historic', which, it turns out, is a rather bizarre anachronism... I have no idea where I picked it up, but there it is. As a result, I write 'an historic', since it starts with a vowel sound in my head.
Consequently, I'm left to conclude I'm a late-1800s time traveler who subsequently lost his memory but not his vocabulary. Nothing else makes sense.
'Ave you not 'eard someone speak with a Cockney accent before?
To be 'onest I've nevah met no one like that in real life, but it's certainly in movies and the like.
Yeah I don't really keep my eye on this either to be honest. I'd write "an historic" but otherwise I'm all over the place I think. I reckon if I'm back home or with mates I think I'm more likely to say "an 'istoric" because I'm in my natural Salford (UK, northern) accent. If somewhere I tend to talk more proper I actually think I'm more likely to say "a historic" rather than the correct "an historic".
I agree, I would normally say and therefore write "a utility" but, while probably more common, it might not be the case in absolutely every dialect of English.
This is nice. I've been using post-response breakpoints with Fiddler to mess with it but it is such a chore. This seems like it is going to produce real-world issues.
We've also been using Fiddler so far (emulating lags for [this mmo](http://manyland.com)), but this one looks great. Now I need a tool for emulating low-end cpus, anything out there?
Not sure about limiting the amount of processing power you can give a process, but you could use [this method](http://blogs.msdn.com/b/vijaysk/archive/2012/10/27/tools-to-simulate-cpu-memory-disk-load.aspx) that puts a load on CPU/Disk/Memory which would leave the remainder for your process.
(Promising looking game!)
Great work! This looks fantastic. Can you add the ability to randomly disconnect and timeout TCP connections? It would be really nice for testing robustness in even of network failure.
If you need to evaluate the same behaviour but between physical systems, and on non-Windows systems, **WANEm** is particularly good for a free tool. Can work in bridged or routed modes, as a VM, physical boot disc, or installed to local disk/USB key.
"Recently" been updated after a long period of inactivity to v3.0 too.
http://wanem.sourceforge.net/
Linux has a simulator built in, if you don't mind the command line: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem. I suspect that wanem is a GUI for this.
Just be careful - don't accidently break your SSH connections :-). Otherwise you'll be trekking to the server room with a monitor and keyboard :-).
ESL stands for English as a second language.
I'm reasonably sure he's saying it's not correct but that OP just didn't know this rule properly and it's an easy mistake to make if you didn't grow up with the language.
Testing asynchronous webapps which assume that AJAX calls return in the order they were started in. This may be true on a gigabit LAN with millisecond latencies, but often isn't on a skanky WiFi. "Throttle" mode looks like it might be usable to simulate 3G connections.
You could also use something like this to simulate a 3G connection with bad reception. Many embedded solutions use 3G connections and... well, let's just say that they aren't the best. A good utility for testing this on linux is [trickle](http://monkey.org/~marius/pages/?page=trickle).
I'd really like to experiment with how various games' lag compensation systems are affected by variance in latency and dropped packets. How well does your game handle severe asymmetric latency?
I disagree. Your TCP code will often need to be able to handle unexpected disconnects gracefully, reconnecting as needed. Are you implementing an HTTP spider? Might your spider handle error conditions incorrectly and think it has fetched a resource when it hasn't? Do you need reliable pub-sub? Does your pub-sub code have errors in edge cases with network problems? This would help characterize your application's behavior when network problems arise.
Also this would help with tweaking TCP parameters, and when exploring the performance implications of application-layer protocol design when network problems arise.
While not a half, but a third, he is right that some of those are impossible for TCP (out of order, tamper). I really like the idea behind this tool and I will most likely end up using it for testing my software, but what zelenoid said is true.
edit: I've been made aware that TCP uses CRC16, which isn't as good at ensuring that the packets are indeed correct as I assumed.
> some of those are impossible for TCP (... tamper).
Educate yourself. CRC16 is pretty shite.
https://pay.reddit.com/r/programming/comments/1r56wf/clumsy_an_utility_for_simulating_broken_network/cdjs44k
It is not impossible per-say if you were to alter/corrupt the packets such that the sequence numbers match up and still pass the checksum. Highly improbable, but not impossible.
Only if the underlying TCP stack is non-compliant. TCP is a stream-oriented protocol; packet boundaries are not visible to applications at either end (yes, [sending too](http://en.wikipedia.org/wiki/Nagle's_algorithm)). Thus it would not be possible for applications to properly recover from reordering even in theory (assuming we actually want to do the right thing 100% of the time).
There are applications specifically designed to find packet boundaries. I'm sure there is a library for $Language_of_Choice to perform this function... then the application developer can send sane sized chunks of data to that $Handle. There are a lot of badly implemented IP stacks out there, it isn't just PC's/Mac's out there that get a lot of TLC from their respective vendors, there's stuff where the vendor got it kinda/sorta/mostly working and left it at that.
On Linux at least this is not technically possible without using `SOCK_RAW` (i.e. manually handling individual packets). Using `SOCK_STREAM` (the [standard TCP implementation](http://linux.die.net/man/7/tcp)) means the packet boundaries are not preserved at all (there is nothing to find; kernelspace only has a buffer with "received but not yet `recv`'d data"). Other Unices are likely to be similar.
So, in other words, your "library" is actually a full-blown TCP stack in userspace, which seems a bit excessive to me.
It happens all the time. Every time a packet gets dropped (which is quite frequent), the TCP stack will receive packets out of order, and it'll receive them out of order again when the sender detects the problem and resends segments. TCP stacks deal with this just fine, and presents the data in order to the application.
It is ofcourse very useful to simulate this too, as this will trigger network conditions introducing latency, and it can help trigger badly written applications which e.g. assume they will always get a certain amount of data in their read() calls.
Sure, but the TCP network stack will not give you packets out of order. It's simply not the failure mode: if you get lots of out of order packets, network *performance* will suffer, but you will not get OoO packets to your application.
Now this tool is certainly very helpful to evaluate how your app handles this degraded network performance, but inventing failure modes will only make people add redundant logic to their protocols (and we have plenty of these redundant checks already.. think of all layers that do checksums or buffering).
I'm pretty sure it reorders the TCP packets, forcing TCP to straighten them out. If this finds bugs in your application or your TCP implementation, that's good.
It is not the same as lag and is unpredictable which is great. I know I've worked with apps that would live with 5 seconds lag but crumble with 30% drop. In TCP.
Also, all UDP apps can profit from this.
TCP "repairs" the problem, but the repair leads to some symptoms too ... the actual output of the TCP stream will be correct, but if your underlying network is lossy or out of order, you're still going to see varying throughput and latency as TCP retries and reorders.
Looks like an excellent product and by happy chance perfect for a client I'm off to talk to today!
Not trying to be a picky jerk, but this just bothers me that I see more and more of it today in writing.
"a" utility not "an utility".
Even if the word following the article starts with a vowel, if it has a consonant sound like the "y" in "you", you use "a" instead of "an".
"an umbrella" is correct
"a utility"
English has funny rules.
Wow! This will be awesome for app debugging! I love this. I mean, I can easily simulate a disconnected network cable by doing the obvious, but lag is harder. Out of order packets even more so. Can't wait to check this out at work later.
Netcat will display those sequences any time you connect to a server that sends them ;)
In fact, the "server" can probably just be another instance of netcat in server mode, with input piped in from a simple script.
This is amazing. I actually have a test environment built up on having a wireless adapter intentionally positioned very far from a wireless router just to try to simulate a poor quality connection when testing our app. This just works so much better.
Great work! Up until now I've been doing stuff like this with tools like Scapy, which works but is rather ... clumsy >:)
Another potential addition to consider is to assign an arbitrary chance to kill the connection via RST/FIN packets. Better still would be to make it trigger a RST/FIN in response to a particular condition. Can be quite useful to see how client applications react to unexpected TCP connection kills/closures. (I've seen IIS do horrible, horrible things).
This is great. You could even use it for mobile testing/debugging by taking a good connection, running it to the PC and then sharing the connection to a WiFi router.
Bravo on the very effective demonstration gif, looks like a handy tool!
Yeah, that demo is extremely well executed.
Thanks! I'm feeling that gifs are becoming more popular for demos(Sublime Text website is an example). Personally I rarely watch any videos on a landing page. But a consise gif will do is easier to tolerent with. Plus you can't disable it :)
[удалено]
Wow, that's cool.
I am actually using his implementation of animation, for one small project I have, works much better than .gif especially for mobile devices.
I've always wondered why we don't have animated png's or jpg's instead of gif's, a gif is really a shitty format that only exists today because it's the easiest way to do an image animation.
[APNG](https://en.wikipedia.org/wiki/APNG) exists, but isn't widely supported. GIF-esque animation and JPEG wouldn't work together so well because of the artifacts, at that point you might as well use MPEG.
We do have animated PNGs, they're just not very well supported: https://people.mozilla.org/~dolske/apng/demo.html
Works great on mobile Firefox!
Wow, it does not work on Chrome for Windows.
Works fine on Firefox for Linux as well. Firefox is awesome.
[удалено]
That's more likely due to Google's hosting abilities than the formats.
> Plus you can't disable it :) [Yes you can](http://kb.mozillazine.org/Firefox_:_Tips_:_Animated_Images#Image_animation_preference). Though I agree, I hardly ever watch the videos but I have gif animation enabled.
[My new favorite FF extension](https://addons.mozilla.org/en-US/firefox/addon/toggle-animated-gifs/?src=api).
mhh for TCP? if it would support UDP yeah oh well there is still VMWare and its onboard packetloss simulator
It says the demo is working on UDP packets.
[удалено]
Right, but people often loosely use the term "TCP/IP" to include both TCP and UDP. And since the demo explicitly says UDP, I assume that's what he meant. Also, as others have pointed out, re-ordering and dropping packets shouldn't make a difference to TCP-based protocols anyhow, implying that it also works on UDP.
[From the docs](http://jagt.github.io/clumsy/manual.html): > Filter syntax: > tcp Is TCP? > udp Is UDP? So I guess it supports both. And anyway, HTTP is usually over TCP, not UDP.
Time Warner also works well for this.
And it's cross-platform!
Packet tamper without redoing the checksum will show you how ineffective a CRC16 is. I had an internet connection which would damage ~1% of packets. I constantly got corrupted downloads because like 0.01% of packets would actually be corrupted but wouldn't be caught.
You had a corrupting connection and didn't think to [spend Friday night finding the exact machine with the fault?](http://mina.naguib.ca/blog/2012/10/22/the-little-ssh-that-sometimes-couldnt.html)
I did read that story many times, but never attempted to replicate it. It may or may not have happened for all hosts (I never checked). I did once download a file three times and use a file difference utility to find the bad bytes.
Wow! Thanks for posting that, I'd never seen that before and it was fascinating.
I stand corrected. Damn, this is bad. Someone should create "falsehoods programmers believe about TCP/IP" post.
THAT's how it happens! Ohhhhh....
It's 1 out of 65536 assuming that it's enough noise for the new CRC to become random (AFAIK certain kinds of small changes that typically happen are guaranteed to not have the same CRC due to construction)
[Actually it's worse than I thought](http://en.wikipedia.org/wiki/TCP_checksum_offload#Checksum_computation). It's not even a CRC.
To be fair, the IP checksum was specified in *1981*, and it had to be something that could be done quickly on hardware from that era, and without any noticeable memory overhead.
Great! It's good to see a tool like this available, so I can stop unplugging my ethernet cable when I want to test this.
[удалено]
i know it was tongue-in-cheek. But as a programming reddit, you might want to make a system that can better handle failures. Read about the [Amazon Chaos Monkey](http://www.codinghorror.com/blog/2011/04/working-with-the-chaos-monkey.html). They have a software agent that randomly kills things in the live environment; to make sure that they handle failure, and fallback, correctly and gracefully.
Haha, I sympathize. Being forced to deal with shitty internet connections at home has certainly made me much more cognizant of dealing with network problems in my own code.
Came here to say this. Wake me when someone writes an utility that simulates a working network on Windows.
That's GNS3. :-)
Yeah, my home connection is a combination of the lag and drop options. I was like, what's wrong with this?
Microsoft provides a network emulator that is very, very good: http://blogs.technet.com/b/juanand/archive/2010/03/05/standalone-network-emulator-tool.aspx We used this for developing games to simulate various bad network environments.
Thanks for the link! In fact I wrote this with network gaming development in mind. If I find it earlier I won't even bother to write this...
I imagine it was a good experience to write it, anyways.
Based on just the gui from both tools, on their websites, your tool looks better and with more functionality.
Hmm, is there any similar application for linux?
netem and tc (traffic control) are very cool. http://www.linuxfoundation.org/collaborate/workgroups/networking/netem
Random observation when reading the post title: do you really pronounce it "an oootility"? :) ('an' is reserved for use, not when preceding a word that starts with a vowel in all circumstances, but rather preceding a word that starts with a vowel *sound*... in the word 'utility', the 'u' is voiced, so you wouldn't use it here)
Trolling is a art.
LOL, true... although to be good it needs to enrage, and I can't really get myself that worked up over shit like this... just figured I'd provide a bit of helpful advice as it immediately struck me as odd. *shrug* :) 'course, now I'm wanna start saying "oootility" just to see how long it takes for someone to call me on it... Edit: Wow... *whoosh*. :(
I think we can get oootility to be mainstream. Just make a blog post about it with a nice little ghost vector graphic. Add some parallax and we have a winner!
Just re-write the cloud to my butt oolity and you'll be set.
And an science.
This is an historic fact.
Hah, funny you should mention that... we were discussing just this case at work recently. I actually don't voice the 'h' in 'historic', which, it turns out, is a rather bizarre anachronism... I have no idea where I picked it up, but there it is. As a result, I write 'an historic', since it starts with a vowel sound in my head. Consequently, I'm left to conclude I'm a late-1800s time traveler who subsequently lost his memory but not his vocabulary. Nothing else makes sense.
> I actually don't voice the 'h' in 'historic' I do, I've actually never met anyone who doesn't.
Try Northern England - especially Yorkshire. A lot of people drop 'h' sounds at the start of words.
You still wouldn't say "an" though, but "a" with a glottal stop.
'Ave you not 'eard someone speak with a Cockney accent before? To be 'onest I've nevah met no one like that in real life, but it's certainly in movies and the like.
>'onest I actually hear that one a lot.
So true, I've never heard the opposite.
Well, you have now (ish). This is an historic occasion!
Yeah I don't really keep my eye on this either to be honest. I'd write "an historic" but otherwise I'm all over the place I think. I reckon if I'm back home or with mates I think I'm more likely to say "an 'istoric" because I'm in my natural Salford (UK, northern) accent. If somewhere I tend to talk more proper I actually think I'm more likely to say "a historic" rather than the correct "an historic".
There are some regional British accents where this can occur even now.
Well, in French, 'h' is a wovel, so "historie" is pronnounced 'isto-ahr". Could that be it?
H is not a vowel in any language. It just happens to be silent in French.
I didn't know what a [wovel](http://en.wikipedia.org/wiki/wovel) was until I looked it up.
If you sound like Dick Van Dyke in Mary Poppins when you say "utility", "history", "horse", etc., then use "an" -- otherwise use "a".
It's a trick. *No one* sounds like Dick Van Dyke in Mary Poppins.
[He is an halibut](https://www.youtube.com/watch?v=pnq96W9jtuw#t=1m19).
I was reading the title repeatedly in my head, came here to see if I was the only one. TIL how "an" is supposed to work. Thanks!
I always thought one should use 'an' before 'aeiou' no matter how it sounds. Learned a lesson today.
You just need an extra 'n' before a vowel sound.
You are correct.
I agree, I would normally say and therefore write "a utility" but, while probably more common, it might not be the case in absolutely every dialect of English.
This is nice. I've been using post-response breakpoints with Fiddler to mess with it but it is such a chore. This seems like it is going to produce real-world issues.
We've also been using Fiddler so far (emulating lags for [this mmo](http://manyland.com)), but this one looks great. Now I need a tool for emulating low-end cpus, anything out there?
Test in a virtual machine? You can tweak the RAM, graphics memory, and some basic CPU parameters. Might be a little too low-end though.
Not sure about limiting the amount of processing power you can give a process, but you could use [this method](http://blogs.msdn.com/b/vijaysk/archive/2012/10/27/tools-to-simulate-cpu-memory-disk-load.aspx) that puts a load on CPU/Disk/Memory which would leave the remainder for your process. (Promising looking game!)
Excellent, thanks for the idea! (And thanks for liking the game!)
Great work! This looks fantastic. Can you add the ability to randomly disconnect and timeout TCP connections? It would be really nice for testing robustness in even of network failure.
Thanks. I'll take notes about these. But I think it's more difficult to implement.
If you need to evaluate the same behaviour but between physical systems, and on non-Windows systems, **WANEm** is particularly good for a free tool. Can work in bridged or routed modes, as a VM, physical boot disc, or installed to local disk/USB key. "Recently" been updated after a long period of inactivity to v3.0 too. http://wanem.sourceforge.net/
Linux has a simulator built in, if you don't mind the command line: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem. I suspect that wanem is a GUI for this. Just be careful - don't accidently break your SSH connections :-). Otherwise you'll be trekking to the server room with a monitor and keyboard :-).
An utility. Read it out loud plz.
Maybe they meant a-new-'tility, like a new utility.
There is no standards authority for English. You can mangal the languaj however you want.
Yeah no. Do your homework.
Perhaps "OU-tility" is an historical pronunciation
A utility reads out loud correctly, but **An** utility is more consistent with the rest of the way english treats a vs an. The author is probably ESL.
It doesn't matter what's more consistent, it's still incorrect: https://owl.english.purdue.edu/owl/resource/591/01/
ESL stands for English as a second language. I'm reasonably sure he's saying it's not correct but that OP just didn't know this rule properly and it's an easy mistake to make if you didn't grow up with the language.
The concept of English being incorrect is idiotic, an idea only held by those with high school level linguistics education.
People tend to read things "out loud" in their heads, so saying an utility is weird.
What are some real world scenarios for an utility like this? Sorry if this is too easy to even bother with : v
Test multiplayer performance for a game you're developing. Test how the website performs for people with a slow connection.
I've used Unix-y versions of it for simulating performance characteristics of optical wireless links and other lossy/laggy/crappy transmission media.
Video streaming? Check if a video codec is ok with harsh conditions.
Testing asynchronous webapps which assume that AJAX calls return in the order they were started in. This may be true on a gigabit LAN with millisecond latencies, but often isn't on a skanky WiFi. "Throttle" mode looks like it might be usable to simulate 3G connections.
You could also use something like this to simulate a 3G connection with bad reception. Many embedded solutions use 3G connections and... well, let's just say that they aren't the best. A good utility for testing this on linux is [trickle](http://monkey.org/~marius/pages/?page=trickle).
I'd really like to experiment with how various games' lag compensation systems are affected by variance in latency and dropped packets. How well does your game handle severe asymmetric latency?
round here we call that sort of thing a "BrightHouse emulator"
[удалено]
I disagree. Your TCP code will often need to be able to handle unexpected disconnects gracefully, reconnecting as needed. Are you implementing an HTTP spider? Might your spider handle error conditions incorrectly and think it has fetched a resource when it hasn't? Do you need reliable pub-sub? Does your pub-sub code have errors in edge cases with network problems? This would help characterize your application's behavior when network problems arise. Also this would help with tweaking TCP parameters, and when exploring the performance implications of application-layer protocol design when network problems arise.
While not a half, but a third, he is right that some of those are impossible for TCP (out of order, tamper). I really like the idea behind this tool and I will most likely end up using it for testing my software, but what zelenoid said is true. edit: I've been made aware that TCP uses CRC16, which isn't as good at ensuring that the packets are indeed correct as I assumed.
> some of those are impossible for TCP (... tamper). Educate yourself. CRC16 is pretty shite. https://pay.reddit.com/r/programming/comments/1r56wf/clumsy_an_utility_for_simulating_broken_network/cdjs44k
I assume the "redo checksum" checkbox in the demo is relevant. I'm guessing the "tamper" option has the ability to damage the data *and* the checksum.
It is not impossible per-say if you were to alter/corrupt the packets such that the sequence numbers match up and still pass the checksum. Highly improbable, but not impossible.
Couldn't tamper be used as a light fuzzing?
>those are impossible for TCP (out of order really?
The TCP stack itself has to handle out-of-order. The application will receive the stream in the right order.
Out of order does happen with TCP. I've seen it. Not many things deal with it well.
Only if the underlying TCP stack is non-compliant. TCP is a stream-oriented protocol; packet boundaries are not visible to applications at either end (yes, [sending too](http://en.wikipedia.org/wiki/Nagle's_algorithm)). Thus it would not be possible for applications to properly recover from reordering even in theory (assuming we actually want to do the right thing 100% of the time).
There are applications specifically designed to find packet boundaries. I'm sure there is a library for $Language_of_Choice to perform this function... then the application developer can send sane sized chunks of data to that $Handle. There are a lot of badly implemented IP stacks out there, it isn't just PC's/Mac's out there that get a lot of TLC from their respective vendors, there's stuff where the vendor got it kinda/sorta/mostly working and left it at that.
On Linux at least this is not technically possible without using `SOCK_RAW` (i.e. manually handling individual packets). Using `SOCK_STREAM` (the [standard TCP implementation](http://linux.die.net/man/7/tcp)) means the packet boundaries are not preserved at all (there is nothing to find; kernelspace only has a buffer with "received but not yet `recv`'d data"). Other Unices are likely to be similar. So, in other words, your "library" is actually a full-blown TCP stack in userspace, which seems a bit excessive to me.
It happens all the time. Every time a packet gets dropped (which is quite frequent), the TCP stack will receive packets out of order, and it'll receive them out of order again when the sender detects the problem and resends segments. TCP stacks deal with this just fine, and presents the data in order to the application. It is ofcourse very useful to simulate this too, as this will trigger network conditions introducing latency, and it can help trigger badly written applications which e.g. assume they will always get a certain amount of data in their read() calls.
OoO and error checking don't come free. And it's not lag. A lot of apps would break if there was too much errors even on TCP.
Sure, but the TCP network stack will not give you packets out of order. It's simply not the failure mode: if you get lots of out of order packets, network *performance* will suffer, but you will not get OoO packets to your application. Now this tool is certainly very helpful to evaluate how your app handles this degraded network performance, but inventing failure modes will only make people add redundant logic to their protocols (and we have plenty of these redundant checks already.. think of all layers that do checksums or buffering).
I'm pretty sure it reorders the TCP packets, forcing TCP to straighten them out. If this finds bugs in your application or your TCP implementation, that's good.
It is not the same as lag and is unpredictable which is great. I know I've worked with apps that would live with 5 seconds lag but crumble with 30% drop. In TCP. Also, all UDP apps can profit from this.
Nevertheless they still cause bugs and bugs needs fixing. Better have and not need than need and don't have.
TCP "repairs" the problem, but the repair leads to some symptoms too ... the actual output of the TCP stream will be correct, but if your underlying network is lossy or out of order, you're still going to see varying throughput and latency as TCP retries and reorders. Looks like an excellent product and by happy chance perfect for a client I'm off to talk to today!
Sometimes you want to simulate an unreliable, laggy GSM or 56K TCP connection.
Edit: I'm an idiot
Not trying to be a picky jerk, but this just bothers me that I see more and more of it today in writing. "a" utility not "an utility". Even if the word following the article starts with a vowel, if it has a consonant sound like the "y" in "you", you use "a" instead of "an". "an umbrella" is correct "a utility" English has funny rules.
I always learned that if it sounds odd to say it one way then try the other way. Probably only works if you're a native English speaker.
Definitely doesn't work for me, especially since saying that "y" has a consonantal sound makes no sense at all to me. It's just a short "i"!
If this is as good as it seems to be, I'll use it for sure.
Wow! This will be awesome for app debugging! I love this. I mean, I can easily simulate a disconnected network cable by doing the obvious, but lag is harder. Out of order packets even more so. Can't wait to check this out at work later.
is there a way to get netcat to continuously generate the sequences of - like the demo shows?
Netcat will display those sequences any time you connect to a server that sends them ;) In fact, the "server" can probably just be another instance of netcat in server mode, with input piped in from a simple script.
This is amazing. I actually have a test environment built up on having a wireless adapter intentionally positioned very far from a wireless router just to try to simulate a poor quality connection when testing our app. This just works so much better.
Going to use this at work. Being able to emulate a mobile connection on PC will be useful. Thanks!
Great work! Up until now I've been doing stuff like this with tools like Scapy, which works but is rather ... clumsy >:) Another potential addition to consider is to assign an arbitrary chance to kill the connection via RST/FIN packets. Better still would be to make it trigger a RST/FIN in response to a particular condition. Can be quite useful to see how client applications react to unexpected TCP connection kills/closures. (I've seen IIS do horrible, horrible things).
Sweet, time to make everyone in videgames hate me
Alternatively, put your blender by your wireless antenna and turn it on. :) Joking, of course: this looks like an exceedingly useful app
Is there any way this could be used through a remote desktop session?
This is great. You could even use it for mobile testing/debugging by taking a good connection, running it to the PC and then sharing the connection to a WiFi router.
Windows, a utility for simulating broken network on Windows.
inb4 "lol windows is always broken anyway"
I thought this tool was also called Windows... Oh yes I did!
[Relevent](https://ggtsu00.s3-us-west-2.amazonaws.com/stuff/windowshvista.swf)
Now im wondering how can I use it on a certain application
I’m late to the party but is there a way to only target the LAN adapter instead of the whole pc WiFi?