1. Overview

Modern network interface cards (NICs) can handle some of the processing of the TCP/IP stack instead of the system’s main CPU. This is called TCP offload.

In this tutorial, we’ll learn about TCP offload. Then, we’ll understand how to disable it.

2. Brief Information About TCP Offload

TCP Offload Engine (TOE) is a technology used in modern NICs to move the processing of the TCP/IP stack from the system’s main CPU to the NIC.

The processing overhead on the CPU increases with high-speed networks, such as 10 Gigabit Ethernet. Moving some or all of the functionality of the TCP/IP stack to the NIC helps in freeing the main CPU and improving the network throughput.

Since the TCP/IP stack has many features, there are many types of offloads. For example, TCP is a stream-oriented protocol, which means that data is transmitted as a continuous stream of bytes. Therefore, TCP must segment the data. TCP Segmentation Offload (TSO) uses the NIC to handle segmentation.

Another example of offload is UDP Fragmentation Offload (UFO). In this case, the NIC handles UDP fragmentation to fit large UDP datagrams into MTU-sized packets.

We may sometimes want to disable TCP offload if we observe random connectivity problems such as packet transmission errors. One reason may be a buggy NIC driver. We’ll discuss how to disable TCP offload in the next section.

3. Disabling TCP Offload Using ethtool

We’ll disable TSO as an example. We’ll use ethtool, a command-line utility for querying and managing network driver and hardware settings, for this purpose.

Let’s first check the status of TCP offload using ethtool:

$ ethtool –k eth0 | grep tcp
tcp-segmentation-offload: on
        tx-tcp-segmentation: on
        tx-tcp-ecn-segmentation: off [fixed]
        tx-tcp-mangleid-segmentation: on
        tx-tcp6-segmentation: on

The -k option of ethtool is for querying the states of protocol offloads and other features of the specified network interface device. The name of the NIC, in our case, is eth0. We can use the –show-offload or –show-features options instead of the -k option.

The command ethtool –k eth0, by itself, displays a long list of offloads. Therefore, we filter the output using grep to display only TCP-related offloads.

The first line in the output is tcp_segmentation-offload: on. Therefore, TSO is enabled. A setting listed as [fixed] means that it can’t be changed.

TSO is a combination of four offloads according to the output. It consists of tx-tcp-segmentation, tx-tcp-ecn-segmentation, tx-tcp-mangleid-segmentation and tx-tcp6-segmentation.

We’ll disable TSO using the -K option of ethtool:

$ ethtool –K eth0 tso off

The -K option is for changing the offload parameters of the specified network device. We can also use the –offload or –features options instead of -K.

We must have root privileges to change the settings of a network device.

Let’s check the status of TCP offload once more:

$ ethtool –k eth0 | grep tcp
tcp-segmentation-offload: off
        tx-tcp-segmentation: off
        tx-tcp-ecn-segmentation: off [fixed]
        tx-tcp-mangleid-segmentation: off
        tx-tcp6-segmentation: off

We disabled the TSO successfully. Disabling TSO disabled all the offloads in the combination. However, we can also disable an individual offload:

$ ethtool –K eth0 tso on
$ ethtool –K eth0 tx-tcp6-segmentation off

Firstly, we enabled TSO using ethtool -K eth0 tso on. Running the command ethtool –K eth0 tx-tcp6-segmentation off only disables the offload tx-tcp6-segmentation. Let’s verify it:

$ ethtool –k eth0 | grep tcp
tcp-segmentation-offload: on
        tx-tcp-segmentation: on
        tx-tcp-ecn-segmentation: off [fixed]
        tx-tcp-mangleid-segmentation: on
        tx-tcp6-segmentation: off

As it’s apparent from the output, we’re successful in disabling only tx-tcp6-segmentation.

4. Conclusion

In this article, we learned about TCP offload and discussed how to disable it.

Firstly, we saw that it’s possible to move the processing of the TCP/IP stack to the NIC.

Then, we learned how to disable TCP offload using ethtool. We disabled TSO as an example. We understood how to disable all of the offloads in TSO. Additionally, we saw how to disable the offloads in TSO individually.

Comments are closed on this article!