Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You are here : home : Java Glossary : U words : UDP.
You use the Java classes DatagramPacket and DatagramSocket.
| IP Packet Header | ||
|---|---|---|
| Field | Size in bits | Purpose |
| source IP | 32 | Not in the UDP header, but rather in the basic IP header. Who sent the packet. When it finally arrives at its destination the receiver will know who it was from. |
| destination IP | 32 | Not in the UDP header, but rather in the basic IP header. Where the packet is going. On each leg of its journey the routing computer uses this to get the packet a little closer to its final destination. |
| checksum | 16 | This is computed as the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded as needed with zero bytes at the end to make a multiple of two bytes. If the checksum is set to zero, then checksuming is disabled. If the computed checksum is zero, then this field must be set to 0xFFFF. |
| source port | 16 | Similar to the function the source port in TCP/IP. It is a free port on the sender's machine where any responses should be sent. |
| destination port | 16 | Which program on the server this should be directed to. |
| message length | 16 | total size of UDP header plus data payload (but not the IP header) in 8-bit chunks (aka bytes or octets). The means the maximum size of a packet including data is 64K. This means the payload of data is at most 65,451 bytes. This could have easily been calculated from the length in the IP packet header, but for some reason they duplicated the information. |
Everything is in big endian byte order. See details.
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 3927. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/jgloss/udp.html | J:\mindprod\jgloss\udp.html | |||