Menu

Sample app receives some packets out of order on localhost

Help
2016-11-10
2016-11-15
  • Christian Saether

    On a simple arch-linux, running in a VirtualBox VM, trying the appserver and appclient demo programs. They are both running on the same system, using localhost.

    Every some seconds, the monitor thread on the client notes NAKs received. Recompiled with debug info, and running it under gdb, the source of the NAKs are packets that do not match the expected sequence number. What seems baffling is that sometimes they are only off by 1, but sometimes off by hundreds. It does not seem reasonable that hundreds of packets would get dropped on the floor. It is at the following snipped of code in CUDT::processData:

     // Loss detection.
       if (CSeqNo::seqcmp(packet.m_iSeqNo, CSeqNo::incseq(m_iRcvCurrSeqNo)) > 0)
       {
          // If loss found, insert them to the receiver loss list
          m_pRcvLossList->insert(CSeqNo::incseq(m_iRcvCurrSeqNo), CSeqNo::decseq(packet.m_iSeqNo));
    

    I have a gdb breakpoint command to print out the difference on the line that inserts it on the loss list.

    Same behavior after modifying both to send datagrams instead of a stream of messages.

    I could be totally missing what is supposed to be happening here. Only thing I can figure it that a packet is occasionally delivered way out of order.
    Has anyone noticed anything like this?

     

    Last edit: Christian Saether 2016-11-10
  • Christian Saether

    The system I am running on is limiting the underlying socket receive buffer size. Simlilary constraining UDT receive buffer seems to eliminate dropping the UDP packets en masse on the server. Now it oscillates between reasonable and very low data rates. Guessing it wants a lot of buffering.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.