文档章节

TCP Sliding Window

robin-yao
 robin-yao
发布于 2015/11/15 17:39
字数 416
阅读 192
收藏 1

Sliding window is an interesting concept. In terms of TCP, receiver’s window represents the amount of data that the receiver is willing to accept.

In this article, we will cover TCP sliding window concept and aspects related to it.

Quick Sender, Slow Receiver

Before learning the sliding window concept, lets first discuss a scenario where sender is quick to send data while receiver is a bit slow to accept it. Suppose sender sends three data segments (seg1, seg2 and seg3) each of 4096 bytes and starts waiting for the acknowledgement from the receiver.

Now, if these 3 segments fill up all the TCP buffers of the receiver then receiver will advertise a window size of 0. The window size zero means that receiver cannot accept any more data at this moment. Whenever buffers are available, a non zero window size would be advertised by the receiver.

TCP Sliding Window

The process described in last section is good on receiver’s part but sender has to maintain a window on its side too. This window covers unacknowledged data and the data it can send keeping in mind the window size advertised by the receiver.

Following figure should give you an idea about how a sliding window looks like :

In the figure shown above :

  • The available window advertised by the receiver is 6. This means that receiver can accept 6 bytes as of now.

  • The window at sender side covers bytes ranging from 13 to 18 (I.e. 6 bytes in total).

  • Out of this range, 13-15 are the bytes which have been sent but no acknowledgement is yet received for them.

  • Bytes 16-18 are the bytes that sender can send as soon as possible.

  • If sender starts receiving acknowledgement for bytes 13 to 15, the left end of the window starts closing in.

  • The right end starts opening up as more and more window size is advertised by the receiver.

  • This window slides towards right depending upon how fast receiver consumes data and sends acknowledgement and hence known as sliding window.

On a related note, it is also helpful for you to understand how TCP attacks andARP cache poisoning works.

Some more points related to sliding windows :

  • The receiver can send acknowledgement even before its window fills up completely.

  • The left edge of the window can move towards right.

  • Neither left edge should move towards left nor right edge should move towards left.


本文转载自:http://www.thegeekstuff.com/2013/10/tcp-sliding-window/

robin-yao
粉丝 167
博文 54
码字总数 61436
作品 0
杭州
私信 提问
TCP Silly Window Syndrome

In the topic describing TCP's Maximum Segment Size (MSS) parameter, I explained the trade-off in determining the optimal size of TCP segments. If segments are too large, we risk......

robin-yao
2015/11/15
133
0
TCP 的那些事儿(下)

https://coolshell.cn/articles/11609.html 这篇文章是下篇,所以如果你对TCP不熟悉的话,还请你先看看上篇《TCP的那些事儿(上)》 上篇中,我们介绍了TCP的协议头、状态机、数据重传中的东...

libaineu2004
2017/12/14
0
0
tcp报头详解

TCP报头格式: 源端口号(Source Port):16位,标识主机上发起传送的应用程序; 目的端口(Destonation Port):16位,标识主机上传送要到达的应用程序。 源端,目的端的端口号,用于寻找发...

wm1283
2015/04/14
0
0
大牛帮忙分析github slidingmenu源码

/** * Attaches the SlidingMenu to an entire Activity * * @param activity the Activity * @param slideStyle either SLIDING_CONTENT or SLIDING_WINDOW * @param actionbarOverlay whet......

忧伤的码农
2014/07/11
1K
2
76. Minimum Window Substring

Description tags: Hash Table, Two Pointers, Stringdifficulty: Hard Given a string S and a string T, find the minimum window in S which will contain all the characters in T in co......

52iSilence7
2018/10/18
7
0

没有更多内容

加载失败,请刷新页面

加载更多

让《强化学习(第2版)》架起一座通往强化学习经典知识宝库的桥梁

上交大计算科学与工程系俞凯教授,5分钟口述讲解,带你快速认识了解年度重磅图书《强化学习(第二版)》! 在 AlphaGo战胜李世石之后,AlphaZero以其完全凭借自我学习超越人类在各种棋类游戏...

博文视点Bv
5分钟前
2
0
TLA7-EVM开发板的处理器、NOR FLASH、DDR3

TLA7-EVM开发板是一款由广州创龙基于Xilinx Artix-7系列FPGA自主研发的核心板+底板方式的开发板,可快速评估FPGA性能。核心板尺寸仅70mm*50mm,底板采用沉金无铅工艺的6层板设计,专业的PCB...

Tronlong创龙
13分钟前
2
0
UUID的变种-有序

为了解决UUID无序的问题,NHibernate在其主键生成方式中提供了Comb算法(combined guid/timestamp)。保留GUID的10个字节,用另6个字节表示GUID生成的时间(DateTime)。 /// <summary> //...

Canaan_
14分钟前
2
0
Netty学习(6)——通道间数据传输

1. FileChannel实现通道间的数据传输 在Java NIO中,如果两个通道中有一个是FileChannel,那你可以直接将数据从一个channel传输到另外一个channel。 transferFrom() FileChannel的transferF...

江左煤郎
18分钟前
2
0
AngularDOM操作

gtandsn
18分钟前
1
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部