This paper describes a new operating system kernel, called the x-kernel, that provides an explicit architecture for constructing and composing network protocols. Our experience implementing and evaluating several protocols in the x-kernel shows that this architecture is both general enough to accommodate a wide range of protocols, yet efficient enough to perform competitively with less structured operating systems. Zndex Terms-Communication, distributed systems, networks, operating systems. I. INTRODUC~~N N ETWORK software is at the heart of any distributed system. It manages the communication hardware that connects the processors in the system and it defines abstractions through which processes running on those processors exchange messages. Network software is extremely complex: it must hide the details of the underlying hardware, recover from transmission failures, ensure that messages are delivered to the application processes in the appropriate order, and manage the encoding and decoding of data. To help manage this complexity, network software is divided into multiple layers-commonly called protocols-each of which is responsible for some aspect of the communication. Typically, a system's protocols are implemented in the operating system kernel on each processor. This paper describes a new operating system kernel-called the x-kernel-that is designed to facilitate the implementation of efficient communication protocols. The x-kernel runs on Sun3 workstations, is configurable, supports multiple address spaces and lightweight processes, and provides an architecture for implementing and composing network protocols. We have used the x-kernel as a vehicle for experimenting with the decomposition of large protocols into primitive building block pieces [15], as a workbench for designing and evaluating new protocols [22], and as a platform for accessing heterogeneous collections of network services [23]. Many operating systems support abstractions for encapsulating protocols; examples include Berkeley Unix sockets [17] and System V Unix streams [28]. Such abstractions are useful because they provide a common interface to a collection of dissimilar protocols, thereby simplifying the task of composing protocols. Defining truly general abstractions is difficult because protocols range from connection-oriented to connection-less, synchronous to asynchronous, reliable to unreliable, stream-oriented to message-oriented, and so on. For example, to accommodate differences in different protocol layers, Berkeley Unix defines three different interfaces: driver/protocol, protocol/socket, and