Jump to content
  • Advertisement
Sign in to follow this  
gcs584

Error Correction

This topic is 5389 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, As of late, I've been looking into the theory behind networking. I haven't given it much of a go on the actual programming side; although, I reckon that I'll start to touch that a bit later on (next summer). A random thought hit my head. How is error correction handled upon the receipt of a packet? I expect errors to exist especially since data is being transferred amidst the "outside world". Do errors in packets in fact occur? I do realize that in fact if it did occur it would not be frequent, but if you're tackling a FPS this would affect the game upon serveral million packet transfers. So... Do errors in packets occur? If so, who/what handles the errors? (Operating System, Winsock) Are errors even handled? I know that memory now exists as being Error Correction Coded (ECC). What about networks? If anyone could shine a light on my topic that would be great. This one might be for 'hplus' though. Later, GCS584

Share this post


Link to post
Share on other sites
Advertisement
Error detection is done at a lot of networking levels, most importantly there's always a 16-bit checksum in all TCP and UDP packets.

TCP handles error correction by resending invalid/lost packets until the receiver sends back an acknowledgement.
UDP (which most games use) doesn't do any error correction at all, and most games doesn't need any (see Quake3's networking model for a simple yet elegant example). If a packet is lost the client just moves on and hopes that the next one gets through.

Share this post


Link to post
Share on other sites
Note that you, as a user, don't see the error packets; they are simply dropped as if transmission never happened. The sending side can then re-transmit if it chooses to. TCP implements automatic re-transmission; UDP doesn't.

Share this post


Link to post
Share on other sites

Thanks for your help fellas!

I thought correct. I thought that UDP would drop the packets since it's connectionless, and it would wait for the next packet which would be errorless (in all probability). I know in a number 1-way communication systems they use the even parity method where there's a hamming distance of 2. They'll just drop the packet if it has an error.

I wasn't at all sure how TCP would be handled since it's connection-oriented (if the packet would be resent or an attempt would be made to correct the error).

Anyways, I thank you both for your help. I'll probaly be back for another question.

Until then,

GCS584

Share this post


Link to post
Share on other sites
If you want more information on networking then look up the Open Systems Interconnection specification. You'll see that UDP, TCP/IP is only the tip of the iceberg and although they don't provide any error detection / correction, the lower levels in the system might (layer 2, most likely).

As for error detection / correction, Hamming Codes is a good place to start. The only problem with doing your own system on top of the networking protocols that already exist is that it will only work on data you actually receive and will require extra processing. Data that is lost or is out of sequence needs to be catered for separately - as someone else posted, the Quake networking model is a good place to start. Also, it does depend on whether or not the data in the missing packets is critical or not, that is, can the system make an assumption about the lost packet that can be corrected with subsequent packets.

Skizz

Share this post


Link to post
Share on other sites
Your concerns would have been valid if the old networking cards (10-Base-T and IBM Token Ring) were still the prevalent. With those 2-wires types, there was always the risk of collision when there was a lot of active connections on the same cable. Nowadays, we use direct connections with routers and hubs that simply discard packets when there is too much traffic; you either get the full packet or you don't.

-cb

Share this post


Link to post
Share on other sites

Yeah, thanks fellas...

Skizz, I have heard about the OSI model, but I haven't really looked into that. That's probaly where I'll venture off next.

I am currently pursuing my BSc in Computer Science, and I'd like to focus on the networking side. Do you think it would be better to have a Computer Engineering degree if I was wanting to go into lower levels of networking like PPP and ATM (I don't know a lower level ).

doynax, thanks for the Quake link. That's pretty good stuff!

Later,

GCS584

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!