分析已有的IPv4与IPv6的socket接口和实现,设计了一种支持IPv4/IPv6双协议栈的通信模块。该模块利用类继承,为基于IPv4、IPv6双协议栈的软件开发提供了统一的底层通信功能编程接口。采用该模块,还可以方便地升级原有只支持IPv4通信的软件系统,使其支持IPv6协议。该模块已应用于NGI网络监测分析系统NetTurbo。
This paper analysed the existing socket functions of IPv4 and IPv6, and designs a software communication module to support IPv4/IPv6 dual stacks. The module implemented and provided a set of easy-to-use and unified API interfaces. They shield the differences of IPv4 and IPv6 network programming. Furthermore, the original IPv4 software can be easily updated with this module to simultaneously support IPv4 and IPv6 communications. This method has been used in NetTurbo which is the network monitoring and analyzing system for next generation Internet.