Episode 95 - TCP vs UDP

The Backend Engineering Show with Hussein Nasser

Episode | Podcast

Date: Sun, 02 Jun 2019 16:25:52 GMT

<p>&nbsp;TCP and UDP are communication protocols that allows us to send and receive data in a network. We have both for a reason since each has its advantages and disadvantages. In this video we will talk about two protocols, pros and cons of each one and will write tcp and udp server with nodejs showing you these in ACTION. coming up</p> <p>Code!&nbsp;</p> <p><a href="https://github.com/hnasr/javascript_playground/tree/master/tcp">https://github.com/hnasr/javascript_playground/tree/master/tcp</a></p> <p>Jump Codes 🏷&nbsp;</p> <p>tcp pros cons(4:12)</p> <p>Tcp demo (19:00)</p> <p>Udp pros cons (24:25)</p> <p>Udp demo (31:25)</p> <p>Summary (35:40)</p> <p>Explain TCP&nbsp;</p> <p>Pros:&nbsp;</p> <p>acknolwedgment,&nbsp;</p> <p>garenteed delivery,&nbsp;</p> <p>connection based</p> <p>congestion control</p> <p>ordered packets&nbsp;</p> <p>Cons</p> <p>Larger packets</p> <p>More bandwidth since more headers.&nbsp;</p> <p>Slower (because of retransmission)&nbsp;</p> <p>stateful once connection is lost its lost, cannot resume it. &nbsp;</p> <p>TCP Example (Code)</p> <p>telnet 127.0.0.1 8080</p> <p>Explain UDP</p> <p>Pros</p> <p>Statless,&nbsp;</p> <p>Less bandwidth&nbsp;</p> <p>smaller packets</p> <p>Faster to transmit&nbsp;</p> <p>Cons</p> <p>no ack,&nbsp;</p> <p>no garenteed delivery,&nbsp;</p> <p>no congestion control</p> <p>no ordered packets&nbsp;</p> <p>UDP client</p> <p>echo "foo" | nc -w1 -u 127.0.0.1 41234</p> <p>2:24 osi model tag&nbsp;</p> <p>14:20 stateful. S stateless video&nbsp;</p>