Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

New functions for bandwidth measurement

Discussion in 'Multiplayer' started by moco2k, Apr 20, 2017.

  1. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    Hey everyone,

    the release notes for the latest patch 5.6.0p1 include the following:

    Networking: Added new statistical functions allowing measure bandwidth per connection per host or per lib.

    I haven't found any docs on this so far.
    Does anyone know if there are some docs already? Respectively, how this new feature can be used? I would really appreciate something like a small tutorial on how to measure bandwidth consumption for UNET-based games.

    Thanks in advance!
     
  2. DBronson

    DBronson

    Unity Technologies

    Joined:
    Oct 1, 2016
    Posts:
    12
    Here is a quick rundown of the various functions:

    • GetIncomingMessageQueueSize - how many messages waiting for consuming (for host)
    • GetOutgoingMessageQueueSize - how many messages waiting for sending (for host)
    • GetCurrentRTT - current round trip time measured in the last ping period, NOT AVERAGED (per connection)
    • GetIncommingPacketLoss - how many incoming packets were lost in network (network packet drop count)
    • GetIncommingPacketCount - how many packets have been sent to us (including lost packet): (for ex: from the start sent 200 packets, where 10 packets were lost in transmitting)
    • GetOutgoingPacketNetworkLostPercent - how many outgoing packet were lost in transmitting (I have sent 100 packets to somebody, 5% of them were lost while transmitting)
    • GetOutgoingPacketOverflowLostPercent - how many outgoing packets were lost due incoming queue overfull (I have sent 100 packets, 7% of them were dropped by peer, because it does not have resources to handle them)
    • GetMaxAllowedBandwidth - what is the current allowed bandwidth. (Initially I set up 1 MB per sec, but due to big % overfull packet loss, library changed this value to 500kB/sec; 500kb/sec == MaxAllowedBandwidth)
    • GetAckBufferCount - how many slots in Acknowledged buffer have been occupied (my buffer size has 32 slots, current size is 31, most probably if I send 2 reliable messages, second one will not send,
      or, my AckBufferCountpersistently about 31, and I periodically get false while I send something -> I need change isAckLong to true )
    • GetIncomingPacketCountForAllHosts - how many incoming packets were dropped due lack space in incoming queue (I receive 100 packets per sec, while I read only one per sec, in 10 sec I will receive 1000 packets where 990 will be dropped)
    • GetIncommingPacketCountForAllHosts - how many incoming packets I received (so far: from game start I received 100000 packets) (see this function name is not correlated with GetIncomingPacketDropNumber() name and possible should be changed)
     
    nxrighthere and Leoo like this.