参考
[1] Definition of Network Units: Packet, Fragment, Frame, Datagram, and Segment
[2] Difference between Frame and packets in IEEE 802.11
1 背景
不同的OSI层 & 不同的协议都有自己的 specific units
the packet, fragment, frame, datagram, and segment, …
作为wireless领域的的phd candidate,目前还并不是很清晰这些units的具体定义以及互相之间的联系,因此专门写一篇笔记理一下
2 OSI model
先复习一下
下面从底层向高层记录
3 Frame
frames are small parts of a message
It helps to identify data and determine the way it should be decoded and interpreted
frame有两种类型:
fixed-length and variable-length frames
variable-length frames需要规定起始符和结束符,fixed-length frame不用
4 Packet & Frame
The basic unit of communication between a source and a destination in a network. Data sent through the network is divided into packets, that are recombined by the destination devices.
packets结构如下
Frame & Pakcet区别
The main difference between a packet and a frame is the association with the OSI layers
A frame contains more information about the transmitted message than a packet
Frames are not much different from packets. Frames contain more information about the data than Packets
越往底层,units包含的信息越多,越复杂。
In each network, there is a maximum size of the data to be transmitted called the MTU (Maximum Transmitted Unit). Packets can often be larger than the maximum size, so each packet is also divided into smaller pieces of data called fragments.
Fragment仍然属于网络层
When the network layer receives a packet, it checks the MTU of the packet. If the packet length is bigger than the MTU, the network layer checks the Don’t Fragment (DF) flag associated with the packet. If the DF flag is 1, we discard the packet. Otherwise, the network layer decides the size of the fragments, create the header, encapsulate the fragments within the header, and send them to the next layer
现在知道路由器是干啥用的了
5 Datagram & Segment
In a datagram, we divide data frequently and transmitted from source to destination without a predefined route. We also can’t guarantee the order of delivery to the receiver end.
While TCP uses packets in connection-oriented protocols, datagrams are used in UDP, making them carry less information since they don’t need to have a response message from the destination
In the case we sent an email using the UDP protocol, there will be no packets but datagrams. The information transmitted would be in the following figure:
A segment is a broken piece of a packet with a TCP header in each of them
f we sent an email with a TCP connection, then the data that exists in the transport layer to complete the operation is an example of a segment. The email packet will then become:
6 Specificaitons on PHY layer
上面是广义的计算机网络的知识, network layer的pakcet作为payload被包含在data link layer的frame中
在 PHY layer中,packet 与 frame有另外的意思
比如在 IEEE 802.11标准中(WIFI)的packets中,the frame is encapsulated within the data field of the packet
在matlab的数据处理中,也经常用frame来作为数据单位,比如处理音频流时的长度参数叫frameLength
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)