Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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 2890 times)
0 Members and 1 Guest are viewing this topic.
Offline davidaprice

Junior Duke





« 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?

Thanks,
David
Online kevglass

JGO Kernel


Medals: 188
Projects: 24
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.

Kev

Offline davidaprice

Junior Duke





« 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
Online kevglass

JGO Kernel


Medals: 188
Projects: 24
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.

Kev

Offline davidaprice

Junior Duke





« 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.

 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (42 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (85 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!