IPv6 : Java Glossary

go to home page I words local find full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish punctuation 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 (all) ©1996-2009 Roedy Green, Canadian Mind Products
IPv6
The successor protocol to IP. Using IPv6 in Java is easy; it is transparent and automatic. Unlike in many other languages, no porting is necessary. In fact, there is no need to even recompile the source files. The new protocol has addresses four times bigger 128 bits (16 bytes) verses the 32 bits (4 bytes) in the current IP version 4.

Note that IPv6 addresses are 128 bits, 16 bytes, 4 times longer than IPv4 addresses. You’d think 64 bits, allowing 18,744,073,709,551,616 addresses, or 30,77,457 addresses per person would have sufficed. However, to avoid another transition for a very long time, they went for 128 bits. This will allow simpler routing, since bands can be assigned for various regions that won’t soon fill up, and require juggling to shift slots from other regions.

The Java class for dealing with these is called java.net.Inet6Address, though java.net.InetAddress will work too. The new headers, surprisingly, have fewer fields than before, and are fixed length 40 bytes to streamline processing. New features include:

IPv6 Packet Header
Field Size in bits Purpose
version 4 6 for IP version 64. This allows IPv4 and IPv6 packets to be mixed.
payload length 16 total size of data payload measured 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,496 bytes.
hop limit 8 how many more hops this packet has to live before being discarded as lost or hopelessly late. On each leg of this packet’s journey, this field gets decremented by 1.
source address 128 Who sent the packet. When it finally arrives at its destination the receiver will know who it was from.
destination address 128 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.
other stuff 36 Miscellaneous fields.

Everything is in big endian byte order.

Java 1.4.1+ handles the new IPs with java.net.InetAddress and java.net.Inet6Address.

Learning More

Sun’s JDK Technote Guide on IPv6 : available:
Sun’s Javadoc on InetAddress class : available:
Sun’s Javadoc on Inet4Address class : available:
Sun’s Javadoc on Inet6Address class : available:

CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/ipv6.html J:\mindprod\jgloss\ipv6.html
CMP logofeedback Please email your feedback for publication, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.191.109]
You are visitor number 10,559.