Closed lubaihua33 closed 3 years ago
When we add '-f' and '-V' option, we can see the source port.
# ntttcp -s10.0.0.4 -P 5 -n 1 -t 5 -W 1 -C 1 -b 64k --show-tcp-retrans -V -f 5001
……
01:34:18 DBG : New connection: local:5005 [socket:4] --> 10.0.0.4:5005
01:34:18 DBG : New connection: local:5002 [socket:6] --> 10.0.0.4:5002
01:34:18 DBG : New connection: local:5001 [socket:5] --> 10.0.0.4:5001
01:34:18 DBG : New connection: local:5004 [socket:7] --> 10.0.0.4:5004
01:34:18 DBG : New connection: local:5003 [socket:8] --> 10.0.0.4:5003
When we didn't add '-f', the local port is assigned by the kernel.
# ntttcp -s10.0.0.4 -P 5 -n 1 -t 5 -W 1 -C 1 -b 64k --show-tcp-retrans -V
……
01:36:23 DBG : New connection: local:53792 [socket:5] --> 10.0.0.4:5002
01:36:23 DBG : New connection: local:11454 [socket:8] --> 10.0.0.4:5005
01:36:23 DBG : New connection: local:51360 [socket:6] --> 10.0.0.4:5003
01:36:23 DBG : New connection: local:29156 [socket:4] --> 10.0.0.4:5001
01:36:23 DBG : New connection: local:29354 [socket:7] --> 10.0.0.4:5004