`
新来的菜鸟
  • 浏览: 132686 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

TCP Zero Window

阅读更多

 


 

Hi, i'm having some questions about the TCP ZeroWindow flag. According to my capture we have the following scene:

98408 16:55:40.447814 192.168.45.182 -> 192.168.45.178 TCP 8790 > 9112 [PSH, ACK] Seq=109220 Ack=136247 Win=118 Len=282

98411 16:55:40.627255 192.168.45.178 -> 192.168.45.182 TCP 9112 > 8790 [ACK] Seq=136247 Ack=109502 Win=64112 Len=118

98412 16:55:40.664670 192.168.45.182 -> 192.168.45.178 TCP [TCP ZeroWindow] 8790 > 9112 [PSH, ACK] Seq=109502 Ack=136365 Win=0 Len=165

98413 16:55:40.664694 192.168.45.182 -> 192.168.63.6 TCP [TCP ZeroWindow] 8790 > 9112 [PSH, ACK] Seq=109502 Ack=136365 Win=0 Len=165

98414 16:55:40.842944 192.168.63.6 -> 192.168.45.182 TCP 9112 > 8790 [ACK] Seq=136365 Ack=109667 Win=65535 Len=0

The host 192.168.45.182 is the client and the host 192.168.45.178 is the server. One of my doubts is if the WIN in line 98412 is from client or from server.

The tcpguide web (http://www.tcpipguide.com/free/t_TCPWindowSizeAdjustmentandFlowControl.htm) site tells that the send window to the client is the received window to the server. See the following text:

 

We have seen the importance of the concept of window size to TCP's sliding window mechanism. In a connection between a client and a server, the client tells the server the number of bytes it is willing to receive at one time from the server; this is the client's receive window, which becomes the server's send window. Likewise, the server tells the client how many bytes of data it is willing to take from the client at one time; this is the server's receive window and the client's send window.

And this picture even better explains the situation: alt text




OK, walk with me...

98408 16:55:40.447814 192.168.45.182 -> 192.168.45.178 TCP 8790 > 9112 [PSH, ACK] Seq=109220 Ack=136247 Win=118 Len=282

... the client sends 282 bytes to the server and also tells the server that it's receive buffer only has 118 bytes left...

98411 16:55:40.627255 192.168.45.178 -> 192.168.45.182 TCP 9112 > 8790 [ACK] Seq=136247 Ack=109502 Win=64112 Len=118

... the server sends 118 bytes (filling up the receive buffer of the client) and tells the client that it can still send 64112 bytes before it's receive buffer is full...

98412 16:55:40.664670 192.168.45.182 -> 192.168.45.178 TCP [TCP ZeroWindow] 8790 > 9112 [PSH, ACK] Seq=109502 Ack=136365 Win=0 Len=165

... the client sends 165 bytes to the server and also tells the server that it's receive buffer is now completely full so the server should stop sending data (until the application on the client fetches the data from the TCP receive buffer)...

98413 16:55:40.664694 192.168.45.182 -> 192.168.63.6 TCP [TCP ZeroWindow] 8790 > 9112 [PSH, ACK] Seq=109502 Ack=136365 Win=0 Len=165

... this looks like a natted version of the last packet???...

98414 16:55:40.842944 192.168.63.6 -> 192.168.45.182 TCP 9112 > 8790 [ACK] Seq=136365 Ack=109667 Win=65535 Len=0

... the server acknowledges the data that the client has sent, tells the client that the application has read some data from the TCP receive window so that there is now again room for 65535 more bytes. It also does not send data, as it has not received word from the client that some buffer space has been freed...

 

Does it make more sense like this?



Hi SYNbit,

Thank's for the return. Yes, it's clear, but i have some questions:

1- When the server restart the application, the "problem tcp zerowindows" is solved;

 

2- This client connect with others server's and we don't receive any TCP ZeroWindow;

 

3- According to the picture, the window of the client is overlap by the window of the server. On steps 1, 2 and 3, the client send a 140b data and has a window of 360, leaving only 220bytes, but in the next send, the window is 260 and not 220, so the client took the window size from the server. It's that or am I wrong? Thank you very much again.

 

 

 

1) It is the responsibility of the application to fetch data from the TCP receive buffers. Since the buffer decreases to 0 and (assuming from your information) does not get back to a normal value, it is the application that is at fault here. It does not fetch data from the TCP receive buffer. So it's logical that the "zero window" condition vanishes as the application is restarted. However, the exact cause of the lockup does not go away that way.

(08 Nov '10, 06:22) SYN-bit ♦

2) As it's an application problem, communication to other servers will not be affected. Unless the same application runs on other systems without problems. Then you need to look for the specifics on the faulty server. If not, then you need to troubleshoot the application.

3) I don't think the picture is any good, for one thing, the ACK's of the server don't seem to free buffer space on the client, which of course it should be doing.

(08 Nov '10, 06:22) SYN-bit ♦

Plinio, it's important to separate the send versus receive window sizes. Remember, you cannot see the send window size in the packet traces. Only the RECEIVE window sizes are visible in the packet trace files. Things to keep in mind are: 1) Typically SEND and RECEIVE window sizes are set equally. So whatever your RCV window size is, that's the SEND window size as well. 2) The WIN field in the packet trace is ALWAYS the RECEIVE window size. It has nothing to do with what it can send.


3) TCP is a two way communication. So often it helps if you analyze the flow in one direction.

(08 Nov '10, 07:25) hansangb

4) The RCV window size tells the SENDER what the RECEIVER can take. In other words, RCV window is the throttling mechanism used by the RECEIVER. 5) The SEND window is the throttling mechanism for the sender. If it runs out of the SEND window size, it has to stop (regardless of the receiver's RCV window size).


6) The SENDER has to stop if the RECEIVER advertises a zero window.

When the application removes the data from the TCP stack, the stack will advertise the new window size as appropriate. There are some rules about when it can advertise this, but don't worry about that for now.

 

 

 

分享到:
评论

相关推荐

    TCP Window Full & TCP Zero Window

    TCP Window Full & TCP Zero Window

    W5500例程合集TCP Client.7z

    “W5500例程合集TCP Client”是一个针对W5500芯片的TCP客户端程序集合。W5500是一款集成以太网接口的网络控制器,常见于嵌入式系统中,用于实现设备的网络通信功能。 【描述解析】 描述中的“W5500例程合集TCP ...

    SnifferPro

    同时Appintell对应用访问过程中出现的TCP重传、TCP Zero Window进行监控,对应用的New Connection数量进行监控,以及应用的流量趋势进行监控,几方面数据的对比分析为技术人员分析应用性能问题提供有效的数据,我们...

    Jperf-2.0.0网络性能测试/丢包率测试/使用说明

    Jperf是将iperf命令行图形化的JAVA程序; 使用JPerf程序能简化了复杂命令行参数的...JPerf可以测试TCP和UDP带宽质量。JPerf可以测量最大TCP带宽,具有多种参数和UDP特性。JPerf可以报告带宽,延迟抖动和数据包丢失。

    wireshark高级分析1

    在TCP通信中,零窗口(Zero Window)意味着接收方暂时无法接收更多的数据,可能是由于缓冲区已满。在IO Graph中,可以找出与零窗口相关的数据包,分析其持续时间。这对于诊断流量控制或拥塞控制问题很有用。要深入...

    nginx 1.9 window 版本

    window 版本 nginx 最新版本 一般结合Tomcat 使用 配置信息如下: #运行用户 user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processes 1; #全局错误日志及PID文件 error_log /var/log/nginx/error....

    计网实验报告三

    - **Zero Window处理**:当接收方的窗口变为零时,发送方会停止发送数据,并定期发送Zero Window Probe(ZWP)包来询问接收方窗口是否可用。这种机制有助于避免长时间的数据传输中断。 #### 七、结论 通过对...

    RNDIS_Ethernet Gadget for win10.zip

    RNDIS不仅支持传统的TCP/IP协议栈,还允许其他网络协议栈的实现,比如IPv6。RNDIS的优势在于它提供了通用的、标准化的接口,使得各种USB设备可以方便地接入网络,而无需额外的硬件网络接口。 **Windows 10中的应用...

    zeroc ice3.6 window 安装包

    在下载完成后,解压缩文件“zeroc ice3.6 window 安装包_1616812214”,这个压缩包内应包含安装所需的全部组件和文档。 安装过程中,用户通常会遇到以下步骤: 1. **启动安装程序**: 解压后的安装包中应该有一个可...

    第5周-翻转课堂-传输层(下)1

    糊涂窗口综合症(Silly Window Syndrome)是流量控制中可能出现的问题,当接收方窗口非常小时,发送方可能会频繁地发送小的报文段,造成网络效率低下。为了解决这个问题,Nagle算法被引入,它规定只有当报文段达到...

    nmap强大的Linux扫描工具

    例如,零窗口扫描(Zero Window)和空扫描(NULL Scan)可以降低被目标系统检测到的可能性,这对于渗透测试或在敌对环境中工作尤为有用。 **服务指纹识别** Nmap的Fingerprinting技术能识别出目标系统上运行的具体...

    基于jpcap的网络嗅探器,具备入侵检测功能 数据集采用KKD CUP 1999,机器学习框架采用weka,二分类模型采用决策树

    对于Java开发者来说,java.net包里面提供的类和接口提供是TCP UDP两种网络协议的支持,也就是说基于JDK的网络编程都是在运输层之上的。如果要深入到网络层,就需要libpcap库的支持(在window系统中是winpcap)。由于...

    Centos7上安装oracle11gR2.doc

    #yum -y groupinstall "X Window System" "Chinese Support" "Desktop" ``` ##### 硬盘分区检查与调整 - **分区情况**: - `/boot`: 150MB - `swap`: 最少4GB (初始4096MB) - `/`: 10GB - `/home`: 5GB - `/...

    S7A驱动720版本

    - The Netlink module generated trace messages to debug window. These trace outputs has been removed. Build 221 : New Functions: - The information field "Runtime Mode" has been added to the system...

    Socket编程详解

    char sin_zero[8]; // 填充字段 }; ``` ##### IPv6 的 Socket 地址结构 IPv6的Socket地址结构也是定长的,定义在`sockaddr_in6`结构体中。 ```c struct in6_addr { uint8_t s6_addr[16]; // 128位IP地址,网络...

    Qemu-1.0.1 for windows

    [,server][,nowait][,telnet][,mux=on|off] (tcp) -chardev socket,id=id,path=path[,server][,nowait][,telnet],[mux=on|off] (unix) -chardev udp,id=id[,host=host],port=port[,localaddr=localaddr] [,local...

    计算机网络第六版答案

    Hence, it becomes possible for the attacker to issue a command to all the nodes, that target a single node (for example, all nodes in the botnet might be commanded by the attacker to send a TCP SYN ...

    qemu-0.13.0(编译过全处理器支持)

    -net none use it alone to have zero network devices. If no -net option is provided, the default is '-net nic -net user' -netdev [user|tap|socket],id=str[,option][,option][,...] Character ...

    EasyPlayerPro使用说明1

    首先,我们来看`SplitWindow`设置,它允许用户将播放窗口分割成4、8、9或16个部分,这种功能在需要同时监控多个视频源时非常实用。`Scale`选项决定了窗口内的内容如何显示,如果设置为1,则会按照原比例缩放内容,...

Global site tag (gtag.js) - Google Analytics