An Implementation of the Revised Internet Stream Protocol (ST-2) 8SCraig Partridge and Stephen Pink Swedish Institute of Computer Science (SICS) Box 1263 S-164 2tockholm, Sweden 4Research Report R91:1 Abstract e gST-2 is a revision of an experimental protocol designed to support applications which requiruaranteed network services. ST-2 provides mechanisms for creating streams, tree-shaped. Adelivery paths with performance guarantees, for applications which require such guaranteess part of the MultiG project, the authors implemented ST-2 in the BSD system. The twinpgoals of this implementation were to see how easily a novel protocol like ST-2 could be incororated into the BSD networking model and, more importantly, to thoroughly evaluate the ST-- e2 protocol. Our conclusions are that the BSD model proved quite general, requiring only modst changes (changes which were largely invisible to the application), but that the ST-2 protoI col itself needs some reworking.ntroduction The Internet Stream Protocol [#8] was developed in the late 1970's as an experimental networkdlayer protocol to support the transmission of voice streams and management of voice conferences over widebandata networks. The Stream Protocol has been used for several years as the primary protocol in a voice and. Bvideo conferencing system which has operated over the Wideband and Terrestrial Wideband networks [#12,#16]ased on this experience, the CIP (Connection-oriented IP) Working group of the Internet Engineering Taskn sForce was formed to revise and refine the protocol specification. The goals of this revision were to ``fill iome of the areas left unaddressed, to make it easier to implement, and to support a wider range of applica-t 1tions'' [#2]. The revised experimental specification was issued in late 1990, as Internet Request for Commen190. The revised protocol is commonly known as ST-2. We became interested in ST-2 as part of our work onvthe MultiG Project at the Swedish Institute of Computer Science (SICS). One part of the MultiG project is deoted to the support of high-bandwidth, delay-constrained, multimedia applications such as conferencing, virtualt senvironment support, and telepresence. A critical problem is to determine what types of network protocols besupport these kinds of applications. ST-2 seemed an interesting candidate for experimentation because it ist hbased on prior experience and contains many features, such as flow reservation and hop-by-hop negotiation, thaave been suggested as desirable for gigabit networking protocols [#3,#4]. To experiment with ST-2, we decid-- ied to implement it in the 4.3BSD kernel [#11]. We believe that implementing is often the best way of evaluatng a proposed protocol because it provides operational experience with the protocol. The implementation pro-- pcess also forces the implementor to closely evaluate the specification and thus discover subtle issues that a simle reading would not. Another benefit of implementing the protocol was the opportunity to evaluate how well Sthe 4.3BSD networking interface could be adapted to support protocols with performance guarantees such asT-2. An Overview of ST-2 Abstracted to its basic functionality, ST-2 builds routing trees between a sender r(called the origin) and one or more receiving applications (called targets) and then transmits packets down theouting tree. The origin is the root of the tree and the targets are its children. The internal nodes of the tree are .PST-2 routers. Note that if hosts also act as routers, then the internal nodes of the tree may also contain targetsaths between routers, or between routers and the origin or targets, are called hops. Systems running the ST-2- dprotocols are called agents. The data flow over the routing tree is referred to as a stream. Streams are uniirectional for data. Data can only be sent downstream, from the origin to its targets. When routes to different fltargets diverge at an agent, the agent duplicates the packet and sends one copy to each hop. Each stream has aow specification associated with it. The flow specification specifies fourteen properties (such as precedence, realiability, cost constraints, and maximum and minimum packet sizes) that the stream requires of the networks andgents it flows through. Streams can be reconfigured to add or delete targets, change flow properties, or change sroutes, while data is flowing. To provide this service, ST-2 is actually divided into two parts, which the ST-2pecification treats as semi-distinct protocols: the STream Protocol (ST) and the ST Control Message Protocol a(SCMP). ST simply forwards data through the routing tree. SCMP is the control protocol which actually buildsnd maintains the routing trees used by ST. ST-2 is closely tied to the Internet Protocol (IP) [#13,#14]. Beyondo ia special use of the IP version field to deliver ST datagrams (see the next section), ST-2 uses IP addresses tdentify agents. Furthermore, ST-2 provides no mechanism for locating potential targets or learning their ad-) Sdresses: the specification suggests using datagrams sent over IP for target discovery. The STream Protocol (STT provides the most basic of services: the forwarding of data down a pre-established routing tree. Theidesigners of ST want to make data delivery extremely quick and believe that by separating out the data forwardng protocol from the control protocol, they can achieve a very efficient forwarding protocol. Accordingly, the iST header contains only 8 fields, comprising a total of 8 bytes. The format is shown in Figure 1.iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiIV=5 cc Ver=2 cc Pri cc TS cc 0 Len iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiHID Checksum i cc ciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiicc c cc c T Figure 1he first field is a 4-bit IP version field. The IP version field is an (understandable) hack. Because it is difficulttto get protocol identifiers for different MAC layers, ST packets are encapsulated as if they were IP packets bu the first 4-bits of the packet contain a special IP version number (version 5), and the receiving IP host is expectved to recognize that packets of IP version 5 are to be passed to ST instead of IP. The next 4-bit field is the STersion number, currently 2. The ST priority class (0 being lowest priority and 7 being highest priority) is to be mused to determine which packets within a stream can be dropped if congestion occurs and the stream is usingore than its allocated share of resources. The timestamp bit indicates if an optional 8-byte timestamp in Netpwork Time Protocol [#5] format has been appended to the ST header. The length field is the length of the STacket. The HID field is the hop identifier. For each stream, each hop has a unique identifier. When an agent preceives an ST packet with a particular HID, that HID uniquely identifies a particular stream and how the STacket should be forwarded. When forwarding, an agent must update the HID field, from the HID of the last, ahop to the HID of the next hop. The HIDs for each hop are negotiated by SCMP. HIDs below 4 are reservednd an HID of 0 means the contents of the ST packet is an SCMP message. The checksum field is the Internet cchecksum [#6,#7] over the ST header. The ST Control Message Protocol (SCMP) SCMP is one of the moreomplex protocols the authors have encountered. (The authors' primary experience is with stateful transport tprotocols such as TCP and RDP, and with the stateless transport protocols, UDP and HMP). SCMP's function iso build, maintain, and, when finished, tear down the routing trees used by ST. The format of the SCMP headeris shown in Figure 2. The header has 11 fields and is 24 bytes long. iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i OpCode cc Opt Lengthiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i Recv VLI Send VLIiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i Reference cc cc c LinkReferenceiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i Sender IP Addriiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i Checksum cc Reason/HIDiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i Detector IPiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiicc cc cc cc c cc cc cc cc c T Figure 2he first field is the 8-bit operation code, which indicates which type of SCMP message is being sent. There aree dseventeen different SCMP message types. Most messages can only flow one way, either downstream (in thirection from origin to target) or upstream (in the direction from target to origin). There are a few messages, tmost notably acknowledgement messages, which may flow in either direction. In general, SCMP communica-ions take the form of a request message replied to by a response message, with both request and response meslsages being reliably transmitted. The meaning of the bits in the options field are message-type specific. Theength field is the total number of bytes in the SCMP message. The Virtual Link Identifiers (VLIs) can be, ethought of as SCMP ports. Each HID is typically managed by two SCMP peers (one at each end of the hop)ach of which has a unique VLI. If link-layer multicast is used, an HID may be managed among many peers, sone upstream peer and multiple downstream peers on the same sub-network. The reference field is essentially aequence number, used to uniquely identify an SCMP message. Acknowledgements of SCMP messages placee fithe reference number of the message being acknowledged into either the link reference field or the referenceld depending on the message type. There are two fields for acknowledging reference numbers because some Aacknowledging messages are also control messages, and must be acknowledged in their turn. For example, anCCEPT message (described in more detail below) is a message which reliably accepts a connection request. eThus the ACCEPT message must contain both the reference number of the connection request (in the link refer-nce field) and its own reference number, so it may be acknowledged. The Sender field is the IP address of the mprevious hop in the path this message has followed. The checksum is the Internet checksum over the SCMPessage. The Reason/HID field contains either the HID being negotiated (which appears only in the CONNECTvand HID negotiation messages), or a diagnostic reason code, used both for returning error indications and as adice about why changes are being made to the stream. The specification currently specifies sixty-five different. Ireason codes. The Detector IP field contains the IP address of the system from which the message originatedt is only used for some message types and is null (zero) for the others. Creating and Using a Stream To illusotrate the general workings of SCMP, we consider a scenario in which an origin creates and uses a stream to oner more targets. The example has purposely been kept simple but contains the essential features of SCMP. Toa rcreate a stream, an origin sends a CONNECT message. The message contains the origin's SCMP VLI andeference ID, plus several parameters. The critical parameters are: the Origin parameter, which contains a. Tunique address of the originating application the FlowSpec parameter, which specifies fourteen flow parametershe ST-2 specification does not specify precisely how the agents are to manage their data queues or negotiatetwith the lower layers to achieve the required flow properties. However, the basic scheme is that each agent esablishes a flow that meets the flow specification's requirements as best it can, updates the FlowSpec and passesbthe FlowSpec to the downstream agent. The final targets each echo the FlowSpec back to the origin, after possily updating the FlowSpec themselves. the Name parameter, which contains a globally and permanently uniquer kname for the stream and is generated by concatenating the origin's IP address with a timestamp. The reason foeeping the Name permanently unique is for accounting purposes. the TargetList parameter, which contains the. Bone or more target addresses of the CONNECT message traveling on this hop and target specific source routesecause SCMP parameters cannot be longer than 256 bytes, and SCMP target addresses can be up to 252 bytes mlong, multiple TargetLists may be required to store all the target addresses. In addition, the CONNECT messageay propose an HID or invite the next hop to chose an HID. (The possibility of experimenting with some exter-t hnal HID assignment mechanism is also permitted). One copy of the CONNECT message is sent to each nexop. Thus if there are two targets that are reached via a single next hop, one copy of the CONNECT messagescontaining both target addresses will be sent. The CONNECT message is periodically retransmitted until it i acknowledged by an HID-REJECT, HID-APPROVE, ERROR-IN-REQUEST, ACK, REFUSE, or ACCEPT mesasage, or it has been retransmitted too many times, in which case the origin can send a DISCONNECT messagend give up, or try another route. Upon receiving a CONNECT message, the next hop checks to see if thee aCONNECT message is for a known stream. If the CONNECT is for a known stream, then the message must bdding new targets to the stream, or be a duplicate, or be an error. If the stream is unknown, then the next hoptstarts to create a new stream. To create a new stream, the next hop first allocates an SCMP VLI for the connecion, then checks that the HID proposed in the CONNECT message is not already in use. If the HID is in use, tthe next hop sends back an HID-REJECT message. The HID-REJECT message may optionally contain informa-ion about which HIDs are free. Upon receipt of the HID-REJECT message, the previous hop (e.g. the origin) ccan choose a new HID and send an HID-CHANGE message to continue the negotiation, or decide to give up theonnection attempt. If, on further examination of the CONNECT message, the next hop determines that even if ian unused HID could be found it would not accept the connection, the next hop can send a REFUSE message tondicate that it will not accept the connection. (SCMP is designed such that it is possible to process the CONmNECT message in parallel with the HID negotiation, to speed up connection establishment, so the HID-REJECTay have been sent in parallel with other processing). If the HID is not in use, the next hop sends an HIDhAPPROVE message back to the prior hop and continues processing the CONNECT message. Alternately, if theop is to choose the HID, it picks an HID and returns that HID in an HID-APPROVE message. The next hopo fiexamines the FlowSpec parameter and the targets of the CONNECT message to see if it is willing and able tnd routes with the given flow requirements to the targets. If the next hop cannot or will not provide a connec-- ntion to any of the targets, it sends a REFUSE message, containing a list of the targets it cannot or will not conect to. Otherwise, the next hop updates the FlowSpec to reflect the type of service it can provide and sends rCONNECT messages on towards hops closer to the targets. Eventually a copy of the CONNECT messageeaches a system on which a target resides. Information about the attempt to connect is then passed to the target aapplication, which decides whether to accept or refuse the connection. To refuse a connection, the target sendsREFUSE message to the previous hop. The REFUSE message includes the address of the target that refused. tTo accept a connection, the target sends an ACCEPT message to the previous hop. The ACCEPT message con-ains both the address of the target that is accepting and the FlowSpec parameter after the target's final updatesCto it (so the origin can confirm that the flow parameters agreed upon with its target are sufficient). The ACEPT or REFUSE message is retransmitted until the previous hop sends an ACK message. The ACCEPT or iREFUSE messages are relayed up the routing tree to the origin, so the origin can know how targets responded tots attempt to connect. Once the origin has received an ACCEPT message, the stream has been established (at dleast to the target which accepted) and the origin may begin sending data. When the origin has finished sendingata, it sends a DISCONNECT message. The DISCONNECT message can either contain a TargetList parame-- gter, containing a list of selected targets to disconnect, or a flag can be set in the message to indicate that all tarets should be disconnected. The DISCONNECT message is retransmitted until acknowledged by an ACK mes-- Nsage from the next hop. The DISCONNECT message is propagated down the routing tree much like a CONECT message. A target may drop out of a conversation by issuing a REFUSE message. The REFUSE mes-l asage contains the target which is dropping out of the conversation. A REFUSE message is retransmitted unticknowledged. Changing an Existing Stream A number of SCMP messages are used to change an existinge hstream. The origin can issue new CONNECT messages at any time to add new targets to a stream. They arandled much like CONNECT messages at the initial set up time. Any hop can issue a CHANGE message toe Cchange the flow parameters on the part of the tree which is below it. CHANGE messages are handled much likONNECT requests, except that if the change fails, the affected portion of the stream must be torn down anda Crebuilt. Hops farther down the tree may ask parent nodes to issue a CHANGE message by sendingHANGE-REQUEST message. The HID of a hop may be changed using the HID-CHANGE. Management bMessages SCMP has four messages used to detect and recover from failures. HELLO messages are exchangedy ST agents to keep each other informed of their status. HELLO messages are sent on a per-neighbor agent wbasis, not on a per-stream basis. The HELLO message serves two functions: first, it is used to notify neighborshen an agent is restarted, so they know that streams through that agent have been severed; second, it is suptposed to be sent often enough that an agent's crash or a network failure will be detected by the agent's failureo send a HELLO message before any stream's recovery timeout period (a stream parameter) is exceeded. Thes eSTATUS message is used to determine if an adjacent agent knows of a stream. The STATUS message containither the HID or the stream name of the stream of interest. The queried agent sends a STATUS-RESPONSEt tmessage which contains the stream parameters (name, flow parameters, current targets, etc) or an indication thahe stream is not known to the agent. STATUS messages are sent when an agent has reason to believe that its supstream or downstream neighbors may no longer know about a stream or may contain information on an oldtream which is no longer in use. NOTIFY messages are used to inform upstream agents of changes that affectt oa stream, such as routing changes or a change in the resources that are available to a stream (such as the advenf a higher precedence stream that has preempted the existing stream's resources). Protocol Error MessagesRSCMP supports two types of protocol error messages: ERROR-IN-REQUEST messages and ERROR-INESPONSE messages. ERROR-IN-REQUEST messages are used to indicate an error in handling a request mmessage. ERROR-IN-RESPONSE messages are used to indicate an error discovered in handling a responseessage. The reference field of the SCMP header is used to indicate the particular request or response found inn terror. The reason field of the SCMP header indicates the particular error found. The message may also contaihe contents of the SCMP request or response which was found in error, with a pointer to the location where the l(error was discovered. Error messages are not sent in response to error messages. Error messages have locaper-hop) significance. They are used to indicate cases where a protocol failure (a bad message format or failure -tto properly follow the protocol) has been detected. The sender of the erroneous message is encouraged to reransmit the (presumably corrected) message when it receives an error message. The mechanism by which the sfsender is to determine how the message is to be corrected is not specified. Special Functions ST-2 supporteatures to make use of multicasting, if the network supports it. Multicasting is used to optimize delivery to afmultiple next hop agents by sending a single multicast packet. ST-2 also allows systems to request that bothorward and return ST-2 connection be established, to permit duplex communication. ST-2 further allows ST to Nbe encapsulated within IP, so that ST can be experimented with over IP networks. The Structure of the BSDetworking Code The BSD networking code has a well-tested structure intended to support multiple families of rnetworking protocols and to make the addition of new protocols easy. The code has been extensively tested andefined by the implementation of several protocol suites, including the TCP-IP, OSI, and XEROX-PUP protocol tsuites. This generality of the BSD code made it the implementation system of choice for the ST-2 implementa-ion and we were interested in seeing how well a multimedia protocol was served by the BSD code. This sec-- mtion provides a brief overview of the BSD code, as used by connection-oriented protocols. (ST-2 was impleented as a connection-oriented protocol). Connection-oriented protocols are those protocols which require at fconnection to be established between peers before any data is sent. The BSD code also has extensive supporor connection-less or datagram protocols. Readers interested in a more thorough discussion of the BSD coder umay consult [#11]. Application Interface The BSD system provides a generic set of networking system calls fose by all applications, using any protocol suite. One interesting issue in implementing ST-2 was to see hown gwell this generic interface could support ST-2 (and by implication, protocols with performance guarantees ieneral). The key concept underlying the BSD networking code is that of a socket. A socket is a file descriptor mwhich links an application to a particular networking protocol. Once a socket has been created, an applicationakes a series of system calls upon the socket to configure and establish the networking service the applicationndesires. To create a socket, an application calls the socket system call, specifying the protocol family (e.g. Interet, Xerox-Pup, OSI), type of service (e.g. byte-stream or datagram), and optionally, the particular protocol ldesired. If successful, the socket call returns a file descriptor (a positive integer) which provides a link to aargely uninitialized protocol structure. Applications use a series of system calls to initialize the socket. The -cchoice of system calls used typically depends on the type of application which is using the socket. Most appliations try to actively connect themselves to a remote server, which provides some service the application re-tquires. To make the connection, the application calls the connect system call. Given an address structure conaining the address of the server, the connect call attempts to create a connection to the remote server. If thea u connect call succeeds, the socket is then ready for transmitting and receiving data. Applications transmit datsing the write or the send system calls (which are variants of each other). Applications receive data using thes c read or recv system calls (which are also variants). When an application is finished using a socket, the socket ilosed using the close system call, and the connection will be severed. Server applications, which are typicallye bwaiting at some well-known address for requests from other applications, usually call the bind system call. Th ind system call is given an address structure and makes the provided address the local address of the socket. iAfter calling bind, the application usually calls the listen system call to indicate to the kernel that the applications awaiting attempts to connect to it. Connection attempts are then accepted using the accept system call, whichh treturns a new file descriptor linked to the newly created connection. The application can then communicate withe new peer via the new descriptor using the read and write system calls. As commonly used and describedd rabove, the interface is quite simple. Applications call socket followed by connect and are then free to send aneceive data. Servers call socket, followed by bind and listen and then use accept to service new connections. sHowever, there are often some protocol specific options that an application or server may wish to request. Theetsockopt and getsockopt system calls may be used to set or read options for a particular socket. Also, a serverf imay wish to read from multiple connections at once. The select allows an application to check on the status ots file descriptors and learn which ones have data to be read or are ready for writing. Kernel Protocol Tables oInside the BSD kernel, most interaction with a protocol is handled through a protocol switch table. Each familyf protocols (TCP/IP, OSI, etc.) has its own protocol switch table, which is a list of switch entry points, one set lof entry points for each protocol in the protocol family. Implementing a protocol under the BSD kernel is large-y a matter of writing the functions that implement the various entry points. Each switch entry point containss apointers to nine functions (some of which do not need to be defined), plus some protocol flags. Two routinere used to support the application interface. The prictloutput routine is used to handle calls to getsockopt andc setsockopt. All other system calls invoke the priusrreq (``user request'') routine, with an operation code indiating which service is required. These routines must be defined. Inbound traffic from the network is handled klby two other routines. For transport protocols, the priinput routine receives all inbound traffic from the networayer. (Network layer protocols are called from the interface driver via a software interrupt without using the -pswitch table). The prictlinput routine is used to notify protocols of network errors; the prictlinput routine is exected to take the necessary actions required by its protocol to respond to the error. The prioutput routine is) sused to send datagrams. It is only used in special cases; most protocols (including our implementation of ST-2end data by calling priusrreq. The remaining four routines serve general protocol maintenance functions. The n priinit routine is called when the system first boots, to initialize the protocol. The pridrain function (usuallyot implemented) is called by the system when it is short of space, asking the protocol to try to free any ytmemory it can. The prifasttimo and prislowtimo routines are the protocol timeout routines and are called bhe kernel at regular intervals. The fast timer is called five times per second and the slow timer twice a second. sbThe protocol flags in the switch entry are used to flag properties of the protocol to the socket layer (which sitetween the system calls and the protocol routines). The important flags are: iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiflag meaning iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii PPR iATOMIC protocol only exchanges atomic messagesR iADDR application gets the source's address with messages PPR iCONNREQUIRED a connection must be made before sending dataR iRIGHTS a mechanism for passing additional significant informationi cc cc cc ciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiicc cc cc c cc cc cc c ,aIn theory, any combination of these flags is meaningful. Our implementation uses PRiATOMIC, PRiADDRnd PR iCONNREQUIRED. ST-2 Services Not Implemented The implementation does not completely implebment ST-2. For various reasons, a few things have been left out. While the code was designed so that it woulde possible to make the BSD kernel act as an ST router (i.e. an intermediate agent between two networks), thetforwarding code is not complete and has never been tested. We also chose not to implement network-level mulicasting. Note that multicasting should not be confused with support for multiple targets, which the implemenmtation does support. The standard BSD code does not support network-level multicasting and whileodifications to the BSD code are available to implement multicasting, multicasting is a performance enhance-, hment to ST-2 rather than a critical feature and we concluded it was not important to the experiment. (We didowever, structure the implementation such that adding multicast support should be easy). For similar reasons, fwe did not implement the point-to-point option nor the reverse flow option. A more serious omission is supportor HID-CHANGE messages. Recall that HID-CHANGE messages are used to negotiate a valid HID after thet iHID proposed in the CONNECT message has been rejected. We left HID-CHANGE out because we believe is an unnecessarily complex mechanism (see sections 5.2.2 and 5.2.8 below), however its omission means our (implementation will not be compatible with other implementations if the sender initiates negotiation of the HIDas our implementation does). Another omission is support for HELLO, STATUS and (in part) NOTIFY mes-- psages. As described in section 5.2.5 we believe that supporting all three message may be unnecessary. The imlementation does not support timestamps because timestamp negotiation does not work. Experience with thetImplementation Since implementing the protocol, SICS has experimented with running the Network Voice Proocol (NVP) and the Packet Video Protocol (PVP) over the ST-2 implementation [#20,#21]. These experimentst bhave successfully demonstrated real-time delivery of data via ST-2 over a local Ethernet and via the Interneetween London and Stockholm. Note that the ST-2 connections could not allocate a guaranteed flow over ther LEthernet or the Internet and simply assumed the bandwidth would be sufficient. (It wasn't quite enough foondon-Stockholm, so the sound quality was poor). We would like to thank Information Sciences Institute for bmaking their PVP and NVP code available to us for experimentation. The ST-2 Implementation This sectionriefly describes our ST-2 implementation, with a focus on important implementation issues and places wheree fithe BSD code posed problems or challenges to the implementor. ST-2 and the BSD Application Interface Thrst problem in implementing ST-2 was to decide how to fit the protocol under the BSD socket interface. This iproblem was quite difficult for a variety of reasons. Which Version of the Application Interface to Use? Onessue was that the BSD application interface is designed to serve as an interface over transport-layer protocols. sThe address structures are assumed to be transport-layer addresses and the system calls are designed on the as-umption that applications are reading and writing data without protocol headers. To access network-layer orllower-layer protocols, the BSD application interface supports a special type of socket, called a raw socket, to alow applications to read and write datagrams, including protocol headers. Since ST-2 is a network-layer protoscol, one might consider using the raw socket mechanism to support ST-2. Unfortunately, however, the rawocket mechanism is largely stateless. It is intended as a pass-through to allow applications to implement speacial transport protocols over connection-less lower-layer protocols and does not normally support features suchs retransmission and error recovery. But ST-2 requires retransmission and error recovery, and thus seems betterr ssuited for the full application interface. Perhaps we could have implemented the stateful part of ST-2 in usepace over a raw socket interface but this seemed unwieldy and we decided to implement ST-2 as a connection-- poriented protocol, directly under the regular application interface. (Interestingly enough, SUN Microsystems apears to have made the same choice when implementing X.25 [#15]). Problems With the Application Interface. WImplementing ST-2 as a connection-oriented protocol under the BSD application interface was still not easye discovered two major problems and one minor problem with the BSD application interface. Maximum Adbdress Size The minor problem was that the BSD interface limits the maximum size of an address to be 112ytes long, while ST-2 permits addresses of up to 252 bytes. After some thought, we decided to enforce the cBSD limit, as the ST-2 address space is probably far larger than is necessary. This feature of BSD has beenhanged in 4.3 BSD, Networking release 2 (essentially the networking code for 4.4BSD). Addresses can be of 4unlimited size [#22]. However, if one is trying to write code portable to BSD and its earlier variants, the.4BSD changes are not yet widespread enough to base the implementation on. Semantics of Accept A morenimportant problem was that ST-2 expects the application to be able to choose whether to accept or reject a conection attempt and to examine and possibly modify the flow specification before accepting the connection. Thet kBSD interface forces the application to always accept a connection attempt, via the accept system call, before inows who the connecting peer is or any properties of the flow. Again, this feature of BSD has been changed rcin 4.3 BSD, Networking release 2. To accomodate the OSI protocols, the code has been restructured to defeonnection acceptance until a subsequent system call (e.g. recv, send or close is made), thus giving the applica-tion time to consider the request [#22] and examine and update the flow specification using setsockopt and get sockopt. However, once the accept system call has been made, the application can immediately terminate con-- enections from unwanted peers, so while the BSD semantics are not quite the same as those of ST-2, the providd functionality was close enough that we decided not to modify the BSD interface. Semantics of Connect Thedmajor problem was that the BSD kernel enforces a rule that a socket may only be connected to one remote adress at a time. This rule is clearly inappropriate for multi-target protocols, where a single socket may have hmultiple targets. Fixing the one-address assumption turned out to cause multiple minor problems, each of whichad to be solved. First, the connect system call had to be modified to permit multiple calls on the same socket. flIn the standard BSD code, sockets which must be connected before data can be sent (which is true for ST-2) areagged as PRiCONNREQUIRED in the switch entry. While the documentation suggests thatl aPR iCONNREQUIRED simply states that a connection is required before sending data, the connect system calllows only one call to connect for sockets of this type. One option was to change connect to take multiple ad-- tdresses as its arguments, but multiple addresses in one call makes error returns ambiguous. ( Connect only reurns a single error code; how is the application to know to which address the code applies?). Instead, we tchanged connect to permit multiple concurrent calls. An an additional flag, PRiMULTICONNECT, was addedo the protocol switch table, which indicates that even if a connection is required, multiple calls to connect are-acceptable. Modifying the connect system call to allow multiple calls created a new problem. In , dupliUNIX e gcate copies of a file descriptor may be shared. As a result, after a socket has been created, copies of it may biven to multiple applications, all of which may call connect on the socket. When connect only permitted onetcall, this scenario was harmless. The first call made the connection and the subsequent calls failed. But if muliple connect calls are permitted, then the connect call has to support multiple concurrent calls on the same sock-- tet; in other words, it must be multi-threaded. So we enhanced the code path in connect to support multihreading. Note that one potential problem with the BSD connect interface is that it forces the application toy hadd new peers one connect call at a time. It has been suggested by one of the ST-2 designers that this maave undesirable interactions with routing. The question is whether a routing system can better choose the ap-- bpropriate routes for a stream if it has complete knowledge of all targets when the stream is first being estalished. We do not know the answer to this question. Need for a Disconnect System Call Finally, given that an sapplication could connect to multiple remote addresses, it had to be possible for applications to disconnect fromelected addresses. In fact, the BSD kernel has support internally for disconnecting particular remote addresses, cbut lacked a system call to allow applications to access the internal code. So we added a disconnect systemall. (Adding new system calls is simple in UNIX systems, and most binary distributions of UNIX permit easy -iinstallation of new system calls). ST-2 in the BSD Kernel Once its application interface is defined, implementng a protocol in the BSD kernel is largely a matter of defining the basic data structures and then writing the -pvarious entry-point routines for the protocol switch table, and their subroutines. This code can be quite comlex. For example, the ST-2 implementation is over 6,500 lines of C code. In contrast, the 4.3BSD Reno distri-pbution implements TCP in about 3,900 lines of C code and a BSD implementation of RDP (a protocol of comlexity similar to TCP) required 2,700 lines of C code. Data Structures The major data structures in the ST-2 ,timplementation are the protocol control blocks (PCBs) and the timer control structures. For every ST-2 streamhe kernel builds a two-level tree data structure. At the root of the tree is a stream PCB. Its children are hop, tPCBs. Data flows down the tree: when an application writes data to a stream or a packet arrives for a streamhe data is forwarded to all the hops for that stream. The stream PCB contains all global stream informations e(such as the stream's name and origin) and all the information necessary to manage the upstream peer, which iither an application (if the stream originates locally) or the previous ST hop. This information includes the psocket pointer if the upstream peer is an application, or a collection of ST-2 state information if the upstreameer is another system. The hop PCB contains all the information necessary to send data downstream to the onext hop. Note that the next ``hop'' is in some cases an application; the hop PCB can point to a socket insteadf a next hop address. One complicating feature of ST-2 is that a hop can be in multiple states at once. For exnample, a hop can be connected to its remote peer and ready to send data, while at the same time the hop isegotiating with its peer to add additional targets or to change the flow specification. Trying to track multiple, tstates in a single hop PCB proved quite confusing, so the implementation uses shadow hop PCBs. For each hophere is one primary PCB, through which all data is forwarded, and zero or more shadow PCBs. Each shadow acPCB manages a particular SCMP control exchange such as the addition of a new target or the negotiation ofhanged flow specification. Once the negotiation is completed, the results are folded back into the primary hop mPCB and the shadow is deleted. The timer structure is used to manage SCMP retransmissions. For each SCMPessage, a separate timer structure is created which manages the retransmission of the message. If the message ois acknowledged, the timer is turned off. If the message times out, the message is resent and the timer is backedff. If the message times out several times, the attempts to retransmit are viewed as having failed and the Jaffected part of the ST-2 stream is disconnected. Round-trip time estimation is done using Karn's andacobson's algorithms [#9,#10]. Our implementation organizes the PCBs in doubly-linked lists. We originallya Stried to use arrays indexed by the HID as suggested by the specification (p. 58), but one of our test systems (UN 3/60 running MACH 2.5 with the BSD networking code) ran out of memory with tables much over 32,000h fentries so we used linked-lists instead. The problem was that the kernel memory space began to overlap witrame buffer memory, which caused strange errors. The table was simply an array of pointers, so the size was dabout 128 Kbytes. The pr iusrreq Routine The priusrreq routine is essentially a large switch, to handle 21ifferent types of requests. (Some BSD system calls cause multiple requests to be made of the priusrreq rou--tine). The major question when writing the pr iusrreq routine is whether to try to be fast and avoid extra subrou tine calls, or write modular code and use subroutine calls to handle each type of request. We chose clarity over cspeed, and implemented every request as a call to a subroutine. Implementing the subroutines was less of ahore than it sounds, as only 11 types of requests are actually relevant to ST-2 (the rest are no-ops or errors). vThe Output Routines Most calls to ST-2's priusrreq routine eventually cause an SCMP message to be sent. Thearious SCMP messages are very different in the information they carry, so we chose to write a separate routine -pto generate each different SCMP message type. In general, this approach worked very well. It was, for examle, easy to set debugging break points to trace the sending of a particular message type. The one nuisance wabout this approach was that there was a lot of replicated code in the SCMP message routines and when a bugas found in the replicated code, one had to be sure to fix every instance of the bug. The SCMP routines allt ocall a single ST output routine, stioutput1, which sends an ST packet to a single destination. When data is senn a socket, the routine stioutputall is called, which then repeatedly calls stioutput1 to send a copy of the packiet to each of the downstream hops. The Input Routine To make input work for ST-2, we had to modify the IPnput routine to recognize IP packets with an IP version of 5 as ST packets and call the ST input routine, p stiinput. Stiinput confirms that the ST packet is valid and for a known HID. If there are any problems, theacket is discarded. If the HID is 0, the packet is passed to the SCMP input routine, sciinput, otherwise thes tpacket is forwarded to the next hop or delivered to the local target (as appropriate). The sciinput routine checkhat the SCMP header is valid and then calls the input routine for the particular SCMP message type. As with etSCMP output and for the same reasons, we chose to implement a separate input routine for each SCMP messagype. ST-2 over IP In addition to being used as a native network-layer protocol, ST-2 can also be encapsulated rIin IP. The implementation supports ST-2 over IP mode as transparently as possible. Sending ST-2 packets oveP is supported by use of a dummy network interface. Any data given to the dummy interface's output routine euis simply encapsulated in an IP datagram and sent via IP. If a sending application requests ST-2 over IP modsing setsockopt, the stictloutput routine simply adjusts all PCBs to use the dummy interface. This indirection. Ais transparent to all the SCMP and ST-2 transmission routines. Receiving ST-2 packets over IP is a bit hardertransport-level entry point had to be defined for ST-2, so that IP could call ST-2 as a transport layer. This tmroutine strips off the IP header and calls stiinput, with a flag that the ST-2 packet came in over IP. Stiinpuust be informed which mode an ST-2 packet arrived in because the message may be an SCMP message that vrequires an acknowledgement. SCMP must know whether to send the acknowledgement or error message backia native ST-2 or IP. So when the ST-2 transport layer routine is called, it calls stiinput with a flag to indicate. Nthat the ST-2 packet arrived via IP and this flag has to be passed up to all the ST-2 and SCMP input routinesote that while the ST-2 and SCMP code must keep track of whether packets arrive via native ST-2 or IP, thisl iinformation is hidden from receiving applications. When an application listens on a socket, it will receive alncoming requests via either ST-2 or IP. If curious, an application can call getsockopt to learn whether the pareticular ST-2 connection is running over IP. Managing the Flow Specification SCMP assumes that there is somentity, possibly external to the SCMP protocol itself, which manages the availability of resources. SCMP passes (the flow specification to this entity to request stream resources. The entity is responsible for establishing a flowif possible) consistent with the flow specification and updating the flow specification to reflect the stream pro-- nperties achieved. In the BSD code, we felt the most logical place for this entity to reside was in the peretwork interface code. The interface code is the place where most network-specific information is kept andwthus it seems logical to negotiate with the interface code for flow specifications. Like interactions with the netork layer, interactions with the interface drivers are managed through a fixed suite of five routines: ifiinit is tiused to initialize the device; ifioutput is used to send data; ifiioctl is used to serve I/O control requests; ifireses used to reset the interface; and ifiwatchdog is a timer routine, usually used to catch lost interrupts. In addi-- stion, input from the interface is managed by calling the per-network-layer specific input routines. Various verions of the BSD code add some additional routines to these six, but this is the common set of routines. Our. Wimplementation assumes that negotiation of flow properties is handled through the ifiioctl and ifioutput routineshen a stream is first being established at an upstream agent, the agent establishs a flow by calling the ifiioctl flroutine with the flow specification. The ifiioctl routine establishes the flow (if possible) and returns the updateow specification along with a flow identifier. This flow identifier is then passed to ifioutput on every packett wtransmission. If the flow fails, ifioutput can return an error code that indicates the flow has failed. (Note thahile code for this flow negotiation exists in our implementation, it hasn't been tested because we did not have taaccess to networks that supported guaranteed flows). Problems with the BSD Routing Code ST-2 expects than agent will be able to consider and potentially try to use all the possible routes to a destination. This expectarption implies that the system routing tables must be able to return a list of all possible routes to a destination (orovide some mechanism for learning of alternate routes). The BSD routing code only returns a single route, swith no mechanism for finding alternate routes. Evaluating ST-2 When evaluating ST-2 we found it useful totructure our thinking around three distinct questions: Is the ST-2 philosophy appealing? ST-2 is the reflection of aa particular philosophy about data communication; summarized in brief, this philosophy can be characterized asrguing that certain types of applications such as multimedia applications require networks that can establishuguaranteed data flows. The ST-2 protocol specification is, in part, an attempt by researchers to express a particlar view about how this philosophy should be implemented. It is useful to consider some of the philosophical vdecisions that were made. Can ST-2 be simplified and still provide the same services? ST-2 was defined as aehicle for research in networking support for multi-destination isochronous applications. Based on our experi-cence, could ST-2 be improved to serve this function better? Is the ST-2 specification well-written? Is the protool specification clear and largely free from errors and ambiguities? In short, can one be sure that if one under-stands the specification, one understands the protocol? This section discusses each question in turn. ST-2 Philo sophy ST-2 was designed by a group of researchers who believe that to support applications with strict perfortmance requirements it is necessary to install state information on all nodes in the path from the data source tohe data sink. Whether these applications require the installation of state information, and if so, how much stater ginformation must be maintained is currently a subject of hot debate in the networking community. One of ouoals in implementing ST-2 was to try to get a better insight into this debate. While the problems with thecspecification made a proper evaluation of the ST-2 philosophy difficult, we did encounter interesting philosophial issues during the implementation and continue to feel that the general ST-2 philosophy is intriguing. This Tsection discusses our views about some of the more philosophical features of ST-2. Nice Features of ST-2here were two properties of ST-2 that we particularly liked. Negotiation of Flow Properties One nice idea was pthe principle that each agent modifies the flow specification to reflect the flow properties the agent could actuallyromise with the final flow specification being returned to the origin for a final decision about whether the pro-- gperties achieved were sufficient. We see at least two advantages to this approach. First, in cases where the oriinal flow specification could not be met, the origin gets a more useful reply than a yes-no answer. The origins pcan decide if the delivered flow seems sufficient, with some confidence that if the flow is not sufficient, it irobably still all the network can offer. Second, the ST-2 mechanism eliminates possibly extended negotiationa flover flow parameters at each hop. This feature would seem likely to reduce the time necessary to establishow. Targets Specified by Origin We also believe that allowing the origin to specify its targets is a usefult tfeature. The origin can better control who its data reaches and how that data is delivered. One question abouhis scheme, however, is whether the list of targets could become too large for the origin to manage. Less wPleasant Aspects There were a couple of philosophical decisions about ST-2 that we found ourselves disagreeingith. Problems with the strict separation of data and control information appeared during the implementation. cAnd we have questions about the design of the flow specification. Separation of Data and Control ST-2 almostompletely separates data and control information. Other than the HID, ST packets contain no informations nabout where they came from, where they are headed, or the type of traffic they contain. All such information iegotiated via SCMP. The reason for keeping all state information out of ST was to keep the ST headers small, pwith the expectation that smaller headers would be faster to process in the ST agents. The implementation ex-erience suggests that ST-2 may separate data and control information a bit too much. In particular, it is more pdifficult to recover from failures. For example, if an ST agent crashes and reboots, it may start receiving STackets for the streams that it previously supported. Unfortunately, because the ST packets contain only an. EHID, it is impossible for the ST agent to determine which upstream agents need to be notified of its failureventually a HELLO message should timeout and turn off the flood of packets but if by some chance, the HELhLO mechanism fails, the consequences can be painful. (While debugging our code without HELLO support, weit a situation in which one of our rebooting systems was so flooded with unwanted ST packets it could not remboot!) The key problem with complete separation of control and data is that either the control or the data pathay fail while the other path is still working, leading to odd failures. For example, at one time, our implemenotation had a bug which caused it to fail to properly acknowledge ACCEPT messages. The result was that therigin would receive the ACCEPT message, establish the connection and begin sending. The target would startt areceiving and reading the data (since the target assumes the connection is open once it sends the ACCEPT). Bufter several retransmissions, the ACCEPT message would time out and SCMP would shutdown the connection, ton the assumption that a protocol failure had occurred. Observe that the obvious fix to this problem (to turn offhe ACCEPT retransmissions when the data starts arriving at the target) doesn't work. If there is an existing tareget at a system, and the origin adds a second target at that system, data may be flowing down the stream for thexisting target even if the ACCEPT message for the new target never gets through. One needs some mconfirmation that an individual target's ACCEPT message has been seen. To avoid these scenarios, it probablyakes sense to carry a modest amount of control state information in every data packet. (Our view is that if ane aagent receives a ST packet in error, the packet should contain enough information that the agent can take somction to try to prevent further errors from occuring). In ST-2's case, we think that adding the IP address of the. (previous hop, and perhaps reference numbers of the most recently seen SCMP control messages is sufficientNote that the source link-layer address of the previous hop would also be sufficient). Specifying Flow Proper-. Fties The ST-2 Flow Specification is extremely detailed, ennumerating fourteen different performance parametersurthermore, the specification permits applications to add additional fields to the flow specification if desired. iThe reason for all the detail was to permit researchers to experiment with a wide variety of parameters. Thisdea is consistent with some exploratory papers on flow management [#23,#24]. For a few reasons, we find oureselves wondering if a large flow specification is still the right approach. In particular, we believe that it is moreffective to try to identify the minimum number of parameters necessary to provide the required range ofsguarantees, and test that set, rather than provide an all-one-could-want experimental space. (ST-2 makes it posible to extend the Flow Specification, so if the minimum set proves too small, one can still add new variables). tFirst, while the large number of variables gives large opportunity to experiment, it also can hinder experimenta-ion. A large number of variables means there is a large state space of factors to study. Performance analysts, ctypically recommend working with a selected small set of factors [#17]. (To see how problems might ariseonsider two ST-2 experiments in flow allocation techniques, each of which only used three variables in the flowaspecification to specify the flow and ignored the other eleven. If the two experiments use disjoint sets of varibles, it is not clear how to compare the results of the experiments). Second, a smaller set of parameters makes Sit more likely that a particular network has the mechanisms to support the particular type of flow desired. SinceT-2 is designed as an internetworking protocol, maximizing the types of networks it can operate over would aflappear desireable. Third, there is now some paper and pencil analysis that suggests that guaranteed multimediows can be specified using only two or three parameters (delay, bandwidth, and possibly, interpacket delay ssvariance) [#18,#19]. While much of this work has been done since the ST-2 specification was produced, it doeuggest that an experiment using a very small set of variables is appropriate. Can ST-2 Be Improved? Based econ our implementation experience, we believe that the ST-2 protocol and in particular, SCMP, could be madonsiderably simpler and still both provide the same functionality and be a useful vehicle for research. This secrPtion suggests some ways in which the protocol could be made simpler. A Minor Nuisance in Handling ErroDUs The specification provides a method for returning part of the SCMP message that is in error in ERRORpIN-REQUEST and ERROR-IN-RESPONSE messages. A portion of the SCMP message that was in error plus aointer to where in the message the error was encountered are encapsulated in an SCMP parameter. Returninga nthe message found to be in error is useful, but requiring a pointer to where the error was encountered proveduisance. Keeping the pointer requires that all the SCMP input code, through all its subroutines, be able to. Ftrack offsets into any SCMP message being handled, on the chance the message may turn out to have an errorurthermore, there is often ambiguity about where an error occurred. For example, if a parameter is shorter thant pits length field indicates, is the pointer to point to the parameter's length field, or to the last byte of the too-shorarameter? (Our implementation realizes the problem only at the last byte of the undersized parameter). FinalHly, what about errors where the SCMP message is inconsistent with local state information? For example, if theID and the stream Name are inconsistent, is this an error in the HID field, the Name parameter, or should it bee pconsidered a state inconsistency in the agent's code (and if it is a state inconsistency, what does one put in thointer field?). While returning the message in error is useful, the pointer to the place the error was discoveredsis of limited value and a modest nuisance to the implementor. Given that this parameter is optional, this nuiance is not severe (one can just not return the parameter). However, in the interests of encouraging the returnn aof error information the pointer should probably be eliminated. HID Negotiation at Connection Time When agent sends an SCMP CONNECT message with an HID and the next hop refuses the message with an HID-- tREJECT, the next hop must still process the CONNECT message and the connecting agent is expected to coninue negotiation with an HID-CHANGE message. This procedure seems unnecessarily cumbersome. It requires othe next hop to try to process a CONNECT message and begin to build data structures, even though a key piecef information, namely the proper HID, is missing. (It may be difficult to install the ST forwarding informationo dwithout the HID, because the HID is the primary lookup key for ST). It causes the next hop to support twifferent code paths for processing a CONNECT message: a path for handling CONNECT messages with goodt wHIDs, and a path for handling CONNECT messages with bad HIDs followed by HID-CHANGE messages. Iould seem far simpler to just have the connecting agent resend the CONNECT messages with a new HID. dUseless TargetList Parameter SCMP messages contain a parameter called a TargetList, which contains the ad-resses of the targets that the message pertains to. The goal of the TargetList is to consolidate all the target inbformation in one place. Unfortunately, the TargetList parameter is defined as having a maximum length of 256ytes, while the largest target can be 252 bytes. Thus if a message has multiple Targets, more than one TargetnList parameter may be required to transmit them all. The ST-2 specification (p. 96) recognizes this problem andotes ``an implementation should be prepared to accept multiple TargetLists in a single message.'' Clearly this jfeature is unnecessary. If an implementation must be able to read multiple TargetLists in one message, it couldust as well read multiple target parameters, unencumbered by the extra layer of wrapping. As currently rspecified, the TargetList parameter is extraneous. Many and Unhelpful Reason Codes The purpose of SCMPeason codes is to convey information about the reason for an error message, or for modifying a stream (e.g. twith a REFUSE or DISCONNECT message). Unfortunately, the system of reason codes is inadequate to thisask. First, the list of reason codes attempts to be exhaustive. It currently includes sixty-five different codes, in-l Pcluding codes noting that oversized UserData parameters have been encountered (code 64) and that a controDU contains a duplicate target (code 23). Unfortunately, despite its length, the list is not comprehensive; our aimplementation includes several cases where no reason code matched the error encountered. (For example, therere no error codes for for the following situations: problems with IP make it impossible to set up an ST over IPd bconnection; one of the VLIs is in error; or the target in an ACCEPT message is not one of the targets requestey the origin). Furthermore, the vast majority of reason codes do not seem to apply: our implementation usesmless than a third of the codes defined. We suspect that the current list of reason codes reflects particular impleentations and that as new implementations are done, new reason codes will have to be added to the list. In. Sshort, the notion of a comprehensive set of reason codes would appear to be an ``m*n'' protocol featureecond, while the specification states that reason codes are to be used to disambiguate fatal conditions froms cmore benign errors, the specification does not indicate which codes are fatal. Nor are any bits in the error codelearly reserved to indicate fatal versus non-fatal errors. This means that if different implementors interpret thetsame reason codes differently (e.g. one views a reason as benign, the other as fatal), surprising protocol interacions may occur. For example, the specification generally encourages the immediate retransmission of messages iin response to an error message, when possible. If the agent sending the error message believes the reason codendicates no retransmission is possible, while the receiving agent believes the error code is benign, a loop of erbror messages and retransmissions will occur. A better reason code scheme would define the reason code field toe a bitmap, with bits reserved to indicate fatal and benign error codes, and perhaps a few general error codes toa findicate roughly how an error occurred. We understand that the committee designing ST-2 considered usingatal bit but decided not to. Given hindsight, we believe the bit is necessary. Timestamp Negotiation Doesn't dWork There is a mechanism in SCMP to negotiate whether timestamps should be included in ST packets. Asefined, the negotiation scheme doesn't work. An SCMP CONNECT message sends a two-bit timestamp propo sal to the target. The meanings of the bit values are: iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ibits meaningiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 000 no proposal.1 cannot insert timestamps. . 110 must always insert timestamps1 can insert timestamps if requested.i cc cc cc ciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiicc cc cc c cc cc cc c saThe ACCEPT message contains a two-bit reply to the timestamp proposal. The interpretation of the two bitre: iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ibits meaningiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 000 not implemented.1 no timestamps are permitted t 110 timestamps must always be presen1 timestamps may optionally be presenti cc cc cc ciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiicc cc cc c cc cc cc c ttObserve that the following non-working scenarios are possible: Conversations with the designers indicate thaimestamp negotiation wasn't intended to work in all cases -- the idea was that systems could experiment with ,ttimestamps and that if a non-working scenario was encountered, the stream would be torn down. Unfortunatelyhe specification does not indicate that timestamp negotiation was not intended to work in all cases, nor does it Csay what to do when the negotiation fails. CONNECT message proposes ``must always insert timestamp.'' AC-EPT message replies ``no timestamps are permitted'' or ``not implemented.'' CONNECT message proposes o``cannot insert timestamp.'' ACCEPT message replies ``timestamps must always be present.'' The specificationffers no guidance on how to resolve these conflicts. Furthermore, it is not clear what is to be done if, intresponse to a CONNECT message offering ``can insert timestamps if requested,'' some targets request timesamps and others decline timestamps. Perhaps intermediate agents could remove timestamps for those targetssthat do not wish them but this solution would make agent processing more complex. There are a couple of posible solutions. A completely interoperable timestamp scheme could be used. A one bit scheme in which the, aorigin offers to send timestamps and the targets indicate if they can accept timestamps would work. Alternatelyone bit scheme in which the origin insists on sending timestamps and targets which cannot accept timestamps amust refuse the connection, would also work. The current scheme, however, is much less than optimal. Welso wonder if timestamps are a useful or necessary service for ST to provide. Since timestamps are required on Ma per-application basis, perhaps the applications should implement their own timestamping schemes? HELLOessage Unnecessary? SCMP has four different mechanisms for detecting various types of problems in aa sstream or in the communication between ST agents. There are STATUS messages (to check on the state oftream), NOTIFY messages (to advise neighboring agents of problems such as routing loops) and HELLO mesasages (used to periodically confirm that neighboring agents are up and to notify neighboring agents when angent restarts). Furthermore, there is information from the ST data stream itselfi; the arrival of an ST packet is ra fairly strong indication that the upstream agent is still functioning. We believe that it should be possible toeduce the number of failure recovery and notification mechanisms. The most tempting candidate for eliminaction is the HELLO message. HELLO uses a ping mechanism. Agents regularly exchange HELLO messages toonfirm that neighboring agents are still up. However, in most cases, all neighborying agents will be up, so the dHELLO messages are simply consuming bandwidth. For this reason (and others), some protocol suites stronglyiscourage pinging between non-router systems (see, for example, page 52 of [#14]). Another concern is that othe HELLO mechanism requires agents to track peer agents separately from streams. While not a particularlynerous task, tracking peer agents can imply more data structures, more timers and more complexity. Finally, itt iappears that the function of the HELLO message is redundant. Receipt of a valid ST packet from another agens implicit confirmation that the agent that sent the ST packet is functioning. If an agent has not sent an STe apacket in a reasonable period, a STATUS message for any of the streams through that agent will confirm thgent is still up. When an agent reboots, it can notify the upstream agents of the loss of state when it receivessST packets for unknown streams. Note that this mechanism requires that agents ensure that each of their downtream neighbors periodically receives an ST packet, even if all streams through those neighbors are idle. But bthis is a very different requirement than pinging regularly with a HELLO message. In summary, there appear toe an excess of failure recovery and notification mechanisms in ST-2. We suggest that at least one of those lmechanisms be eliminated and suggest the HELLO message is the logical candidate for deletion. This reasoningeads us to believe the HELLO message could be eliminated. Multiple Addresses for the Same Stream In ST-2, Sa stream can be identified three different ways: by its unique name, by the HID of a particular hop, or by theCMP sender and receiver VLIs. That is one too many addresses for the same stream. Because the streamr aname is designed to be globally unique, it is arguably too big to use as a primary address, so a second, simpleddress such as an HID is useful. However, the HID and the VLIs uniquely identify the same hop in the same tstream, so there's no reason for both of them. We actually tested this view in our implementation by makinghe VLIs equal to the HIDs. In other words, the SCMP VLI at an agent was always the same as the HID of theastream. This approach caused only two minor problems. The first problem appeared while running ST-2 over software loopback, so that the hop both originated and terminated on the same machine. In this situation, theree mexisted both an outbound stream and inbound stream with the same HID and thus the same SCMP VLI. Sincost SCMP messages are directional, it was usually clear which type of stream the message was for and theree twas no problem looking up the right one using the HID. However, ACK messages (and some other messagypes) can travel in either direction, and so there was ambiguity about which stream to look up. Note that thet osame problem can occur if the various HID spaces Our implementation originally used a single HID space bune could have many distinct HID spaces in one agent. For example, different spaces for upstream and down-- lstream nodes, or HIDs on a per-interface basis. are distinct, so the ambiguity is probably indicative of a probem with ACK messages (they do not indicate direction) rather than the need for having both HIDs and VLIs. dThe second problem occurred in HID negotiation at connect time. When the initial HID is rejected (asescribed in section above), the rejecting agent is expected to return an SCMP VLI. The connecting agent theng acontinues the HID negotiation by sending the HID-CHANGE message to the VLI provided by the rejectingent. Because the implementation only choses a VLI after a valid HID was found, this negotiation does not awork. But, as discussed in section above, we believe the CONNECT followed by HID-CHANGE negotiation isbad idea anyway. Note that if an agent decides to change an HID once the connection is established, theichange works correctly with just HIDs as addresses. To ensure that data continues to flow, the change mechansm must take the form of first adding a new HID to the stream, then deleting the old HID. So when the new. THID is added, there are briefly two HIDs pointed to the same state information. Then the old HID is deletedhere is no need for VLIs to make this negotiation work. More generally, from the implementors' point of dview, there is a strong interest in minimizing the number of different ways a stream can be identified. Eachifferent method of addressing requires a different look up scheme, all for looking up the same state informaation. Furthermore, a conservative implementation will properly confirm that all addresses provided in a messagere consistent. For example, if an inbound SCMP message contains both a VLI and a name, the receiver shouldqcheck that the pair of addresses are consistent with what the receiver has. More addresses means a potential reuirement to do more consistency checking. We believe SCMP would be simpler if one of the naming schemes lwere abolished (probably the VLIs). Evaluating the ST-2 Specification The ST-2 specification has a relativelyarge number of mechanical errors when compared with other experimental specifications that the authors havetimplemented. This section discusses some of the mechanical failings that caused problems for the implemenors. The point of this discussion is to note that that the specification probably needs editing before it is moreswidely used. Inconsistencies in the Specification One problem in the specification is a modest number of inconistencies. For example, page 118 states: Either agent may terminate the negotiation [to find an HID for a connection] r R by issuing either a DISCONNECT or a REROUTE. The agent that issued the HID-REJECT may issue a REFUSE, o EROUTE at any time after the HID-REJECT. Unfortunately, no REROUTE message is defined in the specification. Simi. N larly diagrams of HID negotiation on pages 62 and 63 mention HID-CHANGE-DELETE and HID-CHANGE-ADD messages o such message exists - the intended message types are the HID-CHANGE message with the D or A bits turned on. Finalt m ly, the specification often refers to the HID-APPROVE message as the HID-ACCEPT message. Another inconsistency is tha ost of the SCMP message format specifications (pages 100-126) show that the link reference field is to be filled in but, unr c fortunately, the link reference field only makes sense in cases where a control message is being sent in reaction to anothe ontrol message. But there are several messages that do not reply to other control messages, including the STATUS, HELa LO, DISCONNECT, and CONNECT, for which a link reference value is specified. Furthermore, acknowledgement messages re supposed to use the reference field to acknowledge a message, but for some of these messages (HID-REJECT, HIDs CHANGE, HID-APPROVE, ACK, ERROR-IN-RESPONSE, ERROR-IN-REQUEST, and CHANGE-REQUEST) the pecification indicates the link reference field should also be filled in and does not explain what value to use. Lack of Formal s Definition A more serious problem with the specification is a lack of any formal presentation of the protocol, in the form of tate tables, pseudo-code, or expression in a specification language. A formal description is important for several reasons. If m expressed in pseudo-code or a specification language, the formal description often helps the implementor verify that an imple entation is conformant. By fully describing the state space, the formal description helps the implementor determine the d proper data structures around which to structure his or her code. Finally, a formal description is a useful tool in helping esigners of a protocol confirm that it is complete. We were particularly hampered by the difficulty of determining the state e s space and designing the right data structures. We believe that the ST-2 state is best thought of as the combination of th tates of each hop with respect to each target but wish we had received better guidance. Conclusions From the implementa- t tion experience, we can offer three major conclusions: The BSD networking code proved very flexible, able to support a pro ocol providing a novel communications paradigm with only minor changes. ST-2 proved to be a difficult protocol to imples ment. Some of this difficulty was due to problems with the protocol, but much of the difficulty was due to problems with the pecification. The absence of formal descriptions, the various confusing mechanical errors and some redundant functionality a s made the implementation process more painful than necessary. The specification is in need of revision. It appears that ubstantially simpler version of ST-2 could still provide the same service. Some ideas about how the protocol could f t simplified are presented in Section 5. We believe that such a simplified protocol would be a more interesting proponent o he ST-2 philosophy. On a lesser note, the problems encountered with strict separation of control and data messages lead us g to believe that such a separation is not consistent with robust internetworking. We also feel that more thought needs to be iven to defining a minimum set of flow parameters. Combining these conclusions into a general review, we offer the folp lowing high-level review. The idea that multipoint isochronous applications require connection-oriented multipoint network rotocols is an interesting one that could benefit from further study. We are less sanguine about the current version of ST-2 y v as a vehicle for doing that further study. The basic concepts underlying the design of ST-2 have largely been validated b ersion 1 of ST. As a result, the experimental interest is not in simple proof of concept testing, but rather in widespread ex- f perimentation with the protocol. In its current form, ST-2 is not ready for widespread distribution. Acknowledgements For attarna vill tacka dem som har gett synpunkter pa utkast till denna uppsats; Alex McKenzie, Bob Braden, Steve Blumenthal, d Steve Casner och sarskilt Charlie Lynn for speciellt insiktsfulla kommentarer. Vi vill ocksa tacka Joachim Nilsson och Ricaro Civalero for arbetet att flytta PVP och NVP till var implementering. Forfattarna ar ansvariga for innehallet endast i denna M uppsats. English translation: The authors would like to thank a number of people who reviewed drafts of this paper: Alex cKenzie, Bob Braden, Steve Blumenthal, Steve Casner, and especially, Charlie Lynn, whose comments were extraordinary a in their insightful detail. We would also like to credit the work of Joachim Nilsson and Ricardo Civalero on porting PVP nd NVP to run over our implementation. The authors are solely responsible for the content of this paper. References J. c Postel. Internet Control Message Protocol, RFC-792. Internet Request for Comments, no. 792. September 1981. C. Topolic, Ed. Experimental Internet Stream Protocol, Version 2 (ST-II), RFC-1190. Internet Request for Comments, no. 1190. OcC tober 1990. R.M. Sanders, and A.C. Weaver. ``The Xpress Transfer Protocol (XTP) - A Tutorial,'' in ACM SIGCOMM omputer Communication Review, October 1990, Vol. 20, No. 5, pp. 67-80. G.M. Parulkar, ``The Next Generation of Inter. N networking,'' in ACM SIGCOMM Computer Communication Review, January 1990, Vol. 20, No. 1, pp. 44-53. D. Mills etwork Time Protocol (Version 2) Specification and Implementation, RFC-1119. Internet Request for Comments, no. 1119. , R September 1989 (Revised February 1990). B. Braden, D. Borman, and C. Partridge, Computing the Internet Checksum FC-1071. Internet Request for Comments, no. 1071. September 1988. T. Mallory, and A. Kullberg, Incremental Updating d I of the Internet Checksum, RFC-1141. Internet Request for Comments, no. 1141. January 1990. J. Forgie, ST - A Propose nternet Stream Protocol, IEN-119. Internet Engineering Note, No. 119. September 1979. V. Jacobson, ``Congestion . P Avoidance and Control,'' in Proc. ACM SIGCOMM '88, pp. 314-329. Stanford, California. August 1988. P. Karn and C artridge, ``Improving Round-Trip Time Estimates in Reliable Transport Protocols,'' in Proc. ACM SIGCOMM '87, pp. 2-7. t Stowe, Vermont. August 1987. S.J. Leffler, M.K. McKusik, M.J. Karels and J.S. Quarterman. The Design and Implementaion of the 4.3BSD UNIX Operating System. Addison-Wesley, 1989. W. Edmond, K. Seo, M. Leib and C. Topolcic. ``The r 1 DARPA Wideband Network Protocol,'' in Proc. ACM SIGCOMM '90, pp. 79-89. Philadelphia, Pennsylvania. Septembe 990. J. Postel, Ed. Internet Protocol, RFC-791 Internet Request for Comments, no. 791. September 1981. R. Braden, Ed. 1 Requirements for Internet Hosts -- Communication Layers, RFC-1122. Internet Request for Comments, no. 1122. October 989. Sun Microsystems Inc., SunLink X.25 Packet-level and HDLC Programmer's Guide. April 1989. S. Casner, K. Seo, . M W. Edmond and C. Topolcic. ``N-Way Conferencing with Packet Video,'' in Proc. 3rd Intl. Workshop on Packet Video arch 1990. Morristown, New Jersey. R. Jain, The Art of Computer Systems Performance Analysis, John Wiley, 1991. P Dinesh Verma and Hui Zhang and Domenico Ferrari, ``Guaranteeing Delay Jitter Bounds in Packet Switching Networks.'' roceedings of TriComm'91, Chapel Hill, North Carolina. April, 1991. Domenico Ferrari and Dinesh Verma, ``A Scheme , 1 for Real-Time Channel Establishment in Wide-Area Networks.'' IEEE Journal on Selected Areas in Communications. April 990. D. Cohen. A Network Voice Protocol NVP-II. USC/Information Sciences Institute, April 1981. E. Cole. PVP - A e N Packet Video Protocol. W-Note 28, USC/Information Sciences Institute, August 1981. K. McKusick and M. Karels. Cours otes for 4.3BSD UNIX Internals: Data Structures and Algorithms. Oxford-Berkeley Summer Engineering Programme, 1991 . 2 (8-12 July 1991). D. Ferrari, ``Client Requirements for Real-Time Communication,'' IEEE Communications Magazine, VOl 8, no. 11, November 1990, pp. 65-72. R. Droms, B. Haber, F. Gong and C. Maeda, ``Report from the Joint l 1 SIGGRAPH/SIGCOMM Workshop on Graphics and Networking,'' Computer Communication Review, Vol. 21, No. 2, Apri 991, pp. 17-25