zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    狗狗对主人的十句话
    微软提供正确卸载IE7的方法并恢复IE6
    c语言操作符的优先级
    linux 常用命令每日更新
    Visual Studio快捷键大全
    Opera将尽快发布补丁修复桌面浏览器漏洞 狼人:
    KILL杀毒软件重出江湖 公司股权全内资组成 狼人:
    图文:2010中国计算机网络安全年会华为展台 狼人:
    微软再次警告IE安全漏洞成为攻击目标 狼人:
    微软发布三月安全公告 两个补丁修补严重漏洞 狼人:
  • 原文地址:https://www.cnblogs.com/Snowfun/p/1816674.html
Copyright © 2011-2022 走看看