TCP option 3, Window Scale

RFC介绍点击打开链接

TCP协议中Window Scale Option问题【完全解决】
http://bbs.chinaunix.net/thread-1940498-1-1.html

The window scale extension expands the definition of the TCP window to 32 bits and then uses a scale factor to carry this 32 bit value in the 16 bit Window field of the TCP header (SEG.WND in RFC-793). The scale factor is carried in a new TCP option, Window Scale. This option is sent only in a SYN segment (a segment with the SYN bit on), hence the window scale is fixed in each direction when a connection is opened. (Another design choice would be to specify the window scale in every TCP segment. It would be incorrect to send a window scale option only when the scale factor changed, since a TCP option in an acknowledgement segment will not be delivered reliably (unless the ACK happens to be piggy-backed on data in the other direction). Fixing the scale when the connection is opened has the advantage of lower overhead but the disadvantage that the scale factor cannot be changed during the connection.


This value is used as a multiplier to the window value. This value may be cleared to zero as an offer to scale, while applying a scale factor of 1 to the receive window.


绿色标明报文中, 窗口大小为接收方313,显然与实际情况不符,是因为三路握手中,标明了Window Scale TCP选项,且其值为7即2^7 = 128;

(所以实际窗口大小)313*2^7 = 40064;貌似超出了win 28960这个值,求解中!!!

14:50:03.530566 IP 192.168.1.111.48102 > 192.168.1.105.7777: Flags [S], seq 2885751939, win 14600, options [mss 1460,sackOK,TS val 2222145 ecr 0,nop,wscale 5], length 0

14:50:03.530577 IP 192.168.1.105.7777 > 192.168.1.111.48102: Flags [S.], seq 2652981528, ack 2885751940, win 28960, options [mss 1460,sackOK,TS val 5210054 ecr 2222145,nop, wscale 7], length 0
14:50:03.533074 IP 192.168.1.111.48102 > 192.168.1.105.7777: Flags [.], ack 1, win 457, options [nop,nop,TS val 2222148 ecr 5210054], length 0

14:50:03.534587 IP 192.168.1.111.48102 > 192.168.1.105.7777: Flags [P.], seq 1:1025, ack 1, win 457, options [nop,nop,TS val 2222148 ecr 5210054], length 1024
14:50:03.534605 IP 192.168.1.111.48102 > 192.168.1.105.7777: Flags [.], seq 1025:6817, ack 1, win 457, options [nop,nop,TS val 2222148 ecr 5210054], length 5792
14:50:03.534634 IP 192.168.1.105.7777 > 192.168.1.111.48102: Flags [.], ack 1025, win 249, options [nop,nop,TS val 5210055 ecr 2222148], length 0
14:50:03.534663 IP 192.168.1.105.7777 > 192.168.1.111.48102: Flags [.], ack 6817, win 313, options [nop,nop,TS val 5210055 ecr 2222148], length 0

14:50:03.534833 IP 192.168.1.111.48102 > 192.168.1.105.7777: Flags [FP.], seq 6817:8193, ack 1, win 457, options [nop,nop,TS val 2222148 ecr 5210054], length 1376

14:50:03.534868 IP 192.168.1.105.7777 > 192.168.1.111.48102: Flags [F.], seq 1, ack 8194, win 330, options [nop,nop,TS val 5210055 ecr 2222148], length 0
14:50:03.538882 IP 192.168.1.111.48102 > 192.168.1.105.7777: Flags [.], ack 2, win 457, options [nop,nop,TS val 2222154 ecr 5210055], length 0

你可能感兴趣的:(tcp/ip)