第三章-数据链路层
Physical link和data link
Special functions of the data link layer:framing(帧同步or封装成帧),error control(差错检测), flow control(流量控制), transparent transfer(透明传输), addressing
Stop-and-wait protocol: ACK/NAK(应答帧/否认帧), error retransmission(超时重传), timeout retransmission(超时重传), sequence number(编号)
ARQ(Automatic Repeat reQuest)自动请求重传
CRC(Error-Detecting Codes)检错码:Parity Check(奇偶校验), CRC(Cyclic Redundancy Check)循环冗余校验
Parity Check: Single Bit Parity, Two Dimensional Bit Parity
CRC:除数n+1位,余数(冗余码)n位,generator polynomial(生成多项式)
Continuous ARQ Protocols连续ARQ协议:NAK, No Response
Sliding Window Protocol(滑动窗口协议):
如果接收窗口大小是1,则退回连续ARQ协议
如果接受窗口和发送窗口大小都是1,则退回停止等待协议
Maximum Allowable Window size=2的n次方-1(the sequence number in the header: n)
Selective repeat ARQ Protocols(选择重传ARQ):可以看作是发送窗口>1, 接收窗口>1的滑动窗口协议
HDLC(High-level Data Link Control):
三种类型站:(primary station)主站、(secondary station)从站、(combined station)组合站
The mode of link:
An unbalanced mode(非平衡配置) and An balanced mode(平衡配置)
The HDLC Frame format:
:01111110
Bit stuffing(位填充):每五个1加一个0
PPP-byte-oriented
HDLC-bit-oriented
PPP(Point-to-Point Protocol)点对点协议
三个组成部分:
- Framing(将IP数据报封装到串行链路的方法)
- LCP(Link Control Protocol)链路控制协议
- NCP(Network Control Protocol)网络控制协议
过程:PC calls-Router’s modem answer and establish a physical connection-PC sends the router a series of LCP packets-a series of NCP packets are sent to configure the network layer
PPP frame format:
Character stuffing(byte stuffing) 字符填充(字节填充):
(1)0x7E->0x7D,0x5E
(2)0x7D->0x7D,0x5D
(3)less than 0x20(控制字符)->0x7D,X(加20)
:区分IP,LCP,NCP