分析了NS的工作机制和移动Ad hoc网络仿真中使用的主要构件库代码及分裂对象模型中OTCL和C++两种语言的联合使用问题,并在此基础之上详细地分析了构件库各层之间的接口实现问题,着重研究了网络层、链路层和物理层的关键技术,并介绍了AODV路由协议和MAC层定时器等典型代码的实现,从而有助于掌握NS下的网络仿真和协议代码的扩展。
The working mechanism, main codes of simulation components libraries and the joint use of OTCL and C++ languages under split-object model of NS simulation for mobile ad hoc networks is analyzed, based on this, the interface of the multi-layers of the components library can be established. The key techniques of network layer, link layer and the physical one are emphasized, meanwhile, the implement of AODV codes and the MAC timer one is provided, The network simulation and protocol codes extension become easily by the help of such work.