2.4 SLIP: Serial Line IP
SLIP
串行链路
IP
SLIP stands for Serial Line IP. It is a simple form of encapsulation for IP datagrams on serial lines, and is specified in RFC 1055 [Romkey 1988]. SLIP has become popular for connecting home systems to the Internet, through the ubiquitous RS-232 serial port found on almost every computer and high-speed modems.
SLIP
表示串行链路
IP
。它是串行链路上
IP
数据报封装的一种形式,具体参见
RFC1055
。
SLIP
是连接家庭和网络的主流,通过每台电脑和高速猫上无处不在的
RS-232
串行接口。
The following rules specify the framing used by SLIP.
下列详列了
SLIP
的帧封装。
The IP datagram is terminated by the special character called END (0xc0). Also, to prevent any line noise before this datagram from being interpreted as part of this datagram, most implementations transmit an END character at the beginning of the datagram too. (If there was some line noise, this END terminates that erroneous datagram, allowing the current datagram to be transmitted. That erroneous datagram will be thrown away by a higher layer when its contents are detected to be garbage.)
IP
数据报被称为
END
(
0xc0
)的特殊字符终止。为了避免任何这段数据报被解译出来前的线噪,大部分程序在数据报开始时也传输一个
END
。(如果有线噪,
END
终止错误的数据报,允许现有数据报传输。当高层认为错误数据报无用时,其被丢弃。)
If a byte of the IP datagram equals the END character, the 2-byte sequence 0xdb, 0xdc is transmitted instead. This special character, 0xdb, is called the SLIP ESC character, but its value is different from the ASCII ESC character (0x1b).
如果
IP
数据报的一个字节与
END
字符相等,这个
2
字节序列
0xdb
,
0xdc
取代。这个特殊字符,
0xdb
,称为
SLIP ESC
字符,但是其值与
ASCII ESC
字符不同(
0x1b
)。
If a byte of the IP datagram equals the SLIP ESC character, the 2-byte sequence 0xdb, 0xdd is transmitted instead.
如果
IP
数据报的一个字节与
SLIP ESC
字符相等,这个
2
字节序列为
0xdb
,
0xdd
替代。
Figure 2.2 shows an example of this framing, assuming that one END character and one ESC character appear in the original IP datagram. In this example the number of bytes transmitted across the serial line is the length of the IP datagram plus 4.
图
2.2
显示了成帧的实例,假设原有
IP
数据报有一个
END
字符和一个
ESC
字符。此例中,串行链路中传输的字节数是
IP
数据报加上
4
的长度。
Figure 2.2. SLIP encapsulation.
SLIP is a simple framing method. It has some deficiencies that are worth noting.
SLIP
是一个成帧的方式。需注意其有些缺陷。
Each end must know the other's IP address. There is no method for one end to inform the other of its IP address.
每端都必须知道对方的
IP
地址。对一端而言,没法向对端通告其
IP
地址。
There is no type field (similar to the frame type field in Ethernet frames). If a serial line is used for SLIP, it can't be used for some other protocol at the same time.
没有类型区域(与以太帧的类型区域类似的帧区域)。如果串行线路用于
SLIP
,不可同时用于其它协议。
There is no checksum added by SLIP (similar to the CRC field in Ethernet frames). If a noisy phone line corrupts a datagram being transferred by SLIP, it's up to the higher layers to detect this. (Alternately, newer modems can detect and correct corrupted frames.) This makes it essential that the upper layers provide some form of CRC. In Chapters 3 and 17 we'll see that there is always a checksum for the IP header, and for the TCP header and the TCP data. But in Chapter 11 we'll see that the checksum that covers the UDP header and UDP data is optional.
SLIP
没有添加校验和(以太帧中类似
CRC
的区域)。如果噪音的电话线衰减了
SLIP
传输的数据报,取决于高层检测这些。(此外,新的猫可以检测并更正衰减帧)本质上高层提供一些
CRC
的形式。在第
3
和
17
章中,
IP
头部,
TCP
头部及
TCP
数据总有个校验和。但是在
11
章中,
UDP
头和数据的校验和是可选的。
Despite these shortcomings, SLIP is a popular protocol that is widely used.
忽视这些缺点,
SLIP
是个广泛使用的协议。
The history of SLIP dates back to 1984 when Rick Adams implemented it in 4.2BSD. Despite its self-description as a nonstandard, it is becoming more popular as the speed and reliability of modems increase. Publicly available implementations abound, and many vendors support it today.
SLIP
的历史可追溯到
1984
年,
Rick Adams
在
BSD4.2
上实现它。忽视其非标准自述,随着猫的速度和稳定性的增加,其越来越受欢迎。公开的有效应用增加,许多厂家如今都支持它。