Solved packets on send side and receive side are not equal

During network performance testing, I found on the sending side, netstat -s told me there are 2727108 packets sent, but on the corresponding receiving side, netstat -s told me there are 5576550 packets received. The packets number is almost double even though the total bytes on both send side and receive side are almost equal: 8015836945 bytes vs. 7989364242 bytes.

Is it normal?

If that is normal, then it means the receiving side uses smaller packet which is almost half size of sending side. Smaller packet on receiving side will cause more copy and lower the performance, right? It looks like to be abnormal for me.

I used iperf3 to evaluate network performance.
Two machines are directly connected (without gateway). Before the testing, the two machines are reboot in order to clean the netstat statistic information.

netstat -s on sending side
Code:
tcp:
        2727108 packets sent
                2723102 data packets (8015836945 bytes)
                3870 data packets (5572528 bytes) retransmitted
                0 data packets unnecessarily retransmitted
                0 resends initiated by MTU discovery
                134 ack-only packets (3 delayed)
                0 URG only packets
                0 window probe packets
                0 window update packets
                2 control packets
        2797706 packets received
                2782646 acks (for 8015139010 bytes)
                14405 duplicate acks
                0 acks for unsent data
                204 packets (15924 bytes) received in-sequence
                0 completely duplicate packets (0 bytes)
                0 old duplicate packets
                0 packets with some dup. data (0 bytes duped)
                0 out-of-order packets (0 bytes)
                0 packets (0 bytes) of data after window
                0 window probes
                22 window update packets
                0 packets received after close
                0 discarded for bad checksums
                0 discarded for bad header offset fields
                0 discarded because packet too short
                0 discarded due to memory problems
netstat -s on receiving side
Code:
tcp:
        2797569 packets sent
                248 data packets (44407 bytes)
                0 data packets (0 bytes) retransmitted
                0 data packets unnecessarily retransmitted
                0 resends initiated by MTU discovery
                2797311 ack-only packets (2 delayed)
                0 URG only packets
                0 window probe packets
                9 window update packets
                1 control packet
        5576550 packets received
                214 acks (for 44414 bytes)
                121 duplicate acks
                0 acks for unsent data
                5557300 packets (7989364242 bytes) received in-sequence
                0 completely duplicate packets (0 bytes)
                0 old duplicate packets
                0 packets with some dup. data (0 bytes duped)
                18198 out-of-order packets (25832304 bytes)
                436 packets (629880 bytes) of data after window
                1 window probe
                0 window update packets
                2 packets received after close
                0 discarded for bad checksums
                0 discarded for bad header offset fields
                0 discarded because packet too short
                106 discarded due to memory problems
 
8015836945 bytes / 2723102 packets = 2943.64.

I'm guessing your NIC supports TSO since the standard would be a 1500 byte packet. ifconfig <interface> -tso will likely make the results match your expectations but TSO can be left active if it doesn't interfere with anything as it will save some CPU on the sending side.
 
Yes. Just as you said, my NIC supports TSO. After I disable TSO, the sending/receiving side show consistent packet number. Thanks.
 
Back
Top