Find the answer to your Linux question:
Results 1 to 10 of 10
Hi everyone, I would like to disable the checksum offload of my network card. I have found this command that should solve my problem: ethtool -K eth0 tx off rx ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    8

    Disable checksum offload


    Hi everyone,

    I would like to disable the checksum offload of my network card. I have found this command that should solve my problem:

    ethtool -K eth0 tx off rx off

    When I query the status of the network card with ethtool -k eth0 everything seems ok, but when I use wireshark, the TCP packets have errors in the checksum. The connectivity is ok so I suppose that the checksum offload is not disabled.

    rx-checksumming: off
    tx-checksumming: off

    I am using Ubuntu 12.04

    Thanks in advance

  2. #2
    Just Joined!
    Join Date
    Nov 2006
    Posts
    11
    Check cables for rust. Change the tip of the cables (RJ45).

    Sometimes, the cables aren't ok, so the checksum makes the packets bad and discards them.
    When you're using a bad cable/RJ45 or a bad combination of switches/lan cards/cables/rust rj45, the packets can't be ok with the checksum because of the noise in the line.
    In this case, either using software checksum or hardware checksum (hardware checksum offload), will give you errors in wireshark.
    There is also another root cause for the problem, if the traffic in your switch is very high, your switch can be discarding packets as a result, and the checksum errors will start popping in wireshark (but this will only happen in rare conditions, such as cabling errors(circular conection) or a higher traffic than the swicth can handle)

    Positive Vibrations !

  3. #3
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    Quote Originally Posted by alopez View Post
    I have found this command that should solve my problem
    Which problem? I ask because I can't grasp why one would want to offload packet checksum calculation from the network card.

    Quote Originally Posted by alopez View Post
    when I use wireshark, the TCP packets have errors in the checksum
    Packets may always have checksum errors and historically the checksum was calculated by the CPU whenever the network card received a packet. Later network cards became easier to produce and cheaper and it made sense to let the networc card chip do the checksum calculation. This largely improved the performance and thus also the network throughput. I can't see why one would want to offload the calculation once more to the CPU.

    This happens probably because you offloaded the checksum calculation from the network card to your CPU. The checksum is then probably calculated by the CPU at a later point where wireshark already captured the packet and once the CPU calculated the checksum and found a checksum error it drops the packet.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Nov 2009
    Posts
    8
    Thanks for your replay. We are developing a new protocol that encapsulates the packets. If the checksum is calculated by the network card, it will just calculate the correct cheksum for the external packet and not the internal one. When the packet is decapsulated, the internal packet has a wrong checksum and the packet is discarded.
    I have noticed that when I turn off the checksum offload using the ethtool command, the only packets that wireshark detects with wrong checksum are SYN and ACK tcp packets. The other ones are correctly detected. I need that the checksum of these packets (SYN, ACK) are also calculated by the cpu.

  6. #5
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    On which layer of the OSI model are you developing your protocol?

    I need that the checksum of these packets (SYN, ACK) are also calculated by the cpu.
    I am rather sure that it would not matter who checks if the checksum of a packet is ok, unless you're dealing with broken hardware.

  7. #6
    Just Joined!
    Join Date
    Nov 2009
    Posts
    8
    We are encapsulating the traffic generated by the user inside udp packets. If the internal packet is for instance and icmp or udp packet, we don't have any problem but when we encapsulate TCP packets, at the other side, when we remove the header of the external packet, the pc detects errors in the checksum and throws it. We don't manipulate the internal TCP packet, we just encapsulate it and I am quite sure it is not a hardware problem as everything works when we done use the new protocol.
    We could try to recalculate the checksum of the client packets but I don't think it is a good solution.

  8. #7
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    I can't think of a way to let UDP packets transport TCP payload in a way that works. There are fundamental differences in how they work. How, for instance, do you transport a TCP packet that is larger than 65507 bytes SAFELY over UDP?

  9. #8
    Just Joined!
    Join Date
    Nov 2009
    Posts
    8
    We are working in a implementation of LISP for mobile nodes. If you find "Locator/ID separation Protocol" in google you will find the details of the protocol.

  10. #9
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    So you are basically implementing this draft:

    draft-meyer-lisp-mn-07 - LISP Mobile Node

    Interesting. I understood the idea, but I'm not familiar enough with this concept to say anything productive. Thus my best shot here is a straight: Good luck!

    PS: I quite like the principle behind HIP; that, together with a fancier routing provided by LISP would be awesome!

  11. #10
    Just Joined!
    Join Date
    Nov 2009
    Posts
    8
    Thanks for your support. I will have a look at HIP (Host Identity Protocol). It could be very interestinglok

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •