7.1 Introduction

   


The packet-oriented IP protocol is used to communicate over the Internet. However, a modem can transmit only a continuous byte stream. For this reason, to establish a connection from your local PC over an analog telephone line to the worldwide Internet, we need a protocol that encapsulates network packets so that they can be transmitted over a modem connection between a local computer and a point of presence (PoP). The two endpoints of the modem connection can then communicate over IP. The point of presence itself is directly connected to the Internet and routs IP packets between the local PC and the Internet. (See Figure 7-1.)

Figure 7-1. Scenario for the use of SLIP.

graphics/07fig01.gif


Another possible use of such a protocol is for the IP communication of two computers over the serial V.24 interface, which is available in most PCs. This use lets you build an IP network at little cost (and very low speed) without the need to install additional interfaces, such as Ethernet cards.

RFC 1055 [Romk88] specifies the SLIP (Serial Line IP) for the V.24 task. SLIP represents an intermediate layer within the network architecture: At its upward face, packets are taken from or forwarded to the IP layer; at its downward face, data are sent to or received from a serial interface driver.

As compared with the more recent PPP protocol (see Chapter 8), SLIP is very simple, but offers a rather limited functionality:

  • SLIP includes no mechanisms for establishment of a controlled connection: As soon as SLIP has been started on both ends, the connection is implicitly established. For this reason, no parameters, such as IP address, DNS information, or the SLIP operating mode used, can be negotiated. These parameters have to be set manually or by use of a script before SLIP is started.

  • SLIP serves exclusively for the transmission of Version-4 IP packets. Other network protocols (e.g., IP version 6 or X.25) are not supported.

  • SLIP has no mechanisms to detect or correct errors; these functions have to be handled by higher network layers.

  • In contrast to PPP, the payload in transmitted IP packets cannot be compressed. The CSLIP operating mode (described in the next bullet) allows you to compress the IP packet headers only.

In addition to the standard operating mode, SLIP supports the following modes:

  • In CSLIP (Compressed SLIP), the packet headers in transmitted IP packets are compressed by the Van Jacobson algorithm to utilize slow modem connections better.

  • SLIP6 uses only printable ASCII characters for data transmission. This is necessary when the underlying modem connection cannot transmit all control characters of the ASCII alphabet for example, because the XON and XOFF control characters are used for flow control. However, a maximum payload of 6 bits per character can be transmitted in this way, and so the transmission rate drops by one-quarter.

7.1.1 Packet Detection and Character Stuffing

A serial interface or a modem connection is designed for the transmission of continuous byte sequences. To be able to send data packets of the IP protocol over such a connection, the sender has to insert special markings, which are then used by the receiver to detect the end of each packet. In SLIP, this is implemented so that the END control character (byte code 192) is inserted before and after each packet.

  • To ensure unique detection of packet boundaries, the END character must never occur inside a packet. Of course, this constraint is undesirable, because we want to be able to transmit arbitrary data packets transparently. To maintain this code transparency, three additional control characters (ESC, ESC_END, and ESC_ESC) are used to implement a so-called character stuffing (shown in Figure 7-2):

  • Each occurrence of END in packet data is replaced by the ESC ESC_END string.

  • Each occurrence of ESC in packet data is replaced by the ESC ESC_ESC string.

Figure 7-2. SLIP marks packet boundaries and uses character stuffing at the sender side.

graphics/07fig02.gif


The receiver can reverse character stuffing as follows to reconstruct the original IP packet:

  • If the ESC character occurs, then the next character is ESC_ESC or ESC_END. In this case, the first ESC is deleted, and the second character is replaced by ESC or END.

  • If the END character occurs, then this is the end of that packet, and so the packet can be forwarded to the IP layer.

Table 7-1 lists the four control characters used by SLIP and their byte codes.

Table 7-1. SLIP control characters.

Character

Byte Code

END

192

ESC

219

ESC_END

220

ESC_ESC

221



       


    Linux Network Architecture
    Linux Network Architecture
    ISBN: 131777203
    EAN: N/A
    Year: 2004
    Pages: 187

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net