From 9a3a2c4940d30b5cbf1e88c3a85cf25c1a81e304 Mon Sep 17 00:00:00 2001 From: Donne Martin Date: Wed, 1 Mar 2017 20:44:42 -0800 Subject: [PATCH] Add User datagram protocol (UDP) section --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 19fc795..31d8be3 100644 --- a/README.md +++ b/README.md @@ -1496,3 +1496,32 @@ Use TCP over UDP when: * You need all of the data to arrive in tact * You want to automatically make a best estimate use of the network throughput + +### User datagram protocol (UDP) + +

+ +
+ Source: How to make a multiplayer game +

+ +UDP is connectionless. Datagrams (analogous to packets) are guaranteed only at the datagram level. Datagrams might reach their destination out of order or not at all. UDP does not support congestion control. Without the guarantees that TCP support, UDP is generally more efficient. + +UDP can broadcast, sending datagrams to all devices on the subnet. This is useful with [DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) because the client has not yet received an IP address, thus preventing a way for TCP to stream without the IP address. + +UDP is less reliable but works well in real time use cases such as VoIP, video chat, streaming, and realtime multiplayer games. + +Use UDP over TCP when: + +* You need the lowest latency +* Late data is worse than loss of data +* You want to implement your own error correction + +#### Source(s) and further reading: TCP and UDP + +* [Networking for game programming](http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/) +* [Key differences between TCP and UDP protocols](http://www.cyberciti.biz/faq/key-differences-between-tcp-and-udp-protocols/) +* [Difference between TCP and UDP](http://stackoverflow.com/questions/5970383/difference-between-tcp-and-udp) +* [Transmission control protocol](https://en.wikipedia.org/wiki/Transmission_Control_Protocol) +* [User datagram protocol](https://en.wikipedia.org/wiki/User_Datagram_Protocol) +* [Scaling memcache at Facebook](http://www.cs.bu.edu/~jappavoo/jappavoo.github.com/451/papers/memcache-fb.pdf)