Implementations
We have developed a model for switch control through the internetwork which we believe to be reasonable. However, we have experimented with three different source host implementations. These different implementations are detailed here.
Switch control
Our simplest design decisions involved the switch itself. We decided that the complex protocol and dial up line must be hidden from the source host requesting the switched link. We decided that the source host would use a simple request/release protocol with messages sent through the regular network (as opposed to dial up lines or other connections). Some host accessible through the local network would run a program translating the simple request and release messages into the more complicated switch protocol and also have the modem to handle the dial up connection.
This has a variety of advantages. First, it isolates differences in switch hardware. Second, multiple hosts may access the switch without requiring multiple modems for the dial up line. And it provides a central point of control for switch access. We did not consider any alternatives to this model of switch control.
Our initial implementation used a simple translator daemon running on a Sun workstation. Listening on a raw IP port, this program would wait for switch control messages. Upon receipt of such a message, it would dial up the switch and attempt to handle the request. It would then send back a success or failure response. This host, in conjunction with the translator daemon software, is referred to as the switch controller. The switch controller we used was local to our enterprise network; however, it could reside anywhere in the Internet.
Later we designed a simple protocol for switch control, which was implemented in the translator daemon. This protocol is documented in RFC 1307, "Dynamically Switched Link Control Protocol".
Source Control of the Switched Link
This problem involves a decision regarding what entity on the source host will issue the switch request and release messages to the switch controller, and when those messages will be issued. Because we do not have very much field experience with this service, we do not feel that it is appropriate to recommend one method over the others. They all have advantages and disadvantages.
What we did do is make 3 different implementations of the request software and can report our experiences with each. These are one set of special utility programs which communicate with the switch controller, and 2 kernel implementations. We did not experiment with special libraries, nor did we implement a daemon for switch control messages on the source host.
Switch control user programs
This implementation of source host control of the switch is the simplest. Two programs were written which would communicate requests to the switch controller; one for activating the connection, and another to deactivate the connection. The applications using this feature were then put into shell scripts with the switch control programs for simple execution.
This approach has the significant advantage of not requiring any kernel modifications to any machine. Furthermore, application programs do not need to be modified to access this feature. And access to the circuit-switched links can be controlled using the access permissions for the switch-control programs.
However, there are disadvantages as well. First, there is significant potential for the switch to be active (and billing the user) for the dead time while the application program is doing tasks other than transferring bulk data. The granularity of turning the switch on and off is limited to a per-application basis.
Another disadvantage is that most applications use only the destination host's address for transfer, and this is the only information available to the transport and network layers for routing data packets. Some other method must be used to distinguish between traffic which should use the circuit-switched connection and lower-priority traffic. This problem can be addressed using route aliases, described below.
Kernel switch control
We have made two different implementations of switch control facilities within the operating system kernel. Both rely upon the routing lookup code in the kernel to send switch connect and tear down messages. The difference is in how the time delay between request of the switch and a response is handled.
For starters, routing table entries were expanded to include the internet address of the switch controller and state information for the switched connection. If there is a switch controller address specified, then the connection must be set up before packets may be sent on this route. We also added a separate module to handle the sending and receiving of the switch control messages.
When a routing lookup is satisfied, the routing code would check whether the routing table entry specified a switch controller. If so, then the routine requesting switch setup would be called. This would send a message on the Internet to the switch controller to setup the connection.
In our first implementation, the routing lookup call would return immediately after sending the switch connection request message. It would be the responsibility of the transport protocol to deal with the time delay while the connection is setup, and to tear down if the switched connection could not be made. This has significant ramifications. In the case of UDP and IP, packets must be buffered for later transmission or face almost certain extermination as they will probably start arriving at the switched connection before it is ready to carry traffic. Because of this problem, we decided that this feature would not be available for UDP or IP traffic.
We did make this work for TCP. Since TCP is already designed to work so that it buffers all data for possible later retransmission, this was not a problem. Our first cut was to change TCP to check that the route it was using was up if it is a switch controlled route. TCP would not send any data until the route was complete, and it would close the connection if the switch did not come up.
This did not work well at first because every time TCP tried to send data before the switch came up, the retransmit time would be reset and backed off. The rtt estimate, retransmit timeouts and the congestion control mechanism were seriously skewed before any data was ever sent. The retransmit timer would expire as many as 3 times before data could be transmitted. We solved this problem by adding another timer for handling the delay while the route came up, and not allowing the delay to affect any of the normal rtt timers.
Our experiences with this approach were not particularly positive, and we decided to try another. We also felt that unreliable datagram protocols should be able to use the service without excessive reworking. Our alternative still sends the switch control message when a routing lookup finds a controlled route. However, we now suspend execution of the thread of control until a response comes back from the switch controller.
This proved to be easier to implement in many ways. However, there were two major areas requiring changes outside the routing code. First, we decided that if the switch refused to activate the connection, it was pointless to try again. So we changed the routing lookup interface so that it could return an error specifying a permanent error condition. The transport layer could then return an appropriate error such as a host unreachable condition.
The other, more complex issue deals with the suspension of the thread of execution. Our operating system, UNICOS, is an ATT System V derivative, and our networking subsystem is based on the BSD tahoe and reno releases. The only way to suspend execution is to sleep. This is fine, as long as there is a user context to put to sleep. However, it is not a good idea to go to sleep when processing network interrupts, as when forwarding a packet.
We solved this problem by using a global flag regarding whether it was ok for the switch control message code to sleep. If it is necessary to send a message and sleep, then the flag must be set and an error is returned if sleeping is not allowed. User system calls which might cause a switch control message to be sent set and clear the flag upon entrance and exit. We also made it impossible to forward packets on a switch controlled route. We feel that this is reasonable since the overhead of switch control should be incurred only when an application program has made an explicit request to begin transfer of data.
The one other change we made was to make sure that TCP freed the route it is using upon entering TIME_WAIT state. There is no point in holding the circuit open for two minutes in case we need to retransmit the final ack. Of course, this assumes that an alternate path exists for the the peer to retransmit its fin.
The advantage of building this facility into the kernel is that it allows a fine degree of control over when the switch will and will not need to be activated. Many applications which open a data connection, transmit their bulk data, and then close the connection will not require modifications and will make efficient use of the resource. It also opens the possibility that applications written to use type-of-service can use the same network connection for low-bandwidth interactive traffic, change the type-of-service (thus activating the switched connection) for bulk transfers, and then release the switch upon returning to interactive traffic.
Putting this feature into the kernel also allows strong control over when and how the switched link can be used, keeping accounting information, and limiting multiple use access to the switched link.
The disadvantage is that significant kernel modifications are required, and some implementation details can be very difficult to handle.
Switch control libraries
The switch control programs we used were built on a library of simple switch control routines; however, we did not alter any standard applications to use this library. We did consider some advantages and disadvantages. On the plus side, it is possible to achieve a satisfactory degree of switch control without requiring any kernel modifications.
The primary disadvantage of this approach is that all applications must be altered and recompiled. This is particularly inconvenient when source is not available.