{"id":21,"date":"2015-08-19T02:08:12","date_gmt":"2015-08-19T02:08:12","guid":{"rendered":"http:\/\/wiki.thomasandsofia.com\/?p=21"},"modified":"2015-09-06T20:25:42","modified_gmt":"2015-09-06T20:25:42","slug":"ccent-2-s01-e05-basic-tcpip-tcp-and-udp-communication","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=21","title":{"rendered":"CCENT 2 S01 E05 &#8211; Basic TCP\/IP: TCP and UDP Communication"},"content":{"rendered":"<h3>Understanding the Differences Between TCP and UDP<\/h3>\n<ul>\n<li>Networks communicate in Layers.<\/li>\n<li>This is handled in Layer 4, Transport Layer<\/li>\n<li>TCP is &#8220;Reliable&#8221;<\/li>\n<\/ul>\n<ol>\n<li>Reliable &#8211; Uses Acknowledgements<\/li>\n<li>Builds Connections with system it is communicating with<\/li>\n<li>Uses Sequence Numbers &#8211; Every packet is tagged with a # to know the order the packets had been sent.<\/li>\n<\/ol>\n<ul>\n<li>UPD is &#8220;Unreliable&#8221;<\/li>\n<\/ul>\n<ol>\n<li>No Acknowlegements.\u00a0 Data sent, but never verified.<\/li>\n<li>Connectionless<\/li>\n<li>Best-Effort Delivery &#8211; You send it and hope it gets there, no guarantee<\/li>\n<li>Good for &#8220;Real Time&#8221; data &#8211; VoIP, Online Gaming, Video Streaming, etc.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h3>The TCP Three-Way Handshake<\/h3>\n<p>This happens everytime a new session is started.<\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcphandshake.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcphandshake.png\" alt=\"tcphandshake\" width=\"1012\" height=\"297\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcphandshake.png 1012w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcphandshake-300x88.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcphandshake-150x44.png 150w\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" \/><\/a><\/p>\n<ol>\n<li>Sender sends a &#8220;SYN&#8221; Request<\/li>\n<li>Receiver receives the &#8220;SYN&#8221; request and responds with a &#8220;SYN-ACK&#8221; (Syncronize Acknowledgement)<\/li>\n<li>Sender replies with &#8220;ACK&#8221; and packet sending can begin.<\/li>\n<\/ol>\n<h3>TCP Sequence Numbers and Acknowledgements<\/h3>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcppacketsending.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-27\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcppacketsending.png\" alt=\"tcppacketsending\" width=\"895\" height=\"586\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcppacketsending.png 895w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcppacketsending-300x196.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcppacketsending-150x98.png 150w\" sizes=\"auto, (max-width: 895px) 100vw, 895px\" \/><\/a><\/p>\n<div class=\"clear\"><\/div>\n<p>In this example: Each server has its own set of sequence numbers.<\/p>\n<ol>\n<li>Sender sends with SEQ 10<\/li>\n<li>Receiver replies, SEQ 5, ACK 11 (ACK is always Receiving SEQ+1): &#8220;I received SEQ 10 and waiting for SEQ 11&#8221;<\/li>\n<li>Sender sends SEQ 11, ACK 6<\/li>\n<li>Receiver replies SEQ 6, ACK 12<\/li>\n<\/ol>\n<p>IF Sender Packet SEQ 11 fails to reach Receiver:<\/p>\n<ol>\n<li>Receiver will not receive ACK 6, so it will resend SEQ 5 after timeout<\/li>\n<li>Sender will receive ACK 11, so will resend SEQ 11<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h3>TCP Windowing<\/h3>\n<p>a.k.a. Sliding Window size because the window size varies.<\/p>\n<p>This system is used to allow the sending server to send increasingly more packets with every &#8220;group&#8221;. This is more efficient than sending each packet and waiting for an ACK. The number of packets will double with each successful send until a failure occurs.<\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcpslidingwindow.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcpslidingwindow.png\" alt=\"tcpslidingwindow\" width=\"1010\" height=\"699\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcpslidingwindow.png 1010w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcpslidingwindow-300x208.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2015\/08\/tcpslidingwindow-150x104.png 150w\" sizes=\"auto, (max-width: 1010px) 100vw, 1010px\" \/><\/a><\/p>\n<div class=\"clear\"><\/div>\n<p>** Actual Sequence Numbers refer to the number of bytes being sent.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Understanding the Differences Between TCP and UDP Networks communicate in Layers. This is handled in Layer 4, Transport Layer TCP is &#8220;Reliable&#8221; Reliable &#8211; Uses Acknowledgements Builds Connections with system it is communicating with Uses Sequence Numbers &#8211; Every packet is tagged with a # to know the order the packets had been sent. UPD ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=21\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,2,10],"tags":[],"class_list":["post-21","post","type-post","status-publish","format-standard","hentry","category-ccent","category-networking","category-tcpip"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21"}],"version-history":[{"count":4,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/21\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/21\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}