next up previous contents
Next: Configuring a Protocol Up: x-kernel Tutorial Previous: Object-Based Protocol Implementation

Protocols and Sessions

 

The two main classes of objects supported by the x-kernel are protocols and sessions. Protocol objects represent just what you would expect---protocols such as IP or TCP. Session objects represent the local end-point of a channel, and as such, typically implement the code that interprets messages and maintains any state associated with the channel. The protocol objects available in a particular network subsystem, along with the relationships among these protocols, is defined by a protocol graph at the time a kernel is configured. Session objects are dynamically created as channels are opened and closed. Loosely speaking, protocol objects export operations for opening channels---resulting in the creation of a session object---and session objects export operations for sending and receiving messages.

The set of operations exported by protocol and session objects is called the uniform protocol interface---it defines how protocols and sessions invoke operations on each other. At this stage, the important thing to know about the uniform protocol interface is that it specifies how high-level objects invoke operations on low-level objects to send outgoing messages, as well as how low-level objects invoke operations on high-level objects to handle incoming messages. For example, consider the specific pair of protocols TCP and IP in the Internet architecture. TCP sits directly above IP in this architecture, so the x-kernel's uniform protocol interface defines the operations that TCP invokes on IP, as well as the operations IP invokes on TCP, as illustrated in Figure 1.

Keep in mind that the following discussion defines a common interface between protocols, that is, the operations one protocol is allowed to invoke on the other. This is only half the story, however. The other half is that each protocol has to provide a routine that implements this interface. Thus, for an operation like xOpen, protocols like TCP and IP must include a routine that implements xOpen; by convention, we name this routine tcpOpen and ipOpen, respectively. Therefore, the following discussion not only defines the interface to each operation, but it also gives a rough outline of what every protocol's implementation of that operation is expected to do.

  
Figure 1: Uniform Protocol Interface.





next up previous contents
Next: Configuring a Protocol Up: x-kernel Tutorial Previous: Object-Based Protocol Implementation



Larry Peterson
Wed Feb 21 13:58:06 MST 1996