You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1496,3 +1496,32 @@ Use TCP over UDP when:
1496
1496
1497
1497
* You need all of the data to arrive in tact
1498
1498
* You want to automatically make a best estimate use of the network throughput
1499
+
1500
+
### User datagram protocol (UDP)
1501
+
1502
+
<palign="center">
1503
+
<imgsrc="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)
0 commit comments