Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Report packet loss rate?

Discussion in 'Multiplayer' started by chrismarch, Jul 10, 2015.

  1. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    470
    Is there a way, with Unity 5.1.1f1, to get some measure of how many packets are being lost from a NetworkServer to a NetworkClient, on the NetworkServer? I am measuring the latency with NetworkTransport.GetCurrentRtt, but I really want to log packet loss statistics to debug some issues. We are using the HLAPI with ReliableSequenced channel QoS.
     
  2. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    470
  3. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    470
    NetworkTransport.GetPacketSentRate - NetworkTransport.GetRemotePacketReceivedRate can be negative (so far I've see -1 to -8). Is that a bug? What does it mean?

    Is it an issue with different numbers of seconds or fractions of a second used for the calculations? If so, could NetworkTransport have int NetworkTransport.GetPacketSentBytes, int NetworkTransport.GetRemotePacketReceivedBytes, and int NetworkTransport.GetPacketReceivedBytes please?
     
    Last edited: Jul 13, 2015
  4. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    It is a bug, (fixed but need to be ported to patch). Moreover we marked function GetRemotePacketReceivedRate as obsolete... Do not use this function it shows wrong result.
     
  5. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    BTW Chris, if you need this feature we can expose function which will be report how many packet was lost due network problem and how many packets was lost due lack of space in queues.
     
    chrismarch likes this.
  6. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    470
    Yes please! We may become blocked without a way to diagnose the packet loss from our servers, so that we can log it and associate that packet loss with errors. We are currently debugging issues around this.
     
  7. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    I added GetNetworkLostPacketNum() function which will return number of out of order and lost packet from the start. Will be available in the next patch I guess
     
    chrismarch likes this.
  8. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    most probably should be in the next 5.1.2 patch 1
     
    chrismarch likes this.
  9. KaushikArooga

    KaushikArooga

    Joined:
    Sep 29, 2015
    Posts:
    2
    Has someone verified if this is working as expected? I was still getting this as 0 on Unity 5.2.2f. I was using Network emulation as well to cause delays; not sure if that would certainly cause packet loss per say.
     
  10. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
  11. IcaroDLima

    IcaroDLima

    Joined:
    Aug 6, 2019
    Posts:
    25
    In 2018.4 i'm having the same problem. Any solution?