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.

  • 相关阅读:
    paip.关于动画特效原理 html js 框架总结
    paip.utf-8,unicode编码的本质输出unicode文件原理 python
    paip.多维理念 输入法的外码输入理论跟文字输出类型精髓
    paip.前端加载时间分析之道优化最佳实践
    paip.输入法编程--英文ati化By音标原理与中文atiEn处理流程 python 代码为例
    paip.导入数据英文音标到数据库mysql为空的问题之道解决原理
    paip.元数据驱动的转换-读取文件行到个list理念 uapi java php python总结
    paip.python3 的类使用跟python2 的不同之处
    paip.日志中文编码原理问题本质解决python
    paip.性能跟踪profile原理与架构与本质-- python扫带java php
  • 原文地址:https://www.cnblogs.com/Snowfun/p/1816674.html
Copyright © 2011-2022 走看看