IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 网络协议 -> Chapter12 TCP:The Transmission Protocol(Preliminaries) -> 正文阅读

[网络协议]Chapter12 TCP:The Transmission Protocol(Preliminaries)

12 TCP: The Transmission Protocol(Preliminaries)

12.1 Introduction

The foundation of Information theory was created by Claude Shannon in 1984 provide a inspiration for information error handle:

  1. error-correcting
  2. ARQ (Automatic Repeat Request)

12.1.1 ARQ and Retransmission

There maybe encounter some information problems in the communication in multihop cascade of several:

  1. packet reordering
  2. packet duplication
  3. packet erasures(drops)

TCP is an error-correcting protocol which will cope with these problems above.


Packet reordering and duplication solution

Packet erasure(drops) solution:

在这里插入图片描述


  • TCP is reliable but inefficient.
  • Stop and wait: sender inject single packet into communication path and have to waiting ACK.
  • Throughput performance: data sent on the network per unit time. It is proportional to M / R M/R M/R,
    • M M M? : packet size; R R R: round-trip time(RTT)
    • For a fixed-size packet, as R R R? goes up?? , the throughput goes down?? .(Assuming not packet lose or damaged in transit)
    • The network in idle also have lower efficiency.

Sender need to consider:

  1. when to inject packet into network
  2. how long for timer to waiting ACK
  3. keep the packet copy for retransmission

Receiver need to consider:

  1. distinguish repeated packet
  2. Maintain a sophisticated buffering(Packet Storage): hold “out-of-sequence”(The packet is not away coming in order or completely)

Other issue:

  1. Receiver is slower than the sender.(Receiver will drop the packet because can’t dispose overwhelming packet from sender)
  2. Network infrastructure(e.g. routers in middle) can’t copy with rate of data the sender and receiver wish to use.

在这里插入图片描述

12.1.2 Windows of Packets and Sliding Windows

window: the collections of packets which have been sent but not yet be acknowledged.

window size: number of packets in the window.

💬 Window is like canteen window which controls who be serviced and have three state: not yet service/servicing/serviced.

在这里插入图片描述

Window can combat many problems:

  • At sender:
    • what packets can be release.
    • what packet are awaiting ACK.
    • what packets cannot yet be send.
  • At receiver:
    • what packets have been received and acknowledge.
    • what packets are expected.
    • how much memory has been allocated to hold them.

Still not resolve:

  • how large the window should be.
  • data transfer rate.

12.1.3 Variable Windows: Flow Control and Congestion Control

Flow Control: the way to force sender slow down. Two type:

  1. Rate-based flow control: fixed rate allocation which not allow be exceeded.
  2. Window-based flow control: dynamic rate
    1. Window advertisement(or window update): the method to signal the sender how large a window to use.
    2. Window advertisement and ACK are together in single packet in practical.

Transfer rate: S W / R SW/R SW/R

  1. S S S: packet size in bits
  2. W W W: window size
  3. R R R: RTT

Congestion Control: the special form of flow control which copy with the data transfer rate between sender and receiver.

? The problem of congestion control in datagram-style networks, and more generally queuing theory to which it is closely related, has remained a major research topic for years, and it is unlikely to ever be solved completely for all circumstances.


  • Explicit signaling: have a protocol specific field. e.g. window advertisement.

  • Implicit signaling: need other evidence.

12.1.4 Setting the Retransmission Timeout

Retransmission timeout: the time to wait before concluding that a packet has been lost and should be resend.

To determine retransmission timeout:

  • the time to send the packet.
  • the time receiver process it and send an ACK.
  • the time for ACK travel back to the sender.
  • the time sender process the ACK.

😭 None of these time are known with certainty!

😫 These time vary over time as additional load is added to or removed from the end hosts or routers.


Round-trip-time estimation: try to estimate the time which can’t exactly get but approximately approach.

The timeout is large than time by round-trip-time estimation.

12.2 Introduction to TCP

12.2.1 The TCP Service Model

TCP provide a connection-oriented, reliable, byte streaming service.

  • Connection-oriented: Two endpoint have to establish a TCP connection before exchange data.
  • Byte streaming: Each endpoint individually choose write or read extent.

12.2.2 Reliability in TCP

Packetization take the sending application’s stream of bytes into a packet that IP can carry.

  • Packet contain sequence number which allow packet have arbitrary size.

Repacketization combine packets.

Segment The chunk from sending application’s data separated by TCP.


TCP maintain a mandatory checksum on its header, any associated application data, and fields from the IP header.

The receiving packet may acknowledge previous packet so as to help the sender with its congestion control computation.


🔵 A group of segments own one timer

?? Timer set when window of data are sent

?? Timeout update when receive acknowledge

?? Retransmission if acknowledge not be receive in time.


Receiver not send acknowledge immediately and it will delay a fraction of second.

The ACKs used by TCP are cumulative in the sense that an ACK indicating byte number N implies that all bytes up to number N(but not including it) have already received successfully.

If an ACK packet loss, a subsequent ACK are sufficient to acknowledge the previous segment.


IP protocol didn’t provide duplicate elimination or guarantee correct ordering.

TCP will maintain a large sequence number in order to provide integral and correct order data to application.

12.3 TCP Header and Encapsulation

The length of TCP Header:

  • 20 bytes;
  • 60 bytes with options.

TCP Data is optional. Without TCP Data:

  • Pure ACK just to acknowledge the receive data.
  • Window update just to change the window size.

Source Port & Destination Port + IP address: Socket

TCP numbers each byte with a sequence number

SYN segment: TCP initial connection segment which not using 0 or 1 rather then a random number(initial sequence number(ISB)) as sequence number because of secure measure.

ACK don’t consume sequence number.


  1. CWR Congestion Window Reduced(The sender reduced its send rate)
  2. ECE ECN Echo(the sender received an earlier congestion notification)
  3. URG Urgent(The Urgent Pointer field is valid — rarely used)
  4. ACK Acknowledge (The Acknowledge Number field is valid — always on after a connection is established)
  5. PSH Push (The receiver should pass this data to the application as soon as possible — not reliably implemented or used)
  6. RST Rest the connection (connection abort, usually because of an error)
  7. SYN Synchronize sequence numbers to initiate a connection
  8. FIN The sender of the segment is finished sending data to its peer
  网络协议 最新文章
使用Easyswoole 搭建简单的Websoket服务
常见的数据通信方式有哪些?
Openssl 1024bit RSA算法---公私钥获取和处
HTTPS协议的密钥交换流程
《小白WEB安全入门》03. 漏洞篇
HttpRunner4.x 安装与使用
2021-07-04
手写RPC学习笔记
K8S高可用版本部署
mySQL计算IP地址范围
上一篇文章      下一篇文章      查看所有文章
加:2022-07-17 16:57:20  更:2022-07-17 16:58:53 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/25 22:53:02-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码