IPv6 and Java

 

IPv6 and Java


At the time of writing, we have the possibility to work with two levels of Java, the official 1.4
and the next generation 1.5, provided as beta. These two JDKs allow working with IPv6. The
level of IP v6 implementation in the JDK 1.5 is better. This chapter describes the functionalities
of these JDK’s IP v6 features.


JDK 1.4

With the J2SDK/JRE 1.4 release, IPv6 support has been added to Java Networking. This will
make J2SE compliant with the following specifications (RFCs):
• RFC 2373: IPv6 Addressing Architecture;
• RFC 2553: BasicSocket Interface Extensions for IPv6;
• RFC 2732: Format for Literal IPv6 Addresses in URLs.
Since the J2SDK does not support raw sockets, RFC 2292 (: Advanced Sockets API for IPv6) is
not supported in this release.
Other interesting features of IPv6, such as tunneling, auto configuration of addresses, mobile IP,
etc., are not supported at the Java API level, as they are handled automatically by the underlying
OS or system support.
On systems with a dual stack, system properties are provided for selecting the preferred IP stack.
By default, the IPv6 stack is preferred because the IPv6 Socket can work with IPv4 and IPv6
peers on a dual stack system.
All the methods for programming TCP/IP applications are localized in the java.net package. In
this package, the class InetAdress has been modified to support both IPv4 and IPv6 addresses.
Two new classes appears, Inet4Address and Inet6Address, each class inherits from InetAdress
and implements the specific behavior of its protocol version. As Java is an object oriented
language, an application need to deals with the InetAddress class. With the polymorphism, it will
get the correct behavior. New methods are introduced to be able to test the nature of IPv6 address
(Site, Org address…).
Due to object oriented nature of Java, the socket classes work both IPv4 and IPv6 addresses. In
fact, the classes manipulate an InetAddress. The socket API can handle IPv4 and IPv6 traffic.
The selection of IP stack depends to OS where the application run and the user’s stack preference
setting. To provide the same support on IPv4 as IPv6, the old socket API has been overloaded to
support the two protocols options.


JDK 1.5
The JDK 1.5 increases the support of IPv6. It keeps all the functionalities introduced with the
JDK 1.4 and provides some new features.
Arguably, the major enhancement resides in the introduction in the socket API of the method
setPerformancePreference. This method allows the application to express its own preferences to
tune the performance characteristics of this socket. Performance preferences are described by
three integers whose values indicate the relative importance of short connection time, low
latency, and high bandwidth. With this method, the network oriented notion of Quality of
Service (QoS) is introduced. Any application can set its preferences to adapt its network traffic
and provide the best QoS.

 

 

你可能感兴趣的:(java)