next up previous contents
Next: Operations on Protocol Up: Protocols and Sessions Previous: Protocols and Sessions

Configuring a Protocol Graph

 

Before presenting the operations that protocol and session objects export, we first explain how a protocol programmer configures a protocol graph. Standardization bodies like the ISO and the IETF define a particular network architecture that includes a specific set of protocols. In the Internet architecture, for example, TCP depends on IP, by definition. This suggests that it is possible to ``hard-code'' TCP's dependency on IP into the TCP implementation. While this could be done in the case of TCP, the x-kernel supports a more flexible mechanism for configuring a protocol graph. This makes it easy to plug protocols together in different ways. While this is a quite powerful thing to be able to do, one has to be careful that it makes sense to have any two protocols adjacent to each other in the protocol graph.

Quite simply, a user that wants to configure a protocol graph specifies the graph with a text file, called graph.comp, of the following form:

name=lance;
name=eth protocols=lance;
name=arp protocols=eth;
name=ip protocols=eth,arp;
name=icmp protocols=ip;
name=udp protocols=ip;
name=tcp protocols=ip;

This specification results in the protocol graph depicted in Figure 2. In this example graph, lance and eth combine to implement an Ethernet device driver: lance is the device-specific half and eth is the device-independent half. Also, arp is the Address Resolution Protocol (it is used to translate IP addresses into Ethernet addresses) and icmp is the Internet Control Message Protocol (it sends error messages on behalf of TCP and IP). The name field in each line specifies a protocol (by name) and the protocols field says which other protocols this protocol depends on. Not shown in this example is a dir field that identifies the directory where the named protocol implementation can be found; by default, it is the same as the name of the protocol. The x-kernel build program, called compose, parses this specification, and generates some C code that initializes the protocol graph when the system is booted.

  
Figure 2: Example Protocol Graph.



next up previous contents
Next: Operations on Protocol Up: Protocols and Sessions Previous: Protocols and Sessions



Larry Peterson
Wed Jan 24 15:11:08 MST 1996