TSO GSO LRO GRO

From packets2photons
Jump to navigation Jump to search

Network Interface Adaptors generally have a series of tools to deal with the inefficiencies of sending many 1500 byte frames over very high capacity links. Most admins notice this for the first time when they are presented with the one below with many frames appearing to be larger than 1500 bytes.

IP 1.1.1.1.31586 > 2.2.2.2.80: Flags [S], seq 92802589, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 3052623680 ecr 0], length 0
IP 2.2.2.2.80 > 1.1.1.1.31586: Flags [S.], seq 512157486, ack 92802590, win 14480, options [mss 1460,sackOK,TS val 303700 ecr 3052623680,nop,wscale 9], length 0
IP 1.1.1.1.31586 > 2.2.2.2.80: Flags [.], ack 1, win 4117, options [nop,nop,TS val 3052623784 ecr 303700], length 0
IP 1.1.1.1.31586 > 2.2.2.2.80: Flags [P.], seq 1:116, ack 1, win 4117, options [nop,nop,TS val 3052623784 ecr 303700], length 115
IP 2.2.2.2.80 > 1.1.1.1.31586: Flags [.], ack 116, win 29, options [nop,nop,TS val 303725 ecr 3052623784], length 0
IP 2.2.2.2.80 > 1.1.1.1.31586: Flags [.], seq 1:14481, ack 116, win 29, options [nop,nop,TS val 303726 ecr 3052623784], length 14480
IP 1.1.1.1.31586 > 2.2.2.2.80: Flags [.], ack 2897, win 4077, options [nop,nop,TS val 3052623888 ecr 303726], length 0
IP 1.1.1.1.31586 > 2.2.2.2.80: Flags [.], ack 5793, win 4095, options [nop,nop,TS val 3052623889 ecr 303726], length 0
IP 2.2.2.2.80 > 1.1.1.1.31586: Flags [.], seq 14481:23169, ack 116, win 29, options [nop,nop,TS val 303752 ecr 3052623889], length 8688

Note that in the output above I have highlighted some very large frame lengths. Note that these are not actually enormous frames. The NIC is intelligently combining many frames to handoff to the CPU as an aggregated unit to reduce the number of CPU interrupts. Some of these techniques are known as:

Sender side techniques

  • TSO: TCP Segmentation Offload - (Later replaced by)
  • GSO: Generic Segmentation Offload

Receiver side techniques:

  • LRO: Large Receive Offload - (Later replaced by)
  • GRO: Generic Receive Offload

You can examine what your system is currently using with:

ethtool -k eth0

If you don't have ethtool installed you can install it with:

sudo apt install ethtool

Or

pacman -S ethtool

You can turn on an individual feature by modifying the parameters in the sample command below.

ethtool -K ethY tso on