Handling UDP resends

Started by
20 comments, last by wodinoneeye 15 years, 3 months ago
Sorry for resurrecting this, just got back from vacations.

Quote:Original post by ben_garney
The issue is that routers tend to allocate bandwidth based on who's using it. If you are regularly using a certain amount of bandwidth then it assumes you will keep using that much. If you are jumpy (ie you use 5kb/sec for a while then jump to 40kb/sec then back down) then it introduces extra lag as the router has to reallocate bandwidth to meet the sudden demand. In some cases, the router may not have enough storage to keep the packets around until they can be sent and will drop them. In other words, user is playing game, something exciting happens, and suddenly user has a big lag spike - if you don't budget a fixed data rate.


If this is true, then i will be padding my packets with some resends until i reach a minimum amount of data, probably based on the max number of players in the game.

Thanks for the input.



Advertisement
Quote:Original post by dmail
This is the method which many UDP based games that want reliable delivery use, the author also has other articles which may interest you.



I did my own reliable protocol much like that years ago (bitmapped ack windows /flow control/etc..) and it worked fairly well (for what I was using it for). I did somewhat different by usually doing resends when the ACK window indicated a packet was missing (for 'reliable' mode data versus a seperate stream of reliable-unneeded data).
I did have large packets being parts of long data blocks which had to be sent intact. And also had frequent bi-directional traffic to constantly have a stream of ack data traveling in both directions (many games have a majority of the traffic headed out to a client).

The author says to have the application rebuild more data instead of resending the lost packets. That needs more explanation (and examples as that gets complicated). It might be as simple as having a flag on the packets to prevent resend because the content was data which is constantly updated (versus single event type data that isnt sent again). You may have to segregate reliable vs reliable-unneeded data to different packets.

The application might (depending on the process flows) have to do alot of work to reconstitute the 'patched' (versus 'resent') data -- so automatically using that as a strategy might not fit all usages.

Another scheme Ive heard of (when data isnt large) is to piggyback the last data load onto the subsequent packet which can cut down a majority of resend scenarios (single packet loss) -- as long as the bandwidth isnt impacted.

--------------------------------------------[size="1"]Ratings are Opinion, not Fact

This topic is closed to new replies.

Advertisement