mss概念

时间秒杀一切 提交于 2020-02-29 13:46:12
mss:

发送257长度的数据:

node2:/root/test#cat t8.py 
import socket
import time
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(("192.168.137.2",8080))
#print s.getsockopt()
print s.getsockname()
print s.getpeername()
#s.sendall("this is shutdown test" + "\r\n")
str='11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'
print len(str)
print s.send(str)




node2:/root/test#python t8.py 
('192.168.137.3', 31714)
('192.168.137.2', 8080)
257
257


20:12:34.206685 IP node2.31713 > node1.webcache: Flags [S], seq 1239784469, win 2560, options [mss 256,nop,nop,sackOK,nop,wscale 7], length 0
20:12:34.206784 IP node1.webcache > node2.31713: Flags [S.], seq 1132975162, ack 1239784470, win 1536, options [mss 256,nop,nop,sackOK,nop,wscale 6], length 0
20:12:34.206955 IP node2.31713 > node1.webcache: Flags [.], ack 1132975163, win 20, length 0
20:12:34.207097 IP node2.31713 > node1.webcache: Flags [.], seq 1239784470:1239784726, ack 1132975163, win 20, length 256
20:12:34.207104 IP node1.webcache > node2.31713: Flags [.], ack 1239784726, win 20, length 0
20:12:34.207123 IP node2.31713 > node1.webcache: Flags [P.], seq 1239784726:1239784727, ack 1132975163, win 20, length 1


20:12:34.207389 IP node1.webcache > node2.31713: Flags [P.], seq 1132975163:1132975193, ack 1239784727, win 20, length 30
20:12:34.207496 IP node2.31713 > node1.webcache: Flags [.], ack 1132975193, win 20, length 0
20:12:34.207503 IP node1.webcache > node2.31713: Flags [P.], seq 1132975193:1132975283, ack 1239784727, win 20, length 90
20:12:34.207587 IP node2.31713 > node1.webcache: Flags [.], ack 1132975283, win 20, length 0
20:12:34.207591 IP node1.webcache > node2.31713: Flags [P.], seq 1132975283:1132975403, ack 1239784727, win 20, length 120
20:12:34.207670 IP node2.31713 > node1.webcache: Flags [.], ack 1132975403, win 20, length 0
20:12:34.207674 IP node1.webcache > node2.31713: Flags [P.], seq 1132975403:1132975463, ack 1239784727, win 20, length 60
20:12:34.207755 IP node2.31713 > node1.webcache: Flags [.], ack 1132975463, win 20, length 0
20:12:34.207803 IP node1.webcache > node2.31713: Flags [P.], seq 1132975463:1132975537, ack 1239784727, win 23, length 74
20:12:34.207930 IP node2.31713 > node1.webcache: Flags [.], ack 1132975537, win 20, length 0
20:12:34.208862 IP node2.31713 > node1.webcache: Flags [R.], seq 1239784727, ack 1132975537, win 20, length 0


发送256长度数据

node1:/root#tcpdump -S -i eth1 '((tcp) and  (port 8080) and (host 192.168.137.3))'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
20:13:45.176342 IP node2.31715 > node1.webcache: Flags [S], seq 3052620810, win 2560, options [mss 256,nop,nop,sackOK,nop,wscale 7], length 0
20:13:45.176497 IP node1.webcache > node2.31715: Flags [S.], seq 795081864, ack 3052620811, win 1536, options [mss 256,nop,nop,sackOK,nop,wscale 6], length 0
20:13:45.176643 IP node2.31715 > node1.webcache: Flags [.], ack 795081865, win 20, length 0
20:13:45.176838 IP node2.31715 > node1.webcache: Flags [P.], seq 3052620811:3052621067, ack 795081865, win 20, length 256
20:13:45.176850 IP node1.webcache > node2.31715: Flags [.], ack 3052621067, win 20, length 0
20:13:45.176926 IP node1.webcache > node2.31715: Flags [P.], seq 795081865:795081895, ack 3052621067, win 20, length 30
20:13:45.177067 IP node2.31715 > node1.webcache: Flags [.], ack 795081895, win 20, length 0

20:13:45.177074 IP node1.webcache > node2.31715: Flags [P.], seq 795081895:795081955, ack 3052621067, win 20, length 60
20:13:45.177155 IP node2.31715 > node1.webcache: Flags [.], ack 795081955, win 20, length 0
20:13:45.177161 IP node1.webcache > node2.31715: Flags [P.], seq 795081955:795081985, ack 3052621067, win 20, length 30
20:13:45.177234 IP node2.31715 > node1.webcache: Flags [.], ack 795081985, win 20, length 0
20:13:45.177238 IP node1.webcache > node2.31715: Flags [P.], seq 795081985:795082015, ack 3052621067, win 20, length 30
20:13:45.177312 IP node2.31715 > node1.webcache: Flags [.], ack 795082015, win 20, length 0
20:13:45.177316 IP node1.webcache > node2.31715: Flags [P.], seq 795082015:795082075, ack 3052621067, win 20, length 60
20:13:45.177388 IP node2.31715 > node1.webcache: Flags [.], ack 795082075, win 20, length 0
20:13:45.177392 IP node1.webcache > node2.31715: Flags [P.], seq 795082075:795082135, ack 3052621067, win 20, length 60
20:13:45.178731 IP node2.31715 > node1.webcache: Flags [R.], seq 3052621067, ack 795082135, win 20, length 0

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!