|
Lesson 5 - SLIP and PPPSLIPSLIP dates back to the early 1980s when it was originally implemented in 4.2 Berkely Software Distribution (BSD) UNIX. It is a simple encapsulation of an IP datagram, which is transmitted over serial lines using an RS-232 interface. SLIP is often used to connect remote terminals to UNIX hosts (host-to-host), and is also used for host-to-router and router-to-router communications over leased or dial-up serial lines. For this purpose it is quite efficient. Most common SLIP implementations accept IP datagrams up to 1,006 bytes in length. The SLIP Frame Format Diagram illustrates IP encapsulation in a SLIP frame.
SLIP Frame FormatBecause the control character used to indicate the beginning and end of frame is a ´C0,´ a method to "escape" (allow the character to appear in the data) is provided. This is done by using the SLIP "ESC" (escape) character, ´DB.´ If a ´C0´ character has to be transmitted as data, it is transmitted as a two-character sequence of ´DB´ ´DC.´ If the SLIP ESC character itself appears in the data, it is represented by a ´DB´ ´DD´ sequence. A few drawbacks of SLIP are that each end must know the other end's IP address, because there is not a provision to exchange this information in the protocol. Because there is no "type" field that could be used to direct the data to one of several protocols, it can only transfer IP datagrams. Finally, there is no checksum to allow for error detection on noisy telephone lines, which means the higher layers are responsible for error detection and recovery. CSLIPBecause SLIP is usually run over relatively slow speed serial lines, and is often used for applications, such as Telnet, a compressed version called Compressed SLIP (CSLIP) was specified (RFC 1144). Telnet is an interactive application and can be very inefficient when sending just a few bytes, or even one character at a time. For example, to send just three characters in a TCP/IP session requires 43 bytes to be transferred (IP and TCP headers are both 20 bytes with no options). By using CSLIP, the 40 bytes of header overhead can be reduced to between 3 and 5 bytes. Information such as IP addresses, TCP fragmentation indicators, Type of Service (TOS) flags, need not be sent. This concept is shown on the CSLIP Diagram.
CSLIPThe use of CSLIP requires manual configuration of certain parameters on a one-time basis. PPPPoint-to-Point Protocol solves some of the inefficiencies inherent in SLIP. PPP supports either asynchronous (character-oriented) or synchronous (bit-oriented) transmission links. It can be used with protocols other than IP, such as IPX, and has features that can be negotiated using link and/or network control frames. PPP provides:
In order to establish communications over a point-to-point link, each end of the PPP link first sends LCP packets to configure and test the data link. After the link has been established and optional facilities have been negotiated as needed by LCP, PPP sends NCP packets to choose and configure one or more Network Layer protocols. Once each of the chosen Network Layer protocols, such as IP and IPX, has been configured, datagrams from each Network Layer protocol can be sent over the link. The link will remain configured for communications until explicit LCP or NCP packets close the link down, or until some external event occurs. The frame has information embedded within so that it can be directed to the proper destination above the Data Link Layer. The format of a PPP frame is similar to the HDLC frame layout mentioned above. There are three formats of a PPP frame, depending on whether it is carrying data or control information, as illustrated on the PPP Information Frame Diagram.
PPP Information Frame
The following frame fragment shows an interesting capture of a PPP frame utilizing the PPP Multilink Protocol. Multilink is a mechanism whereby a node can use multiple links, such as three 56-Kbps lines running PPP to achieve higher bandwidth. The trace shows the PPP header, which indicates Multilink in the Protocol field. Following the Multilink header, the extended PPP header shows a protocol of 0x0021, indicating IP is being carried. The indicator appears as a 1-byte field (0x21).
Frame 4 (387 on wire, 387 captured)
Point-to-Point Protocol
Address: ff
Control: 03
Protocol: Multilink (0x003d)
PPP Multilink Protocol
Fragment: 0xC0 (First, Last)
1... .... = First fragment: Yes
.1.. .... = Last fragment: Yes
..00 0000 = reserved
Sequence number: 437
Point-to-Point Protocol
Protocol: IP (0x0021)
Internet Protocol
Transmission Control Protocol, Src Port: 1245 (1245), Dst Port: http (80),
Hypertext Transfer Protocol
ADDR Hex ASCII
0 ff03 003d c000 01b5 2145 0001 7a39 5140 ...=....!E..z9Q@
10 003f 0609 04cf c119 0ccf 2640 3504 dd00 .?........&@5...
20 502e 6dae 03ef 3a28 aa80 187d 2e4a f300 P.m...:(...}.J..
Link Control FrameAn LCP can be used to specify certain data link options, such as which characters are going to be escaped (logically hidden) on an asynchronous link. It can also be used to negotiate not having to send the flag or address byte and to reduce the size of the Protocol field from 2 bytes to 1 byte for more efficient line utilization. This concept is illustrated on the PPP Link Control Frame Diagram. Note the value of C021h in the Protocol field used to indicate an LCP frame.
PPP Link Control FrameFor the same reasons that were given above, so far as escaping the control character ´C0´ in the SLIP implementation, special consideration must also be given to sending such patterns as the flag byte as data on a PPP link. On synchronous links, this is taken care of by the hardware by a technique called zero bit insertion or "bit stuffing." On asynchronous links, the flag character, if it appears as data, is sent as a 2-byte sequence of ´7D´ ´5E.´ In other words, the character to be escaped is sent first by sending the escape character &´7D,´ followed by the character with its sixth bit complemented. The bits are numbered right to left, 1 through 8. A ´7E´ (01111110) flag character with its sixth bit complemented is equal to a ´5E´ (01011110 in binary). The escape character itself would be sent as ´7D´ ´5D.´ Also, ASCII control characters (any value lower than a ´20´) would be sent the same way. For example, a BELL character, which could be used to cause the speaker on the PC to sound a beep, is a hexadecimal ´07.´ It would be sent as the 2-byte sequence ´7D´ ´27´ (again the sixth bit is complemented, for example, if it was set, it is reset; if it was reset, it is set). Network Control FrameSo far as the third format of a PPP frame is concerned, it is used to negotiate things such as using header compression, as mentioned above in CSLIP. A network control frame, as illustrated on the PPP Network Control Frame Diagram, is used for this purpose. This protocol can also be used to dynamically negotiate the IP addresses for each end of the link. Note the value of 8021h in the Protocol field, indicating IP Control Protocol.
PPP Network Control FrameIPCPThe IP Control Protocol (IPCP) is an NCP responsible for configuring, enabling, and disabling the IP protocol modules on both ends of a PPP link. IPCP uses a similar packet exchange mechanism as LCP. Various configuration options provide a way to negotiate the IP address to be used on the local end of the link. It allows the sender of a configuration request to state which IP address is desired, or to request that the peer provide the information. The peer can provide this information by negatively acknowledging the option, and returning a valid IP address. By default, no IP address is assigned. [ Previous Section ] [ Unit Contents ] [ Next Lesson ]
|