为什么一个包大小不是256呢?
sysctl -w net.ipv4.tcp_timestamps=0
客户端发送node2:/root/test#python t4.py
('192.168.137.3', 31689)
('192.168.137.2', 8080)
259
node1:/root#tcpdump -i eth1 '((tcp) and ( host 192.168.137.3) and (port 8080))'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
05:15:00.220771 IP node2.31689 > node1.webcache: Flags [S], seq 1035945882, win 2560, options [mss 256,nop,nop,sackOK,nop,wscale 7], length 0
05:15:00.220807 IP node1.webcache > node2.31689: Flags [S.], seq 513129897, ack 1035945883, win 1536, options [mss 256,nop,nop,sackOK,nop,wscale 6], length 0
05:15:00.221174 IP node2.31689 > node1.webcache: Flags [.], ack 1, win 20, length 0
05:15:00.221568 IP node2.31689 > node1.webcache: Flags [.], seq 1:257, ack 1, win 20, length 256
05:15:00.221583 IP node1.webcache > node2.31689: Flags [.], ack 257, win 20, length 0
05:15:00.221615 IP node2.31689 > node1.webcache: Flags [P.], seq 257:260, ack 1, win 20, length 3
05:15:00.221726 IP node1.webcache > node2.31689: Flags [P.], seq 1:70, ack 260, win 20, length 69
05:15:00.222048 IP node2.31689 > node1.webcache: Flags [.], ack 70, win 20, length 0
05:15:00.222076 IP node1.webcache > node2.31689: Flags [P.], seq 70:305, ack 260, win 23, length 235
05:15:00.222117 IP node2.31689 > node1.webcache: Flags [R.], seq 260, ack 70, win 20, length 0
05:15:00.222803 IP node2.31689 > node1.webcache: Flags [R], seq 1035946142, win 0, length 0
把服务端的 timestamps 禁用掉