This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes UDP Packet Reassembly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "UDP Packet Reassembly" Watch "UDP Packet Reassembly" New topic

UDP Packet Reassembly

Lerner O'Reilly

Joined: Jun 16, 2011
Posts: 6
I searched and searched, to no avail.
I found, in many guides to Java Networking, that UDP packets have a chance of being split into smaller packets and/or conglomerated into bigger packets.
In either case, is the re-assembly of split packets, or the splitting of conglomerated packets done application-level or is it done in some lower level that I needn't be concerned with?
I understand that there is a chance that packets will not arrive, but do I have to deal with re-assembling packets myself?
I found a guide (non-Java-specific) that said that, in their UDP packets, they include two bytes which represent the size of the packet. Is this to ensure that the entire packet is received? Does this apply to me?
Lerner O'Reilly

Joined: Jun 16, 2011
Posts: 6
I found a link that I /think/ answered my question. It would be nice if someone could confirm my understanding of it, though.
All packet reassembly is done at the Network level, and I don't have to be concerned with it at Application level.
If a packet is not fully reassembled, it is not passed onto the application level.
If my understanding is correct OR incorrect, some validation would be nice.
Lerner O'Reilly

Joined: Jun 16, 2011
Posts: 6
Also, when I was referring to packet length in my first post, that was actually specific to non-blocking TCP connections, I later realized, not UDP packets.
jQuery in Action, 2nd edition
subject: UDP Packet Reassembly
Similar Threads
How come I can ping a machine?
Setting the Type of Service (ToS) field in the IP header of a packet
file transfer using datagram
Calulate net speed through applet
Multicast UDP Packet Loss