Wireshark TS | Packet Challenge 之 Window 案例分析

前言

来自于 Sharkfest Packet Challenge 中的一个数据包案例,Sharkfest 是 Wireshark 官方组织的一年一度的大会,致力于在 Wireshark 开发人员和用户社区之间分享知识、经验和最佳实践。印象中早期是一年一次,近几年发展成一年两次,一次貌似固定在美国,一次会在其他地区,像是欧洲或亚洲。Packet Challenge 是大会其中一个比较有意思的活动环节,通过一系列数据包案例设置关卡,参会人员进行分析挑战,测试综合分析能力。


题目信息

本次案例为 Sharkfest 2015 Packet Challenge 中的第五个也是最后一个题目 PRINTING PAIN!,数据包跟踪文件为 printpain.pcapng

主要描述如下:

  1. What is the make and model of the target printer?
  2. What file is being printed?
  3. What is the maximum TCP receive buffer size advertised by the printer?
  4. What three characteristics make frame 179 a “window zero probe?”
  5. What is the largest delay between a Window Full indication and a Window Update?

数据包信息

数据包跟踪文件基本信息如下:

λ capinfos printpain.pcapng
File name:           printpain.pcapng
File type:           Wireshark/... - pcapng
File encapsulation:  Ethernet
File timestamp precision:  microseconds (6)
Packet size limit:   file hdr: (not set)
Number of packets:   854
File size:           1071 kB
Data size:           1041 kB
Capture duration:    127.885457 seconds
First packet time:   2013-11-07 13:28:13.967672
Last packet time:    2013-11-07 13:30:21.853129
Data byte rate:      8144 bytes/s
Data bit rate:       65 kbps
Average packet size: 1219.70 bytes
Average packet rate: 6 packets/s
SHA256:              a81f71187fa52516fc27a5d5e561bf44d5d54e1dfc8cb3be9e080d0bc793933b
RIPEMD160:           d12c9eb5956dd124f99887c9fb6b0a16c7496ff7
SHA1:                8ade6e77ef0719632c1cd26ecf06c89dac051341
Strict time order:   True
Capture oper-sys:    32-bit Windows 7 Service Pack 1, build 7601
Capture application: Dumpcap 1.8.6 (SVN Rev 48142 from /trunk-1.8)
Capture comment:     Copyright Chappell University <info@chappellU.com>  Troubleshooting with Wireshark: Locate the Source of Performance Problems ISBN: 978-1-893939-9-74   You may not reproduce, duplicate, copy, sell, trade, resell, or exploit for any commercial purposes, this trace file or any  trace file available at www.wiresharkbook.com.
Number of interfaces in file: 1
Interface #0 info:
                     Name = \Device\NPF_{6C89B4B8-5C6E-437A-9BA1-CFEF8F98C68D}
                     Encapsulation = Ethernet (1 - ether)
                     Capture length = 65535
                     Time precision = microseconds (6)
                     Time ticks per second = 1000000
                     Time resolution = 0x06
                     Operating system = 32-bit Windows 7 Service Pack 1, build 7601
                     Number of stat entries = 1
                     Number of packets = 854

λ

Winows 7 系统上直接通过 Wireshark 捕获,无截断,文件大小 1071 KB,捕获数据包数量 854 个,捕获持续时间为 127.89 秒,平均速率 65 kbps,并有相关注释说明。

会话信息统计如下,仅有一条 TCP 流。

image.png

专家信息显示如下,Warning 信息中有较多的 TCP 零窗口以及 TCP 窗口满提示,说明 TCP window 存在一定问题。

image.png


数据包分析

数据包跟踪文件初步展开信息如下,Packet List 最右侧会有一些黑色告警信息的提示,点选可知基本都是 TCP 零窗口以及 TCP 窗口满提示。

image.png

1. What is the make and model of the target printer?

目标打印机的牌子和型号是什么?

分析步骤

Pakcet List 视图中 Protocol 均是 TCP ,协议分层统计信息中也没有比较特殊的专有协议。题目提到了打印机,简单通过服务端口 9100 查了下,大概是 HP 打印机。

image.png

而关于品牌和型号的信息,可以通过分析 Follow-> TCP Stream 得到

image.png

PJL(打印机工作语言),由惠普公司开发的打印机命令语言,可在打印作业级别提供打印机控制。使用 PJL 命令,可以更改默认打印机设置,如要打印的份数。

分析答案

目标打印机的牌子和型号是:HP Officejet 6500 E710n-z。


2. What file is being printed?

被打印的文件是什么。

分析步骤

同样在分析 Follow-> TCP Stream 得到相关信息

image.png

分析答案

被打印的文件是:Installation.pdf。


3. What is the maximum TCP receive buffer size advertised by the printer?

打印机通知的 TCP 接收缓冲区的最大大小是多少?

分析步骤

此题所讲的 TCP receive buffer 实际上是 TCP WindowWindow size scaling factor 的乘积,也就是字段 [Calculated window size] 的值。

可通过在 Pakcet List 视图中增加列信息,字段值为:tcp.window_size

image.png

问的是打印机,可过滤源 IP 得到打印机通告的所有 Window 值。

image.png

分析答案

打印机通知的 TCP 接收缓冲区的最大大小是:17520。


4. What three characteristics make frame 179 a “window zero probe?”

哪三个特征使得数据帧 179 标记为一个“window zero probe”?

分析步骤

首先跳转到 No.179 前后,关于零窗口的问题就很明显了。

image.png

  1. 首先客户端根据打印机所通知的窗口值,结合自己所发送的数据分段大小,得知对端打印机的接收窗口满,No.173 标记 TCP Window Full。注:这个标记指的是对端 TCP 窗口满。
  2. No.174 打印机因为自身零窗口 Win 0 , 所以标记为 TCP ZeroWindow
  3. No.175 为客户端所发送的 TCP 零窗口探测包,以查看打印机的零窗口是否依然存在,打印机会对这个零窗口探测进行 ACK 回复,即 No.176;
  4. 以此类推,如果打印机回复窗口大小仍然为零,则客户端的探测计时器加倍。

image.png

节选 Wireshark 官方文档对于 TCP ZeroWindowProbe 的定义

TCP ZeroWindowProbe

Set when the sequence number is equal to the next expected sequence number, the segment size is one, and last-seen window size in the reverse direction was zero.
If the single data byte from a Zero Window Probe is dropped by the receiver (not ACKed), then a subsequent segment should not be flagged as retransmission if all of the following conditions are true for that segment: * The segment size is larger than one. * The next expected sequence number is one less than the current sequence number.
This affects “Fast Retransmission”, “Out-Of-Order”, or “Retransmission”.

分析答案

哪三个特征使得数据帧 179 标记为一个“window zero probe”:1. the sequence number is equal to the next expected sequence number;2. the segment size is one;3. last-seen window size in the reverse direction was zero.


5. What is the largest delay between a Window Full indication and a Window Update?

“窗口满”指示和“窗口更新”之间的最大延迟是多少?

分析步骤

回顾一下 4 题,在 No.184 打印机仍回复零窗口之后,大约 11.22 秒之后打印机窗口恢复到了 16384,也就是 No.185 数据包 Win=16384 。而从 No.173 TCP Window Full 到 No.185 TCP Window Update 之间的时间延迟为 25.682732 秒。

image.png

同样,可以点选 No.173 后右键选择 Set/Unset Time Reference后,将 No.173 作为基准时间(即作为第一个数据帧),同时在 Pakcet List 视图中增加列信息,字段值为 frame.time_relative,那么 No.185 相距第一个数据帧 No.173 的时间差值为 25.682732 秒。

image.png

如何在此跟踪文件中找到类似 No.185 和 No.173 之间的时间间隔值中的最大值?可以通过显示过滤表达式过滤出所有的 “窗口满”和“窗口更新” 数据包。

image.png

然后在 Pakcet List 视图中增加列信息,字段值为:frame.time_delta_displayed,并从大到小排列找到最大差值。

image.png

image.png

分析答案

“窗口满”指示和“窗口更新”之间的最大延迟是:25.866367 秒。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值