The invention discloses a device for operating a protocol stack and a method. The device comprises a protocol stack user process and a socket layer protocol agent module, wherein the protocol stack user process is used for operating the protocol stack in a user space independently of an application program process; and the socket layer protocol agent module is registered in a kernel space when a system is initialized and is used for communication between the application program process and protocol stack user process. The method comprises the following steps that: the protocol stack user process which is independent from the application program process operates in the user space, and when the system is initialized, the socket layer protocol agent module is registered in the kernel space; and the application program process is communicated with the protocol stack user process through the socket layer protocol agent module. Due to the utilization of the device and the method, the reliability, the information sharing degree and the compatibility of the protocol stack can be improved and the debugging, maintenance and development difficulty of software platform transplantation is reduced.