在服务器中
# nc -lp 2424
hi server
hi client
1
2
3
在客户端
➜ ~ nc 139.224.xxx.xx 2424
hi server
hi client
1
2
3
然后在客户端
➜ ~ sudo tcpdump -i en0 -nn -s0 -v src port 2424 -c 10 -w 2424.pcap
tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 262144 bytes
10 packets captured
93 packets received by filter
0 packets dropped by kernel
➜ ~ tcpdump -r 2424.pcap
reading from file 2424.pcap, link-type EN10MB (Ethernet)
16:49:47.874743 IP 139.224.xxx.xx.kofax-svr > 192.168.199.171.53511: Flags [P.], seq 2832846522:2832846524, ack 587632101, win 227, options [nop,nop,TS val 1632491736 ecr 751973860], length 2
16:49:48.795743 IP 139.224.xxx.xx.kofax-svr > 192.168.199.171.53511: Flags [P.], seq 2:4, ack 1, win 227, options [nop,nop,TS val 1632492657 ecr 752338627], length 2
16:49:49.786093 IP 139.224.xxx.xx.kofax-svr > 192.168.199.171.53511: Flags [P.], seq 4:6, ack 1, win 227, options [nop,nop,TS val 1632493648 ecr 752339543], length 2
但是当我重播它时,客户端 nc 控制台没有输出
➜ ~ tcpreplay -ien0 2424.pcap
Warning: May need to run as root to get access to all network interfaces.
Actual: 10 packets (681 bytes) sent in 10.84 seconds
Rated: 62.7 Bps, 0.000 Mbps, 0.92 pps
Statistics for network device: en0
Successful packets: 10
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
什么原因?我认为执行 tcpreplay 就像从服务器发送数据一样。那么在服务器 nc 控制台中发送数据与在客户端 tcpreplay 之间有什么区别?