一直以来对带宽和时延的计算都迷迷糊糊,今天做了一个简单的整理。

基础

首先弄清楚几个概念:信号占用带宽、数据传输速率(比特率)、波特率、信道带宽

信号的误区:0101、0110 等等,这些不是信号(是消息)。信号是实实在在的波形,方波、正弦波等。

信号占用带宽指的是信号传输速率。

码元(code)——在使用时间域(或简称为时域)的波形表示数字信号时,代表不同离散数值的基本波形。

消息的传递整个过程是这样的:
如果消息是模拟信号,那么先要采样、量化,变为 0101、0110 这样的抽象消息。
将 0101、0110 这样的消息编码为信号。有各种编码方式,归零、不归零等等。这样得到的信号是基频信号。
注意:4B/5B 编码是将消息编码为消息,编码后的结果还是 00101、01101 等数据,而不是实实在在的信息。

带宽

带宽,又叫频宽,是数据的传输能力,指单位时间内能够传输的比特数。高带宽意味着高能力。
数字设备中带宽用bps(b/s)表示,即每秒最高可以传输的位数。模拟设备中带宽用Hz表示,即每秒传送的信号周期数。通常描述带宽时省略单位,如10M实质是10M b/s。

下面解释来自《数据网络技术》ppt 第一章 73 页。
“带宽”(bandwidth)本来是指信号具有的频带宽度,单位是赫(或千赫、兆赫、吉赫等)。
现在“带宽”是数字信道所能传送的“最高数据率”的同义语,单位是“比特每秒”,或 b/s (bit/s)。

数据传输速率

数据传输速率,又称比特率,指每秒钟实际传输的比特数,是信息传输速率(传信率)的度量。单位为“比特每秒(bps)”。其计算公式为S=1/T。T为传输1比特数据所花的时间。

波特率

在信息传输通道中,携带数据信息的信号单元叫码元,每秒钟通过信道传输的码元数称为码元传输速率,简称波特率。波特率是指数据信号对载波的调制速率,它用单位时间内载波调制状态改变的次数来表示(也就是每秒调制的符号数),其单位是波特(Baud,symbol/s)。波特率是传输通道频宽的指标。

比特率=波特率单个调制状态对应的二进制位数(Rb=RBlog2 N。其中,N为进制数)

信道带宽

信道带宽是指信道支持的最大传输速率,由香农定理决定

无噪信道带宽:R=B log2(N)
有噪信道带宽:Rb=W*log2(1+S/N)

参考网页:
通信常识

一般说的信号带宽指的是,信号占用的带宽,即信号的传输速率。
下面图片来自《数据网络技术》ppt 第一章 75 页。

下面图清晰的说明了信号基频与传输速率的关系,以及信号频率带宽的作用。

信号基频决定传输熟虑,信号频率带宽只是决定信号质量而已。

码元与信元的理解

从上图可以看出一个码元指的是一个 0,1 这样的消息。一个信元指的是一个电平。

如果用 TCP 协议传输,那么传输速率与窗口大小的关系?
窗口越大,则传输速率越大。
计算公式为: rate = window/RTT
注:窗口的大小为字节数。窗口作用是发送 window 个字节后等待另一方的应答。
参考网页:这个博客中例题
这个例题中假设的窗口大小为数据包的个数,不准确,应该是字节数。

总结:
传输速率计算公式已知的有两个,

  1. 基波频率(与采样周期、信号等级有关)
  2. 窗口大小(传输数据量/耗费时间)

下面这段话说明传输速率取决于调制解调器(采样率)和信达容量(上限)。
The communication link considered is viewed as a bit pipe over which a given number
of bits per second can be transmitted. This number is called the transmission capacity of
the link. It depends on both the physical channel and the interface (e.g., modems), and is
simply the rate at which the interface accepts bits.

时延

下面图片来自《数据网络技术》ppt 第一章 81 页。

下面这一段来自于http://web.mit.edu/dimitrib/www/Queueing_Data_Nets.pdf

In what follows, we will mostly focus on packet delay within the communication
subnet (i.e., the network layer). This delay is the sum of delays on each subnet link
traversed by the packet. Each link delay in tum consists of four components.

  1. The processing delay between the time the packet is correctly received at the head
    node of the link and the time the packet is assigned to an outgoing link queue
    for transmission. (In some systems, we must add to this delay some additional
    processing time at the DLC and physical layers.)
  2. The queueing delay between the time the packet is assigned to a queue for transmission and the time it starts being transmitted. During this time, the packet waits
    while other packets in the transmission queue are transmitted.
  3. The transmission delay between the times that the first and last bits of the packet
    are transmitted.
  4. The propagation delay between the time the last bit is transmitted at the head
    node of the link and the time the last bit is received at the tail node. This is
    proportional to the physical distance between transmitter and receiver; it can be
    relatively substantial, particularly for a satellite link or a very high speed link.

按照上面的意思:
时延 = 处理时延 + 排队时延 + 发送时延 + 传播时延

一些网页上提供网络延时计算:
算了发送时延 + 传播时延
算信道最大带宽和交换机缓存大小

QoS

现有网络控制时延和带宽的方式为:
将路由器中正在排队的数据包放在不同的优先级队列中,优先级高的队列,优先发送。
这样在传输数据量不变的情况下,耗费时间变了,计算出来的带宽也就变了,同时延时也发生了改变。

从下面这句话理解:FDM 控制带宽的方式为减少采样频率,TDM 控制带宽的方式为增加等待时间。
In time-division (TDM) and frequency-division multiplexing (FDM) with m traffic
streams, the link capacity is essentially subdivided into m portions-one per traffic
stream. In FOM, the channel bandwidth W is subdivided into m channels each with
bandwidth W /m (actually slightly less because of the need for guard bands between
channels). The transmission capacity of each channel is roughly C /m, where C is
the capacity that would be obtained if the entire bandwidth were allocated to a single
channel. The transmission time of a packet that is L bits long is Lm/C, or m times
larger than in the corresponding statistical multiplexing scheme. In TOM, allocation is
done by dividing the time axis into slots of fixed length (e.g., one bit or one byte long,
or perhaps one packet long for fixed length packets). Again, conceptually, we may view
the communication link as consisting of m separate links with capacity C /m. In the case
where the slots are short relative to packet length, we may again regard the transmission
time of a packet L bits long as Lm/C. In the case where the slots are of packet length,
the transmission time of an L bit packet is L/C, but there is a wait of (m - 1) packet
transmission times between packets of the same stream.

本文总阅读量次.

留言