Network Emulator provides a convenient and efficient method for testing different application systems on the Internet and is very fit for applying to the laboratory environment because of its lower cost, smaller scale, user-friendly and real-time characteristics. We in this paper design and implement a WINdows-based Packet-Level network EMmulator (WINPLEM) for emulating various network dynamics. The emulator is able to not only emulate fundamental network attributes, such as link bandwidth, transmission delay, packet loss and out-of-order packets, but also support trace-driven emulation, which generates more realistic and dynamic network traffic. WINPLEM is a valid tool for testing and evaluating the performance of various network multimedia applications.After introducing the present research status of network emulators and some key technologies, the architecture of WINPLEM is presented. It is designed in modules and the definition of its interfaces allows a versatile use for the emulation of network behavior in experiments.In order to implement the data transmission delay, two methods are presented and compared. One uses the Performance Counter to inquire the system clock, and the other employs the Windows Kernel Timer controlling buffer queue. Lots of test results indicate that the transmission delay implemented by the later one can emulate the transmission delay more accurately with relatively lower error rate and system load. Based on the implementation of transmission delay, WINPLEM handles bandwidth as a special case of delay emulation by converting bandwidth values to delay ones. In order to emulate packet loss, we modify the NDIS intermediate driver and employ random numbers which meet the requirements of a user-defined packet drop rate. Regarding the emulation of out-of-order transmission, we present a packet-scheduling mechanism, loading user configuration parameters and trace file into the emulating engine. Meanwhile, we implement an emulation of dynamic transmission delay. Several experiments are conducted to prove the correct implementation of each of the modules of WINPLEM, followed by integration tests. These experiments show that WINPLEM achieves high accuracy, with error rates of emulated bandwidth below 2.25% and those of delay below 5%. Also, it is a resource-efficient solution, with a CPU utilization rate less than 5%.Finally, a case study is presented which demonstrates the interaction of network behavior and the observed quality of a streaming video application. This case study further validates the effectiveness of WINPLEM. |