Skip to content

Commit 9a3a2c4

Browse files
committed
Add User datagram protocol (UDP) section
1 parent d93918d commit 9a3a2c4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,3 +1496,32 @@ Use TCP over UDP when:
14961496

14971497
* You need all of the data to arrive in tact
14981498
* You want to automatically make a best estimate use of the network throughput
1499+
1500+
### User datagram protocol (UDP)
1501+
1502+
<p align="center">
1503+
<img src="http://i.imgur.com/yzDrJtA.jpg">
1504+
<br/>
1505+
<i><a href=http://www.wildbunny.co.uk/blog/2012/10/09/how-to-make-a-multi-player-game-part-1/>Source: How to make a multiplayer game</a></i>
1506+
</p>
1507+
1508+
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.
1509+
1510+
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.
1511+
1512+
UDP is less reliable but works well in real time use cases such as VoIP, video chat, streaming, and realtime multiplayer games.
1513+
1514+
Use UDP over TCP when:
1515+
1516+
* You need the lowest latency
1517+
* Late data is worse than loss of data
1518+
* You want to implement your own error correction
1519+
1520+
#### Source(s) and further reading: TCP and UDP
1521+
1522+
* [Networking for game programming](http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/)
1523+
* [Key differences between TCP and UDP protocols](http://www.cyberciti.biz/faq/key-differences-between-tcp-and-udp-protocols/)
1524+
* [Difference between TCP and UDP](http://stackoverflow.com/questions/5970383/difference-between-tcp-and-udp)
1525+
* [Transmission control protocol](https://en.wikipedia.org/wiki/Transmission_Control_Protocol)
1526+
* [User datagram protocol](https://en.wikipedia.org/wiki/User_Datagram_Protocol)
1527+
* [Scaling memcache at Facebook](http://www.cs.bu.edu/~jappavoo/jappavoo.github.com/451/papers/memcache-fb.pdf)

0 commit comments

Comments
 (0)