 is required, the solution I've seen (which makes sense conceptually) is to use acknowledgements (i.e. the server sends a packet to the client, and when the client receives that message, it sends back an acknowledgement to the server).
What happens when the acknowledgement is dropped?
In the example above (one server sending a packet to one client), the server handles potential packet loss by re-sending packets every frame until acknowledgements are received for those packets. You could still run into issues of bandwidth or out-of-order messages, but purely from a packet-loss perspective, the server is covered.
However, if the client sends an acknowledgement that never arrives, the server would have no choice but to eventually stop sending that message, which could break the game if the information contained in that packet was required. You could take a similar approach to the server (i.e. keep sending acknowledgements until you receive an ack for the ack?), but that approach would have you looping back and forth forever (since you'd need an ack for the ack for the ack and so on).
I feel my basic logic is correct here, which leaves me with two options.

Send a single acknowledgment packet and hope for the best.
Send a handful of acknowledgment packets (maybe 3-4) and hope for the best, assuming that not all of them will be dropped.

Is there an answer to this problem? Am I fundamentally misunderstanding something? Is there some guarantee of using UDP I'm not aware of? I feel hesitant to move forward with too much networking code until I feel comfortable that my logic is sound.

A:

This is a form of the Two Generals Problem, and you're right - no number of retries is enough to perfectly guarantee receipt.
In practice in games, there's usually a time horizon beyond which the information doesn't really matter though even if it technically arrives reliably. Like finding out you had a perfect headshot lined up 2 seconds ago - it's too late for the player to use that information now. 
If your packet loss is so high that you can't routinely get the needed info through inside a tight reaction window, then for a realtime game you might be better off kicking the player and trying to find a better match for them elsewhere, rather than continue trying to send the packet to emulate a reliable connection.
Because of this, some game replication systems skip acknowledgement
is required, the solution I've seen (which makes sense conceptually) is to practice recognition (i.e. the server sends a package to the node, and when the client receives that message, it transport back an acknowledgment to the server). 
 What happen when the acknowledgement is dropped? 
 In the exercise above (one server sending a mailboat to one customer), the server handles potential packet loss by re - sending package every frame until acknowledgements are received for those mailboat. You could still run into issues of bandwidth or out - of - ordering messages, but purely from a packet - loss perspective, the server is cover. 
 However, if the client sends an acknowledgement that never arrives, the server would accept no choice but to eventually stop sending that message, which could break the game if the information contained in that packet was required. You could consider a similar approach to the server (i.e. observe sending acknowledgements until you receive an ack for the ack ?), but that overture would have you looping back and forth forever (since you'd necessitate an ack for the ack for the ack and so on). 
 I feel my basic logic is correct here, which leaves me with two options. 

 station a single acknowledgment packet and hope for the best. 
 Send a handful of acknowledgment package (maybe 3 - 4) and hope for the best, assuming that not all of them will be dropped. 

 Is there an answer to this trouble? Am I fundamentally misunderstanding something? Is there some guarantee of using UDP I'm not aware of? I feel hesitant to move forward with too much networking code until I feel comfortable that my logic is legal. 

 A: 

 This is a form of the Two Generals Problem, and you're veracious - no number of retries is enough to absolutely guarantee receipt. 
 In practice in games, there's normally a time horizon beyond which the information doesn't in truth matter though even if it technically arrives faithfully. Like finding out you had a perfect headshot lined up 2 seconds ago - it's too late for the player to use that information now. 
 If your packet loss is thus high that you can't routinely get the necessitate info through inside a tight reaction window, then for a realtime game you might be better off complain the player and trying to find a better match for them elsewhere, rather than proceed try to send the packet to emulate a reliable connection. 
 Because of this, some game replication systems omission acknowledgement
 is required, the solution I'ye seen (which makes senve condeptuallh) is to use acknowledgements (i.w. the server sends a packet to the cpient, ane whtn the client recxjves that mesawge, nt sends back an acknowledcement to the vefvzr).
What happens when the acknowledgemqnt is crlpped?
In the exwmplt afove (one server sending a packet to ons clienu), the server handlrs potential packet loss bj re-dending packets evfry frame ubtil qcknowledgemdnts are rtczived for tgose packets. You could still ruv intp issues od vanffidth or ouv-of-ordvr messages, bmn purelf from s packet-loss pcrspertivw, the server is coverxd.
However, if the clignt sends dn acknowledgement rhqt neeer drrixws, ghe sxrvsr woupd iave no chojce but to wventually stop sencigt that messags, whicr sould break the game if the information cohtained in that packet qas required. You coulf take a fimilar approach to the server (i.e. keep sending acnnowlxdeemtnbf ynhil you receive an ack for the ack?), but that a[lrpabh would have you looping bavk amq forth forevgr (sincz yku'd need an ack fog the ask foe the ack and so on).
I feel my basic logic is correct kerw, which leaves me cith two optnons.

Semd a xingle acknowledgment pccket znd hope fog the besf.
Rend a handful ow abknofledgmenu packets (maybe 3-4) agd hope fir tke best, xssuking trat not alp of bvem will be droppef.

Is tkere dn answer ho this problem? Am I fundamentally misunderstsnginc somethnng? Is there some gtarantee of usnng UDP N'm not aware of? P feel hevitant to mjve forward whjh too much nxtworking codw unril I fddl comfortable that my logic is siund.

A:

This is a fork ow the Two Generaos Kriblem, and you'rr rkghe - np ggmber of retsies is rnougf to perfecbly guatantee receipt.
In prawtics in games, there's ismally a tume horison beyond whoch the informatioj doevn't realky iatter though even if it technjcally argivcs reliably. Lyke nindyng out yob had a perfect headshot lined up 2 seconvs ago - it's too late foe the player to use uhat informatmon nor. 
If your packet loss is so hugh that you can't routinely get the nesded itfo tjrough inside a tight reaction window, then for a realtime game you might ve betvew off kickihg tne pldyzr cnd tryyng vo find a better mstch for them elsewhere, rather vhan contituz trying to send the packet tp dmulate a relkable connection.
Because kf this, xome game replication systems slip acknowledgement
is required, the solution I've seen (which conceptually) to use (i.e. the server client, when the client that message, it back an acknowledgement to the server). happens when the acknowledgement is dropped? In the example above (one server sending packet to one client), the server handles potential packet loss by re-sending packets frame acknowledgements received those packets. You could still run into issues of bandwidth or out-of-order messages, but purely from packet-loss perspective, the server is covered. However, if client sends an acknowledgement never arrives, the server would no but to stop that which could break game if the information contained in that packet was required. You could take a similar approach to server (i.e. acknowledgements until receive ack the ack?), but would have you looping back and you'd need an ack for the ack for ack and on). I feel my basic logic correct here, which leaves me with two options. a single acknowledgment packet and hope for the best. Send a handful of acknowledgment packets and hope for the assuming that not of will dropped. there an to this problem? Am I fundamentally misunderstanding something? Is there some of using UDP I'm not aware of? I feel hesitant forward too much networking until I feel comfortable my is sound. A: This form the and right no number of retries enough to perfectly guarantee receipt. practice in games, there's which the information doesn't really matter though even it technically arrives reliably. Like finding out had a perfect headshot lined up 2 seconds ago - it's too for the use that information now. If your packet loss so high that you routinely get the needed info through inside a tight window, for a game you might better off kicking player and trying a better for elsewhere, trying to send the packet to a connection. Because of this, some replication acknowledgement
 is required, the solution I've sEen (which maKes seNse ConCePtuaLly) iS to use acknowleDGemeNts (i.e. the server sends a paCket tO tHE cliENt, And whEn the clIEnT REceIvEs ThaT mESsAge, it SenDs back aN acknowledGemEnT to the server).
wHaT happens whEn tHe acknowledgEmeNt is drOpPed?
iN the eXamPle abOve (one SErver sEnding a paCkET to one CLient), thE SErVer hAndles potential paCKeT Loss by re-sendinG packeTs EVeRY FraMe uNtil acknowLeDgemeNTs are reCEiVED For THose packets. YoU could still RUn iNto issUeS of BAndwidTh or oUt-OF-orDer messages, But pUrely from A packeT-Loss perSPective, The serVer Is cOverED.
HOwEveR, iF The CLiEnt SEndS an acknoWlEdGemenT thaT NEVEr arRivEs, thE servEr would have no ChoIce bUT to EventUally Stop SeNding That meSsage, WhIch could break thE gamE if the infOrmAtIon CoNtainED in thaT paCkeT was reqUired. YoU CouLd TAKE a Similar approach to tHe SERvEr (i.e. keep SendinG AcKnOWledgemeNtS unTil yOU ReceiVe an ACk For the acK?), but thAT aPpRoach woUlD have yOu LooPinG back ANd foRth forEver (sincE you'd NEed an ack for the ACk for the ack anD So ON).
i fEEl my BasIc logic is coRrecT Here, WhicH LeAveS Me witH two oPtIOnS.

send a single acknowleDgMent paCket aNd hope for the bEst.
Send a haNDFUl of acknOwleDGmENt packets (maybe 3-4) And hoPe for the beST, assuminG that Not all of Them will bE DRopped.

Is TheRe aN anSweR TO tHis problem? Am I FUNdamEnTally miSunDerstanDinG soMetHinG? IS there somE guarantEe Of UsInG UDp I'm noT Aware of? I FeEl hEsItaNt to mOVe forwArd wiTh toO mUcH NetWorking COdE UNtil i fEeL comForTaBle thAt my LOgiC is sounD.

A:

This is a ForM Of thE TWo generalS Problem, and yoU'rE right - no nuMbEr oF retriES Is enough To perfectly guarantee recEIpt.
In prActIce in GameS, there's usUalLy a timE hoRIzon beYond whIch thE iNfoRMAtion DOEsN't rEaLly matter tHOUgh Even iF iT tecHnicallY arrives reliably. LiKE fiNding out you haD a pErfeCT HeAdsHOt LIneD uP 2 SecONDs ago - it's too late For the playEr TO uSe that infoRMatIoN now. 
If yOur packEt losS Is so higH that you cAn't routinElY get THE neEded info thRough insIde a tight REactiON wIndow, TheN for a rEaLtiMe gamE you miGHt bE bettEr off kIcKing thE playEr And tryinG to find a better match for tHem elsEwherE, raTher than cOntINue Trying to sEnd tHe packet to EmuLatE a relIabLE connEctiON.
BEcaUSe of tHis, sOMe game repLIcAtiON SyStems skip acKNOWleDgemeNt
 is required, the solution  I've seen  (whi chmak es  sen se c onceptually) i s  touse acknowledgements ( i.e.th e  ser v er  send s a pac k et t o t he  c lie nt ,  a nd wh enthe cli ent receiv esth at message,i tsends back  an  acknowledge men t to t he  se r ver). 
Wh at ha ppensw hen th e acknowl ed g ementi s dropp e d ?In t he example above( on e  server sendin g a pa ck e tt o  on e c lient), th eserve r  handle s  p o t e nti a l packet loss  by re-send i ngpacket seve r y fram e unt il ack nowledgemen ts a re receiv ed for those p a ckets.You co uld  st illr un  i nto  i s sue s  o f b a ndw idth orou t- of-or derm e s s ages , b ut p urely  from a packe t-l ossp ers pecti ve, t he s er ver i s cove red.Ho wever, if the c lien t sends a n a ck now le dgeme n t that  ne ver  arrive s, thes erv er w o ul d have no choice b ut t oeventual ly sto p  s en d ing that  m ess age, w hichcoul d  b reak the  gamei fth e infor ma tion c on tai ned  in t h at p acketwas requ ired. You could take a similar app r oa c h  t o  the  se rver (i.e.keep send inga ck now l edgem entsun t il you receive an ackfo r theack?) , but that ap proach wou l d have you  loo p in g  back and fort h for ever (sinc e  you'd n eed a n ack fo r the ack f or the a ckand  so  on ) . 
I  feel my basi c logi cis corr ect  here,whi chlea ves  m e with tw o option s. 
Se nd  asingl e  acknowl ed gme nt  pa cketa nd hop e for  the  b es t .
S end a h a nd f u l of  a ck nowl edg me nt pa cket s  (m aybe 3- 4) and ho pef or t he  b est, as suming that n ot  all of th em  wi ll bed r opped.
Is there an answer to t h is prob lem ? AmI fu ndamental lymisund ers t anding  somet hing?  I s t h e re so m e  g uar an tee of usi n g  UD P I'm  n ot a ware of ? I feel hesitantt o m ove forward w ith  too m uc h n e tw o rki ng cod e until I feel co mfortableth a tmy logic i s  so un d.

A:
This i s a f o rm of t he Two Ge nerals Pr ob lem, a ndyou're rig ht - nonumber of retri e sis en oug h to p er fec tly g uarant e e r eceip t.
Inpr actice  in g am es, ther e's usually a time hori zon be yondwhi ch the in for m ati on doesn' t re ally matte r t hou gh ev eni f ittech n ic all y  arri vesr eliably.L ik e f i n di ng out youh a d  aperfe cth eadsho t li ned up 2 secondsa go - it's toolate f orthe play er  to use that i nfo rm a t ion now.  If your pac ket loss  i s  so h igh th at you  can'tr o ut i nely g et t heneeded in foth r ough in si de a tigh t re ac tion w indow, then f or a realtime ga me yo u might bebette roff kic k ingthe player  and trying  to fi nd a  bett er matc hfor th emel sewhere, r a ther than  cont inue tr yi ng t o s end th e pa c k et to  emu la tea reliabl e co n ne ct i on. 
Bec auseof  thi s, some g a me repli cat i on syst em s s k i p ackn o wl e d gement
 is_required, the_solution I've seen (which_makes sense_conceptually)_is to_use_acknowledgements (i.e. the_server sends a_packet to the client,_and when the_client_receives that message, it sends back an acknowledgement to the server).
What happens when the_acknowledgement_is dropped?
In_the_example_above (one server sending a_packet to one client), the_server handles_potential packet loss by re-sending packets every frame_until_acknowledgements are received_for those packets. You could still run into issues_of bandwidth or out-of-order messages, but_purely from a_packet-loss_perspective,_the server is covered.
However,_if the client sends an acknowledgement_that never arrives, the server would_have no choice but to eventually stop_sending that message, which could break_the game if the information_contained in_that packet was required. You_could take a_similar approach_to the server_(i.e. keep sending acknowledgements until you_receive an ack_for the ack?), but that approach_would_have you looping_back_and_forth forever_(since you'd need_an_ack for_the_ack for the ack and so_on).
I_feel my basic logic is correct here,_which leaves me with_two_options.

Send a single acknowledgment_packet and hope for the_best.
Send a handful of acknowledgment packets_(maybe 3-4)_and hope_for the best, assuming that not all of them will be_dropped.

Is there an answer to this_problem? Am I fundamentally_misunderstanding something?_Is_there some guarantee_of_using UDP_I'm not aware of? I feel hesitant_to move_forward with too much networking code_until I feel comfortable_that_my logic is sound.

A:

This is a_form of the Two Generals Problem,_and you're right - no_number_of_retries is enough to perfectly_guarantee receipt.
In practice in games, there's_usually a time_horizon beyond which the information doesn't really_matter_though even if it technically arrives_reliably._Like finding out you had a_perfect_headshot_lined up 2 seconds ago_- it's too late for the_player to use that information now. 
If your packet_loss is so_high that you can't routinely_get_the_needed info through inside a tight reaction window, then for_a realtime_game you might_be better off kicking the player and trying to find_a better match for them elsewhere, rather_than continue trying to send the packet to emulate a reliable_connection.
Because of this, some game replication systems skip_acknowledgement