How to handle TCP checksum, if adapter support TCP checksum offloading?

Discussion in 'Server Networking' started by Rajesh Gupta, Aug 3, 2004.

  1. Rajesh Gupta

    Rajesh Gupta Guest

    How to handle TCP checksum, if adapter support TCP checksum offloading?

    Hi Everyone,
    I am writting a IM driver, where i am modifing the Source Ip and Destonation
    IP in the outgoing packets.

    I am not sure what to do with the TCP checksum, if adapter supports TCP
    checksum offloading.

    I have tested my driver with adapter, which does not support TCP checksum
    offloading. It works fine. My checksum calculations are fine. When i am
    testing my IM driver on adapter which supports TCP checksum offloading, its
    not working.

    I am not sure, ho to handle TCp checksum offloading in IM driver. Here are
    the strange things i have noticed.

    1. If i do not change anything, then it does not work. Understood.

    2. If i calculate the TCP checksum (using TCp psuedo header and TCP segment)
    and insert this checksum in the TCP header. It works for the first TCp
    packet. For rest of the packets, its incorrect. I have written simple server
    and client socket application. So this checksum works for first packet i.e.
    SYN packet. Thats strange to me, why it worked for SYN and after that its
    incorrect for all other packets.

    NOTE: I am checking my packets on another machine. So i am seeing the
    correct data send on wire using etherreal.

    3. I read somewhere, that sometimes TCP calculate the checksum of
    psudoheader and fill this in the TCP header. So hardware only calculate the
    TCP segment checksum and does not have to touch the IP header. I tried that.
    Nothing works after that.

    I am not sure, why SYN worked and how should i handle this in my IM driver?

    Thanks a lot in advance.

    Rajesh Gupta, Aug 3, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.