结合一个新的队列调度算法,深入全面地探讨了如何对网络仿真软件NS2(Netvork Simulator)进行扩展。特别是如何在NS2中实现复杂的队列调度算法,对在NS2中实现新算法的基本原理和过程,以及一些关键细节给出了较为详细的描述,如通过分组来携带用于调度的流状态信息,以及如何使用这些信息进行队列调度,增加对分组队列的基本操作等。最后还给出了新算法的仿真实验结果,实验结果表明新算法在公平性方面的性能良好。通过扩展NS2来验证新的网络协议和算法,大大提高了效率、降低了成本,并更具灵活性。
It was discussed how to extend the network simulator-NS2, especially how to extend queue scheduling algorithm in NS2, and the discussion was illustrated by implementation of a queue scheduling algorithm. The basic idea and key details of NS2 extension were given a detailed description, such as how to use packet header to carry scheduling information, how to schedule packet according to this information, and how to extend basic operation of packet queue. Moreover, simulation results were given, which showed that this new algorithm achieved good performance on fairness. Verifying new network protocol and algorithm through extension of NS2 can improve efficiency, reduce cost, and be more flexible.