none
TDS protocol implementation with multi-packet transfer generates Error 4014 RRS feed

  • Question

  • Hello!

    Microsoft SQL Server 2017, Windows 10 Pro

    I am currently implementing the TDS protocol on a TCP/IP capable PLC where no suitable libraries are available. I'm using the ms docs as a guideline and it's working pretty good so far, I have tested that by inserting data to different SQL databases and tables.

    However, I encounter severe problems when I try to use multiple TDS packets for one SQL batch. I'm getting the error 4014, severity 20 on the SQL server after sending the last TDS packet. I've already done my research and found that this error may be caused by chimney offload, RSS or NetDMA. However, I'm not convinced that this is the cause for the problem as I have testet to access the same table on the same server by using MS Excel. Changing those settings isn't an option anyway.

    Using wireshark, I can see that Excel sends 5 packets with 4kB each and no network error is generated. When comparing the mutli-packet transfer to the packets sent from the PLC, I can not detect any differences. Observing my PLC packets with wireshark also shows me that wireshark is fully capable of reassembling all my packets to one SQL batch message which shows me that my data output is correct.

    Of course, I have considered the following things:

    • Each packet but the last one MUST have the same length as the negotiated packet size during login; My SQL batch parser takes care about that
    • The PackedID of each TDS packet MUST be incremented, starting from 1 (equal to MS Excel where that works)
    • The Status of each TDS packet but the last MUST be set to 0; The last packet must set the status to 0x01 to indicate EOM
    • Trying different packet sizes of 1kB, 2kB and 4kB

    My questions are: Did I miss something in the protocol definition that might cause that network error? Did I miss something in the login/prelogin message that has to be set in a way to allow multi-packet transfer? Could there be anything else that i have not considered?

    Kind regards,
    Markus Neubauer

    Friday, September 18, 2020 8:01 AM

All replies

  • Hi Markus

    Thank you for contacting Microsoft Open Specifications Support. An engineer will get back to you shortly.


    HungChun Yu (MSFT)

    Friday, September 18, 2020 8:35 AM
  • Hello Markus, I will be assisting you with this issue.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications
    Sunday, September 20, 2020 6:51 PM
    Moderator
  • Hello!

    Thank you for your assistance. Is there additional information I can supply you with?

    Kind regards,
    Markus Neubauer

    Monday, September 21, 2020 6:35 AM
  • Hello Markus, Can you send the SQL Server network trace that resulted in the error 4014 to dochelp at microsoft dot com ? Please include the SQL Server ERRORLOG from the same time frame.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications
    Wednesday, September 30, 2020 7:27 PM
    Moderator
  • Hello Markus, Perhaps you are busy and unable to provide the data requested per my previous post. Just want to let you know that you can provide that data as soon as you are ready to work on the issue and we can resume investigation.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications
    Friday, October 16, 2020 5:44 PM
    Moderator