Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  UDP checksums?  (Read 2007 times)
0 Members and 1 Guest are viewing this topic.
Offline davidaprice

Junior Member





« Posted 2003-08-26 07:14:18 »

According to Java Network Programming, UDP's data checksum feature is "optional and not used in or accessible from application layer programs". Since it's optional and I can't tell whether it was used, isn't an invisibly optional checksum no better than no checksum at all, from my program's point of view? What's your experience: do you include your own application-level checksums in UDP packets? Are you seeing any corrupted packets?

Thanks,
David
Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #1 - Posted 2003-08-26 07:42:18 »

Wouldn't UDP packets with incorrect checksums be dropped at the transport layer, and hence we'd never see them?

e.g. if you recieve a packet from the far side in UDP you can guarantee that the data is intact. This would mean you wouldn't need to include checksums at the application layer.

I could be wrong, but I thought this was how it worked.

Kev

Offline davidaprice

Junior Member





« Reply #2 - Posted 2003-08-26 08:14:39 »

That's what I thought too, but if checksums are optional, then maybe the sender's transport layer didn't use them and hence you can't be sure your data's not corrupted. To be able to rely on corrupted packets being dropped, you'd need to be sure that the sender's transport layer uses the optional checksums. This could be especially tricky if the sender is a MIDP 2.0-enabled mobile phone: it's very hard to find out about their UDP protocol implementations.

I hope I'm missing something here...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #3 - Posted 2003-08-26 08:23:26 »

I don't think it'd be a Java issue really, more a platform issue. If their passing data backup to the application layer that could potentially be corrupted the implementation doesn't match what UDP is meant to do.

I'm not saying this isn't the case, but that if it is you'd need to take it up with the hardware/platform manufacturer.

On PC type hardware I've never recieved any corrupted packets, but I think thats the contract between UDP and the application layer.

Kev

Offline davidaprice

Junior Member





« Reply #4 - Posted 2003-08-26 09:21:50 »

A little Googling turns up that SunOS at least used to have UDP checksums switched off to speed up its NFS implementation. However, RFC 1122 'Requirements for Internet Hosts' says that they must default to being on, so maybe the problem no longer exists. My general impression is that you're only supposed to switch it off when using highly reliable networks (and typically LANs), but that protocol implementors have been somewhat inconsistent about this in the past. The Wikipedia entry on UDP says that UDP checksums are "almost always used in practice", and that matches what an hour or so of Google-research turned up.

Oh well, I'll just assume for now that it's always used, but keep this in mind if I get puzzling bugs...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (108 views)
2013-05-17 21:29:12

alaslipknot (117 views)
2013-05-16 21:24:48

gouessej (146 views)
2013-05-16 00:53:38

gouessej (141 views)
2013-05-16 00:17:58

theagentd (154 views)
2013-05-15 15:01:13

theagentd (138 views)
2013-05-15 15:00:54

StreetDoggy (182 views)
2013-05-14 15:56:26

kutucuk (206 views)
2013-05-12 17:10:36

kutucuk (205 views)
2013-05-12 15:36:09

UnluckyDevil (212 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.085 seconds with 21 queries.