Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (602)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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 3259 times)
0 Members and 1 Guest are viewing this topic.
Offline davidaprice

Junior Devvie

« Posted 2003-08-26 05: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?

Offline kevglass

« JGO Spiffy Duke »

Medals: 272
Projects: 25
Exp: 18 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #1 - Posted 2003-08-26 05: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.


Offline davidaprice

Junior Devvie

« Reply #2 - Posted 2003-08-26 06: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

« JGO Spiffy Duke »

Medals: 272
Projects: 25
Exp: 18 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #3 - Posted 2003-08-26 06: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.


Offline davidaprice

Junior Devvie

« Reply #4 - Posted 2003-08-26 07: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.

Jesse (14 views)
2015-07-29 04:35:27

Riven (36 views)
2015-07-27 16:38:00

Riven (18 views)
2015-07-27 15:35:20

Riven (21 views)
2015-07-27 12:26:13

Riven (12 views)
2015-07-27 12:23:39

BurntPizza (30 views)
2015-07-25 00:14:37

BurntPizza (41 views)
2015-07-24 22:06:39

BurntPizza (24 views)
2015-07-24 06:06:53

NoxInc (29 views)
2015-07-22 22:16:53

NoxInc (18 views)
2015-07-22 22:13:39
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
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!