0
点赞
收藏
分享

微信扫一扫

计算机网络基础之Data link design issues

3.1 Data link design issues

  • Provide a well defined service interface to the network layer. 为网络层提供一个良好定义的服务接口。
  • Dealing with transmission errors. 处理传输差错。
  • Regulating( 调节 ) data flow. 调节数据流量-流量控制
  • Slow receivers not swamped by fast senders.

数据链路层将来自网络层的数据包封装成“帧”(frame)这是 DLL 的首要任务

计算机网络基础之Data link design issues_计网

Frame management forms the heart of what the data link layer does.

帧的管理是数据链路层的工作核心。

3.1.1 Services Provided to Network Layer

为网络层提供的服务

The principal service is transferring data from the network layer on the source machine to the network layer on the destination machine.

主要服务是将源主机网络层的数据传递给目的主机的网络层。

计算机网络基础之Data link design issues_数据链路层_02

数据链路层的简单模型

计算机网络基础之Data link design issues_计网_03

计算机网络基础之Data link design issues_sed_04

The Data Link Layer can offer many differentservices. The actual services that are offeredvary from protocol to protocol.

DLL可以提供多种不同的服务,协议不同,实际提供的服务不同。

Common services:

  • Unacknowledged connectionless service.(无确认的无连接服务)eg:CSMA
  • Acknowledged connectionless service.(有确认的无连接服务)
  • Acknowledged connection-oriented service.(有确认的面向连接服务)
Unacknowledged connectionless service

The source machine sends independent frames to the destination machine without having the destination acknowledge them.

Low error rate senario: recovery is left to higher layers.

Real-time traffic: late data are worse than bad data.Ethernet is a good example of a data link layer thatprovides this class of service. No logical connection isestablished beforehand and released afterward.If aframe is lost due to noise on the line, no attempt is madeto detect the loss or recover from it in the data link layer.

源机向目的机发送独立的帧,不需要目的机确认。

低错误率的情况下:恢复是留给更高层次的。

实时流量:迟来的数据比坏数据更糟糕。以太网是数据链路层的一个很好的例子,它提供了这一类服务。如果一个帧由于线路上的噪声而丢失,在数据链路层中不会试图检测丢失或恢复它。

Acknowledged connectionless service

有确认的无连接服务

  • There are no logical connections used, but each frame sent is individually acknowledged.无逻辑连接,每帧都确认。
  • The sender knows whether a frame has arrivedcorrectly or been lost.If it has not arrived within a specified time interval, it can be sent again.超时重传。
  • This sevice is useful over unreliable channels.适合用于不可靠信道
  • 802.11 (WiFi) is a good example of this class of service.

无连接(逻辑连接)、无释放

发送的每帧都需要确认(帧编号)

超时收不到确认,将重发

适用于不可靠的信道。如无线网络

Acknowledged connection-oriented service

  • Three phases: establish the connection, transfer data,release the connection.
  • Each frame sent over the connection is numbered, and the data link layer guarantees that each frame sent is indeed received.
  • It guarantees that each frame is received exactly once and that all frames are received in the right order.
  • It is appropriate over long, unreliable links such as a satellite channel or a long-distance telephone circuit.
  • 三个阶段:建立连接,传输数据,释放连接。
  • 通过连接发送的每个帧都有编号,数据链路层保证发送的每个帧确实被收到。
  • 它保证每个帧被准确接收一次,并且所有帧都以正确的顺序被接收。
  • 它适合于长的、不可靠的链接,如卫星通道或长途电话电路。

3.1.2Framing(封装成帧)

The Physical Layer is only able to put a raw bitstream on the transmission media.物理层只能将原始比特流放在传输介质上。

We have to be able to break up this bit stream into frames.我们必须能够将这个比特流分解成帧。

要解决的问题

  • 帧的边界问题(boundary)
  • 帧的透明传输(填充)问题(stuffing)

帧定界的方法:

Framing method:

1.character count (字节计数法) self studying
  • We use a field in the header to specify thenumber of characters in the frame.(在帧头部用一个字段来标明帧内字符数)

计算机网络基础之Data link design issues_sed_05

  • This method can cause problems if the count isgarbled in transit.(可能出现由于传输差错而被篡改).
  • The receiver will not know where to pick up andthe sender will not know how much to resend.(一旦出现错误,接收方就不能保持同步,从而找不到下一帧的起始位置)
  • This method is rarely used anymore.
2.Flag bytes with byte stuffing (带字节填充的标志字节法)
  • Frames begin and end with special bytes (Flag Byte标志字节).帧以特殊字节(Flag Byte标志字节)开始和结束。
  • Often used are thesame start/end flag.经常使用的是相同的开始/结束标志。
  • lf the receiverloss of synchronization (丢失同步), it just looks for a pair of flag bytes to denote the end of one frame and the start of the next.如果接收器失去同步,它只是寻找一对标志字节来表示一帧的结束和下一帧的开始。
  • What happens if the“flag" byte is accidentally transmitted in the message?(如果有效载荷中包含flag怎么办)
  • 计算机网络基础之Data link design issues_数据链路层_06

  • “Byte stuffing” is the process of putting an “ESC” character in front of any accidentally occurring FLAG in a message."字节填充 "是在信息中任何意外出现的FLAG前面加上一个 "ESC "字符的过程。
  • What happens if an ESC accidentally occurs in a message? We ESC that too!如果信息中意外出现ESC会怎样?我们也会ESC!
  • This is sometimes referred to as character stuffing. (字符填充)这有时被称为 "字符填充"。(字符填充)。
  • The disadvantage of byte stuffing is that it is tied to the use of 8 bit bytes.字节填充的缺点是它要填8个bit。
3.Starting and ending flags, with bit stuffing (比特填充的标志比特法)
  • Each frame begins and ends with a special bitpattern,01111110(in fact, a flag byte "Ox7E”)每一帧都以一个特殊的比特模式开始和结束。
  • 在发送端,只要发现有5个连续1,则立即填入一个0。
  • 接收端对帧中的比特流进行扫描。每当发现5个连续1时,就把这5个连续1后的一个0删除。
  • 主要用于HDLC(高级数据链路控制),PPP over SDH, USB。
  • 零比特填充
  • 计算机网络基础之Data link design issues_数据链路层_07

4.Physical layer coding violation (物理层编码违例法) self studying

  • 把常规数据中不会用到的比特组合拿过来作为标志。
  • 如4B/5B中闲置的16种5bit的数字组合,就可以当做标志位。
  • 由于这些组合是不允许出现在有效载荷的,因此称之为“违例”。
  • 计算机网络基础之Data link design issues_sed_08

3.1.3 Error Control
  • How to make sure all frames are eventually delivered to the network layer at the destination and in the proper order?如何确保所有的帧最终都能以适当的顺序送到目的地的网络层?
  • Suppose something went wrong during frame transmission. How do we actually notice that something’s wrong, and can it be corrected by the receiver?假设在帧传输过程中出现问题。 我们如何真正注意到有问题,接收者可以纠正它吗?Acknowledgment , Error Detection and Error Correction确认,错误检测和纠错
  • Suppose the packet was lost on the way. How do the sender notice it?假设该数据包在途中丢失。发件人如何注意到它?
  • Timers and Retransmission计时器和重传
  • What if a frame was transmitted multiple times?如果一个帧被传输了多次怎么办?
  • **Sequence Numbers for every frame.**每一帧的序列号。
3.1.4 Flow Control

To solve the problem that a sender wants to transmit frames faster than the receiver can accept them.

  1. Feedback based flow control
  • feedback is used to tell the sender how the receiver is doing or to send another frame。反馈用于告诉发送者接收者在做什么或发送另一个帧
  • Used in Data Link Layer
  1. Rate based flow control
举报

相关推荐

0 条评论