Technology Tap

Unpacking TCP and UDP: The Cornerstones of Networking Protocols

January 05, 2024 Juan Rodriguez Season 4 Episode 65
Technology Tap
Unpacking TCP and UDP: The Cornerstones of Networking Protocols
Technology Tap Premium
Exclusive access to premium content!
Starting at $5/month Subscribe
Show Notes Transcript Chapter Markers

Ring in the New Year with an intellectual upgrade as we promise to guide you through the labyrinth of TCP and UDP protocols that are the lifeblood of our networking communications. Gear up to grasp the essential knowledge that will not only prep you for your CompTIA A+ exams but also amplify your understanding of the digital world. You'll learn to differentiate between the meticulous nature of TCP, with its insistence on a reliable connection, and the sprightly UDP, which favors speed over precision, perfect for your gaming and streaming pleasures.

Join me, Professor JRod, on this enlightening journey where we dissect the critical elements of flow and congestion control, ensuring your data doesn't just travel but arrives with finesse, be it through web browsing or file transfers. We'll reveal how the delicate dance of data packets is choreographed using the sliding window mechanism and congestion control strategies, helping you appreciate the robustness of networking. And for the tech enthusiasts, we'll unravel the mysteries of well-known TCP and UDP ports and their pivotal role in securing and managing our online activities. Tune in and become the networking connoisseur you were destined to be!

Support the Show.

If you want to help me with my research please e-mail me.
Professorjrod@gmail.com

If you want to join my question/answer zoom class e-mail me at
Professorjrod@gmail.com

Art By Sarah/Desmond
Music by Joakim Karud
Little chacha Productions

Juan Rodriguez can be reached at
TikTok @ProfessorJrod
ProfessorJRod@gmail.com
@Prof_JRod
Instagram ProfessorJRod

Speaker 1:

And welcome to technology. Tap on, professor Jayrod. In this episode we're going to talk about TCP versus UDP. Let's get into it. All right, guys? Welcome.

Speaker 1:

For those of you who don't know who I am, my name is Professor Jayrod and I do CompTIA podcast on how to, how, strategies for the exam questions and topics that are under various A plus network plus, security plus exams. I'm now on tiktok. Please, if you are a tiktok fan, go on tiktok. Look for me, professor Jayrod. I'm there. I post like one question a day that we can go over in the strategies on how to answer that particular question. So, if you want, look for me, search for me, professor Jayrod, as J R O D and hit the like button. Follow me on tiktok. Watch the videos. I put a couple of them up already on CompTIA questions. So it should be, you know, let's see if we can get that that side of social media active. And also, I want to wish everyone a happy New Year. It's happy New Year, guys. It's the New Year's 2024. I think it's now, it's the time, that you guys have decided that yes, I'm going to take the plunge, I'm going to go and take my CompTIA A plus exams and hopefully listening to these podcasts would motivate you and help you take the CompTIA A plus exams. And if you do email me, professor Jayrod that's J R O D at gmailcom Tell me that you passed, tell me that you, you know you took the and pass, and you know if I helped you, you can tell me that too. I love receiving emails from people telling me that they passed the CompTIA exams.

Speaker 1:

So this topic today we're going to talk about TCP and UDP, that's transmission control protocol and user data grant protocol, which are both on the transport layer of the OSI model, that's layer four, and they have some key differences in terms of their features and their behaviors and are kind of like want to go over some of them. So first we're going to talk about connection oriented and connection less. The terms connection oriented and connection list refers to two different fundamental communication models used in computer networking, particularly in the context of transport layer protocols like TCP and UDP. So TCP is connection oriented. So connection oriented communications involves the establishment of a dedicated logical connection between the sender and the receiver before the actual data transfer begins. Right, and the characteristics of these are reliability, which ensures reliable and ordered delivery of data.

Speaker 1:

Acknowledgements. Uses acknowledgement to confirm the receipt of the data. And then error handling, which performs error checking and retransmission of lost or corrupted packets. Also does flow control, which implements flow control mechanisms to regulate the flow of data. So, for example, that, as you may or may not know, tcp establishes a three way handshake and once the three way handshake is completed, a virtual circuit is established where it provides a reliable by stream communications. So an example of this will be applications that guaranteed delivery and order data transfers, such as transferring files when you web browsing and particularly email right when you need to be very, very reliable with email. And then connection list, which is route UDP.

Speaker 1:

Connection list communication does not involve the prior establishment of a dedicated connection before data transmission. There's no three way handshake and characteristics, no connection setup. Data set without prior setup or acknowledgement, no reliable guarantees. Does not guarantee the delivery or ordering of packets and low overhead generally has lower overhead due to the lack of can connection setup and the acknowledgement process. And if you look at some literature on TCP, udp, you'll see that the amount of data that is in each one is vastly different. So an example of this is, again, like I said, udp sends data without establishing a connection does not provide reliability features like acknowledgement or transmission and an example of this is is real time application where low latency is critical, such as streaming media, online gaming and VoIP right, they're just gonna send you the data, send you the data, send you the data you know. They don't care if you are ready for it or not, they're just gonna just keep sending you the data.

Speaker 1:

Situations where some data loss is acceptable and the emphasis is on speed rather than reliability. That sounds like Netflix, right? Or YouTube. They just send you the data, send you the data, send you the data. Right. Sometimes you may be watching a YouTube video and it kind of skips. That's UDP doing that.

Speaker 1:

So let's compare the both the pros and cons. Connection oriented the pro is reliable and ordered data transfer, error checking and correction and then flow control for congestion management. The cons is higher overhead due to connection setup and acknowledgement. Connection less the pro is lower overhead, faster transmission, suitable for real-time applications, and the con is no reliability guarantees and no error checking or correction. The choice between the connection oriented and connectionless communications depend on the specific requirement of the application. Connection oriented protocols like TCP are suitable for applications that prioritize reliability, when connectionless protocols like UDP, are appropriate for scenarios with low latency and speed, are more critical than guaranteed of guaranteed delivery.

Speaker 1:

Next we're gonna talk about reliability as far as TCP is concerned. Reliability in TCP connection oriented. Tcp is connection oriented protocol. Reliable delivery ensures reliable and ordered date delivery of data. Acknowledgment uses acknowledgement to confirm successful with our reception receipt of data retransmission. If the segment is lost or is corrupt, tcp would retransmit it sequence numbers, employee sequence numbers, to order to receive data at the destination. As error checking, tcp includes error checking mechanism and if errors are detected, the receiver request trans retransmission. Flow control implements full control to prevent overwhelming the receiver with too much data. So an example of this will be file transfer, web, web browsing again, email applications with accurate and order data delivery is crucial. So you ever downloading something and it says eight hours. You know to download this is four hours and it says 20 minutes. That's part of TCP. That's TCP doing that.

Speaker 1:

Reliability in UDP connectionless UDP is a connectionless protocol. It's no reliability guarantees right doesn't doesn't guarantee reliable delivery and there's no acknowledgement of data being received ever handling. Udp does not perform error checking or retransmission. Any error detection and correction must be handled by the application layer and it has low overhead because of its connectionless and the lack of reliability. Udp generally has lower overhead compared to TCP. Again, an example is streaming media, online gaming, when some data loss is acceptable and low latency is more critical than guaranteed delivery. To summarize, this section provides. Tcp provides reliable and order delivery of data suitable for applications with data integrity and order are critical. And then your higher overhead due to connection setup, acknowledgement and error checking. Udp does not guaranteed Reliability or ordering of data suitable for real-time applications where low latency is more critical than reliability and lower overhead due to is connected list Data loss. I'm sorry, connection was nature.

Speaker 1:

Next, with going on to the TCP, tcp, udp header size. So TCP header is more extensive compared to UDP, containing several fields necessary for reliable and ordered data. The size of a TCP header the minimum TCP header size is 20 bytes. Additional options, such as maximum segment size, window scale, timestamps, can increase the size of the header. The maximum size of a TCP header, including options, is 60 bytes. Field. It has source and destination, port numbers, sequence and acknowledgement numbers, header length, flags, windows size for flow control, check, some for error detection, urgent pointer and other options like how variable length. Udp header size is simpler and more compact than the TCP header Containing the essential information for connection list communication size is you can see, I'm gonna tell you, you can see there's a big difference. The UDP header is a fixed size of eight bytes Field, source and destination, port numbers, length field indicating the length of the UDP header, and data checks, some for error detection, which is optional, and it can be set to zero for no checks on. So again to compare both TCP larger header size, especially when additional options are included. More feature rich header to support reliability and connection oriented communication. Udp smaller, fixed header a minimal information suitable for connection and low overhead communications.

Speaker 1:

Next we're gonna talk about flow control in TCP. Udp Flow controls a mechanism used to manage the rate of data transmission between a sender and a receiver. It ensures that the sender does not overwhelm the receiver with data, preventing potential packet loss and ensuring smooth communications. So for TCP and TCP, flow control is implemented using a sliding window mechanism. The receiver advertises available buffer size to the sender using the window size field in the TCP header. The sender then adjusts transmission rate based on the advertised window size to avoid overlawing the receiver. What's the purpose of this? It prevents the sender from transmitting data at a faster rate than the receiver can process.

Speaker 1:

Congestion control is a mechanism used to prevent network congestion, which occurs when a demand for network resources exceeds the available capacity. It aims to avoid packet loss and ensure fair sharing of network resources among competing users. So TCP congestion control. Tcp uses various algorithms to detect and respond to congestion, such as slow start, congestion avoidance and fast retransmit, fast recovery algorithms. These algorithms adjust the sending rate dynamically based on network conditions, reducing congestion and preventing network collapse. The purpose of all this is to avoid network congestion by adjusting the transmission rate based on perceived network connections. This is why you see it when you first start downloading something, it's had a different speed when you end it.

Speaker 1:

Comparison primary scope is primarily concerned with communication between a specific sender and receiver. Implementation involves adjusting the rate of data transmission based on the receiver's buffer space, and the goal is to ensure effective and reliable communication between individual senders and receivers. The control is the scope concerns the entire network and multiple communicating entities. Implementation involves the adjusting the transmission rate based on network conditions to prevent congestions, and the goal is to maintain overall network stability with fairness, preventing congestions related issues. Tcp incorporates both flow control and congestion control mechanism.

Speaker 1:

Flow control is essential for managing the rate between individual sender, receiver parts providers. Congestion controls help prevent network wide congestions and ensure fair utilization. Flow control use case for file transfers. When large files are transferred between a sender and the receiver, flow control ensures that the sender does not overwhelm the receiver's buffer, preventing potential loss when you are web browsing and web communication. Flow control helps manage the rate of data transfer between a web server and a client, ensuring loading of web pages without overloading the client. Email communications flow control is important in email communications to prevent the sender from transmitting emails faster than the email client can process and display them, and in streaming media and streaming applications, such as video streaming or online music service. Flow control helps regulate the delivery of data to ensure a seedless and uninterrupted user experience.

Speaker 1:

Congestion control some examples of that internet traffic management. In the broader contents of the internet, congestion control mechanism prevent network congestions by adjusting the transmission rate of multiple connections, ensuring fair share are available bandwidth Data center communications within data centers. When numerous servers and devices communicate, congestion control is vital to prevent bottlenecks and ensure efficient data transfer. Voip voice over internet protocol in real time communication applications like VoIP, congestion control helps maintain low latency and prevents voIP quality the degradation by avoiding a network congestion. Online gaming online gaming application use congestion congestion congestion congestion control to ensure a smooth gaming experience by preventing lags and delays caused by network congestion and cloud computing and a cloud computing environment with multiple users and applications share resources. Congestion control prevents performance issues and ensure fair resource allocation In scenarios where reliability and order data delivery are essential, for example, file transfer, web browsing, email. Tcp flow control ensures that data is transmitted at a manageable rate. Tcp TCP's congestion control helps maintain network stability and fairness in diverse and network and dynamic network environments.

Speaker 1:

We have the well known ports that are used in TCP, udp. As we know, ports are standardized port numbers assigned to specific service by the internet assigned numbers authority. These ports are commonly used for well known services, making them easier for network administrators and users to identify and manage different network traffic. Here are some examples of some well known corresponding ports and their services. Well, first one we gonna talk about, we're gonna mention, is port 2021, which you should know it before I answer it, before I say right, ports 2021 is what? Ftp, file transfer protocol? And now, is that UDP or TCP? Guys, what do you think it is TCP. It is TCP. Next, port 22. And port 22 is what? Ftp, file transfer protocol. Thank you, what is it? What is it? That is correct? It is secure a shell. And now, is that TCP or UDP? What do you think, guys? It is TCP.

Speaker 1:

Next we have port number 23. What's port number 23, guys? All of these are? You know, the ones are gonna be an 8 plus, that were plus a security plus, so know them. Port number 23 is telnet and that is TCP. Next is port number 25. Anybody can tell me what port 25 is? Those in the back, what do you think? It is SMTP and it is TCP. Next is port number of 53. And is that? What is 53 for number 53? What is that? That is domain name service. And now, what protocols they use? This one actually uses both. This one actually uses both TCP and UDP, and then one day we'll talk about DNS and then, well we'll, we'll get it into a little bit of a deep diver on that. Next we have port 80.

Speaker 1:

Everybody should know this one, right? This is the easiest one. This should be like the first one that you learned. And it is Http, right, hypertext transfer protocol. Now, is that UDP or TCP. What do you think it is? Tcp? Port number 110. Port number 110 what do you think that is, guys? What do you think that is From? Give you the answer, take a guess. Port number 110 is pop 3 post office protocol, and that protocol uses TCP. Next, port number 143 143 guys, what's 143? 143 is HTTPS, right, http, secure, and that uses TCP. Port number 161 and 162 which what protocol is that? Anybody know? This one is a little harder. It is SNMP, simple network management protocol, and that uses UDP.

Speaker 1:

Next is port number 389 389 guys. What port number is 389? Anybody know? Goes in the back, yell it out oh, port number 389 is LDAP, lightweight directory access protocol, and that uses TCP. Then we have port 514, port 514 this is a tough one. Port 514 Anybody know what that one is for? 514? That is Cislog, right, protocols are UDP and TCP. Next we have port number 636. Anybody know what that is 636? No, it's LDAP S, ldap over SSL. And then again, that also uses TCP. And the last one is port number at 993 993. Guys, you guys know what that is. 993 993 is IMAP over SSL, and that also uses TCP.

Speaker 1:

These well-known ports facilitate the standardization of network services Allowing devices and applications to communicate with each other using established port assignments. While these ports are associated with specific services, it is important to note that applications can sometimes use non-standard ports or dynamically assigned ports for communication. All right, we got some more ports. Port 67 this one you should definitely know port, especially if you took my class right. Port number 67 what is that? It is DHCP, dynamic host configuration protocol. I and is that TCP or UDP? Yeah, that's UDP, you would think is TCP. No, but it's, it's UDP. So I'm yeah, I'm sure some of you are shocked. Port number 69. Port number 69 anybody out there know what port number 69 is? No, port number 69 is transfer files, I'm sorry, trivia file transfer protocol. It uses UDP also.

Speaker 1:

Next, this is the easiest port number that you could remember in your life. If you ever get this wrong on the test, shame on you, because this is the easiest port number to remember. Port one, two, three. What's the? What's the name? What's the service? What's the name of port number one, two, three. That's an easy one. That's like a gimme, guys. If you don't know that one, you know you need to go back to your notes. That's network time protocol, network time protocol and it's easy to remember, right, because it's time. We know one, two, three time, right, very easy to remember. Then we have the last one is port number 514, which we, which is syslog, and that's also.

Speaker 1:

That's both UDP and TCP, along with SNMP. That's also both. So please know why these ports are commonly associated with specific services using using UDP. Some applications may use non-standard ports or dynamically assigned ports for UDP communication. Additionally, some services, such as DNS, uses both when UDP typically being used for lightweight queries and responses.

Speaker 1:

So, alright, so hopefully that was a good, that was a good topic, right, udp, tcp not a lot of people know that and it's a very, very, very important part of IT and it's, you know, it's part of the OSI model, it's layer four of the lowest of the OSI model, has to do with the, the transport layer, and it. It has in its packet the port number that it's assigned to it. So it's, it's a very important the Topic that that we need to understand in in in IT and you know computers and CompTIA and a plus, not it. Now, I doubt very much you're gonna talk about that at work, about TCP and UDP, but you may need as you go along in your career Right now. You're gonna have to go through the process of going along in your career, right, because you know there's this TCP Flooding right that they do. So you may know you may need to know about TCP, right. This is not the most glamorous topic and you might say, wow, this is. You know this is a little bit on the boring side and it is, but you know they're, they will attack, right, they would do that attack where with the three-way handshake doesn't get completed, only the two-way. It only stops at the second handshake and it just, and then it just keeps doing it and then the third handshake never completes and then your system is it's done after a while once. They do it a bunch of times. So it's an important aspect of All by T, though it may not be, you know, anybody's favorite thing, or it might be a little bit boring, or even after listening to these podcast, you may still not understand what it does, what it means. But this is just a, you know, just to tip your toe, toe in the water kind of thing and and see if, if you can at least start to familiarize yourself with TCP UDP, because it's, you know, it's very important.

Speaker 1:

The example that I like to give in class, if anybody ever taken any of my classes is. I like to have one student Stand at one end of the classroom and I'm on the other end and I have a bunch of markers in my hand and then I start tossing them to the student on the other side. But I first I say hey, are you ready? And then they say yes. And then I toss them the first one and they say hey, are you ready? And they say yes, and I toss them the second one. They say hey, are you ready? They say yes, and I toss them and I continue tossing them. Then I grab the markers back we still in the same position and then I start tossing the markers at the person. If he drops it, I don't care, I'm not waiting for him to pick it up to throw the other marker, I'm just gonna throw the. I do it underhand, of course, right not to get hurt. And then I just keep throwing the markers and after a while he stops Catching them right. That's how TCP and UEP works. That's how that's the example that I like to show my students like a visual example. May not be the best example, but it's a fun example and it gets a lot of laughs in the classroom, so I'll take it. I'll take it if it's gonna make my students laugh, I'm all there for it. All right, that's gonna put a bow on this episode.

Speaker 1:

Thank you for listening and remember to follow me on tiktok. I'm on tiktok. Just search for professor J rod JROD and you would find me. Take a look at some of the videos that I put up there. Hit the like button, please, and follow me. I'm trying to get enough followers for I can do a live stream and we can do a whole bunch of questions live. Appreciate it and until next time. This is this has been a little touch of productions Art by Sarah music by joking. If you want to reach me, you can email me, professor J rod. That's Uh J R O D I gmailcom. I'm also an Instagram at professor J rod and I'm on tiktok. Search for me, professor J rod.

TCP vs UDP
TCP and UDP