![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2007
Posts: 10
Rep Power: 0
![]() |
udp checksum
Hi,
I'm trying to add some reliabilty over UDP, but I'm a bit confused over its use of checksum. UDP implements a checksum, right? If so, how can I use it to add some reliability in case of error in the packet? Should I implement my own checksum? Thanks! |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Re: udp checksum
Stop. Read. Think. Discriminate.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Re: udp checksum
You don't have to worry about it. If there's an error in the packet, it will be dropped silently. As if it hadn't arrived. What you have to worry about is making sure a clean copy arrives eventually, if necessary. If you are sending regular position/velocity updates for a game, there's no need to waste time resending old data (which is why TCP typically isn't used in these scenarios). If you send something which must arrive, things are more difficult. It can be as easy as retransmitting until the target sends a confirmation (confirmation retransmitted for each request received; each side would have to ignore duplicates). TCP does a great job when all of your data needs to be arrive and in the right order. UDP does a great job when the concern is immediacy. A simple reliability layer on UDP is very common for the 'important' stuff that fits somewhere in between.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sockets problem | haba | C | 10 | Nov 19th, 2007 2:03 AM |
| Packet Sniffer - extracting payload from TCP header | Brent | C | 2 | Sep 22nd, 2007 11:28 PM |
| HELP! "field has incomplete type" | TaviO! | C | 6 | Apr 24th, 2006 4:05 PM |
| Backup Script :-) | Pizentios | Perl | 18 | Jan 12th, 2006 10:50 AM |
| Converting ANSI characters to hex for Checksum. | JawaKing00 | C | 4 | Sep 9th, 2005 5:07 AM |