| The research about the ad hoc network protocols has become the main subject of network communication. A large amount of techniques have been developed to expand and improve the capabilities of ad hoc network protocols in order to raise the performance. One of these techniques is expanding the protocol layer of the standard network protocol stack to form a protocol stack for the ad hoc network.Generally, expanding the standard protocol stack is finished in the kernel of the operating system. However, when implementing the expanding protocol stack in the kernel of operating system, the developer needs to know many kernel details which are not related to developing expanding protocol stack. And it is really hard to debug the protocol layer in the kernel which causes the low developing efficiency. Eventually, the scalability and the portability of the implementing code are very poor.Therefore, it is necessary to implement the expanded protocol layer in the user-space of operating system. Expanding network protocol stack in the user-space can make the developers focus on developing the protocol layer itself without concerning the kernel details too much. And there are powerful debugging tools in the user-space which is useful to debug the code. The expanded ad hoc network protocol layer runs in the user-space which ensures the scalability and the portability.This paper mainly introduces the implementation of an ad hoc network protocol stack in the Linux user-space. First, analyze the requirements of developing the user-space protocol stack. Second, discuss the specific techniques which are used to solve the problems for developing user-space protocol stack. Third, introduce the general user-space protocol layer expanding mode implemented by these techniques. Finally, introduce the test results of the ad hoc protocol stack implemented by the general expand mode running in an emulation system for the ad hoc networks. The results prove the validity of the user-space protocol layer expanding mode.This paper is based on implementing the ad hoc protocol stack on Linux platform, but not confined implementing it on Linux. We start from it to abstract a general mode of expanding protocol layer in the user-space. This general mode uses the virtual network interface technique. With this mode, the developers can not only implement the ad hoc network protocol stack, but also other protocol stack which uses different protocols and algorithms. |