Welcome back to the CCNA Cisco Netacad Introduction to Networks lecture series. If you are interested in the previous lectures, I will leave a link in the description for the playlist. Today, we will be focusing on module number 14, which is the transport layer.
In this module, we will compare the operations of transport layer protocols in supporting end-to-end communication. We will cover the transportation of data, TCP overview, UDP overview, port numbers which are most common port numbers that you should be familiar with in this course, TCP communication process, reliability and flow control and UDP communication process. Transportation of data. Role of the transport layer. The transport layer is responsible for logical communications between applications running on different hosts.
The link between the application layer and the lower layers that are responsible for the network transmission. The transport layer provides the end-to-end communications between host to host. So that is a very important concept that you should familiar with.
The transport protocols only run on end devices and it provides the end to end communication between host to host. On the right hand side of this screen you have this diagram of the tcp ip model and you can see the transport layer sandwiched between the application layer and the internet layer and therefore the transport layer moves data between applications on devices in the network If you look at the OSI model, the transport layer sandwiched between the session layer and the network layer. However, the purpose of this layer even in the OSI model is to transmit data using transmission protocols such as TCP and UDP. In this course, you should be familiar with both OSI model as well as the TCP IP model.
because these models will show up on your quizzes and exams. Transport Layer Responsibilities The transport layer has the following responsibilities. Tracking individual conversations, segmenting data and reassembling segments, adds header information, identifies, separates and manages multiple conversations, uses segmentation and multiplexing to enable different communication conversations to be interlevered on the same network.
So what this basically means is that transport layer is responsible for tracking the communications between the end devices and it is also responsible for segmenting data when data is segmented it is also responsible for reassembling data so if we have segment of data coming from one end to the other and transport layer also responsible for putting them together it also adds header information and it is able to manage those different pieces of information by separating them using the you know configurations of the transport layer and that's what this slide is trying to get you and make sure that you understand those concepts IP does not specify how the delivery or transportation of the packets take place. Transport layer protocols specify how to transfer messages between hosts and are responsible for managing reliability requirements of a conversation. The transport layer includes the TCP and UDP protocols.
and the UDP protocol for its processors. In the next few slides, we will go over this TCP and UDP in a little bit in depth. Transmission Control Protocol or TCP provides reliability and flow control.
TCP basic operations includes number and track segments transmitted to a specific host from a specific application. Acknowledge Received Data retransmit any unacknowledged data after a certain amount of time, sequence data that might arrive in wrong order. In other words, if the speed of transmission is different in different links of the your network, those data may arrive in wrong order but the TCP can make sure that it can resequence them together. in correct order send data at an efficient rate that is acceptable by the receiver so we will go over this a little bit later in this course so what happens is sometimes when you send data the data that means send from one device to the next device may not be coming at the same rate so the tcp has the ability to communicate that information with the sender and then make sure those are efficiently controlled so those the data rates are acceptable by the receiving end user datagram protocol or udp udb provides the basic functions for developing datagrams between the appropriate applications with very little overhead and data checking. This is a very important concept.
The reason why we use UDP is it has a very little overhead. UDP is a connectionless protocol. UDP is known as best effort delivery protocol because there is no acknowledgement that the data is received at the destination.
If you are watching this youtube video right now what youtube uses to buffer Your video is the UDP protocol. The advantage of UDP protocol over TCP even though it does not have those verification that used by the TCP protocol is that it has a very little overhead. So it's perfect for certain applications. The right transport layer protocol for the right applications.
So UDP is used by. request and reply applications where the data is minimal and retransmission can be done quickly. If it is important that all data arrives and that it can be processed in its proper sequence then you need to use the TCP. So for example UDP are used in VoIP and DNS.
while the tcp is used for emails smtp imap and http and https web host so in udp remember it is fast low overhead does not require acknowledgement does not resend lost data and delivers data as it arrives as opposed to tcp is very reliable and acknowledges data present the lost data and delivers data in sequence order and remember we use both protocols udp and tcp today tcp overview there are few tcp features that you should be familiar with they include the establish a session ensure reliable delivery provides same order delivery and support flow control. So what it means is basically establishing a session a TCP is a connection oriented protocol that negotiate and establishes a permanent connection or session between the source and the destination devices prior to forwarding any traffic and it ensures the reliable delivery and how it does is it is possible for a segment to become corrupted or lost completely as it transmits over the network. So what the TCP does is ensure that each segment that is sent by the source arrive at the destination correctly.
It provides the same order delivery because the networks may provide multiple routes that can have different transmission rate as I mentioned before and data can arrive in wrong order and the TCP can put them together in the correct order. It also supports the flow controls where the network hosts have limited resources such as memory or processing power when the TCP is aware of that and it is over extended it can request that the sending application reduce the rate of data flow if you look at the tcp header remember tcp is a state full protocol which mean it keeps track of the state of the communication session and the tcp records which information it has sent and which information has been acknowledged so if you look at the header we have the source port we have the destination port we have the sequence numbers acknowledgement number and bunch of other information contained within them i will go over which information in the tcp header is important for the cisco netacad ccna exams on my next slide so if you look at the tcp header fields we have the source port destination port sequence number acknowledgement number Header length, we have a reserved field, control bits, window sites, checksum and urgent field. What's important to this course are highlighted in blue and I will quickly go over them. This is a very important slide for your exams and quizzes for CCNA as well as on CCNP exams.
So make sure that you really understand the ones that are highlighted. So on the TCP header fields, one of the important one is the source port, which is a 16-bit field used to identify the source of the application by port number. And the next one is the destination port, which is a 16-bit field used to identify the destination application by port number.
The sequence number is a 32-bit field used for data reassembly purposes. Acknowledgement number is a 32-bit field used to indicate the data has been received and the next byte expected from the source. The window size is a 16-bit field used to indicate the number of bytes that can be accepted at one time.
While the checksum is like a fingerprint, a 16-bit field used for error checking for segment header and data. So, for your exams and quizzes for this particular class and lecture series what you need to remember is the one that are highlighted in blue. Those are very important concepts and you should know them by hand. Applications that use TCP TCP handles all tasks associated with dividing the data stream into segments, providing reliability, controlling data flow and reordering segments.
Those applications include FTP, SMTP, SSH, HTTP, etc. that's shown on the right hand side of your screen. Next we will cover UDP. UDP features includes data is reconstructed in the order that it is received and any segments that are lost are not resent in udp there is no session session establishment which we have in tcp the sending is not informed about the resource availability so these are key features in udp so if you contrast ctcp with udp you can already see the differences by just looking at this list.
UDP header. The UDP header is far simpler than the TCP header because it only has four fields and require eight bytes. So that's a very important concept that you should also know and those four fields includes the source port, destination port, the length and checksum.
and if you look at the tcp header you should know all of these four the source port destination port length and checksum the source port and destination port is same as the tcp it is a six there are 16 bit fields to identify the source and destination application by port number the length is the same as the tcp which is a 16-bit field indicating the length of however, in this case the UDP datagram header. Similar to TCP, not exactly same but you know it still has that length field. But in this case we have a 16 bit field that indicates the length of the UDP datagram header.
And the checksum, again same or similar to the TCP header, we have the 16 bit field used for error checking datagram header and data. The applications that use UDP. Live video and multimedia applications that includes the YouTube use UDP. And these applications can tolerate some data loss but require little or no delay. For example, VoIP and live streaming videos, right?
And simple request and reply applications. Applications with simple transactions where a host send a request and many may or may not receive. a reply.
An example would be DNS or DSCP. So when you connect an end device to a network and it is looking for a DSCP server, you know, the request may or may not receive a reply because there may not be any available DSCP servers for example. Applications that handles reliability themselves. Unidirectional communications. where flow control, error detection, acknowledgement and error recovery is not required or can be handled by the application itself can also use the UDP.
Those include the SNMP and TFTP protocols. On the right hand side, you will see a diagram with some of those protocols that mentioned here. So the UDP is used by DHCP, DNS, SNMP, TFTP, VoIP and video conferencing. Another example I give you is the live stream and videos from YouTube for example. Even this video some of the buffering is happening at the UDP level.
Port numbers. Multiple separate communications. TCP and UDP transport layer protocols use port numbers to manage multiple simultaneous conversations.
The source port number is associated with the originating application on the local host, whereas the destination port number is associated with the destination application on the remote host. Remember there are two fields in both TCP and UDP which includes the source port and the destination port. and that's where the TCP UDP port numbers come into play. Socket pairs.
The source and destination ports are placed within the segment. The segments are then encapsulated within an IP packet. The combination of the source IP address and source port number or the destination IP address and the destination port number is known as a socket.
So this is a very important concept that you should understand. It shows up on CCNA, CCNP exams and quizzes almost guaranteed. So if you were to ask what is considered as a socket?
A socket is the combination of the source IP address and the source port number. or the destination ip address and the destination port number. that's what defined as a socket.
sockets enable multiple processes running on a client to distinguish themselves from each other and multiple connections to a server process to be distinguished from each other. so what sockets enable you to do is multiple processes running on a client to distinguish themselves from each other and also multiple connections to a server process to be distinguished from each other. So what that basically means is that if you have a client that is accessing a single server to obtain let's say two types of data, in this case, they are trying to access the FTP data and HTTP data.
And what the source can do is the use the port 1305 on the FTP and 1099 on the HTTP and the web server gonna respond using the port 21 and the port 80 on the server itself so the web server gonna use actually the port 80 and the file service is going to use the port 21 but they are all in the same server so that's what the you know that's what the importance of the socket itself port number groups the internet assign numbers authority IANA is the standards organization responsible for assigning various addressing. Remember I mentioned about this organization on our very first lecture, I believe in module 1. This is one of those organizations IANA that is responsible for the assigning various addresses. So there are a couple of things you need to remember for this class. Those are the the range for the well-known ports, range for the registered ports and you should know roughly the range for the private and non-dynamic ports.
So the well-known ports falls between 0 to 1023, the registered ports falls between 1024 to 49151 and the private or dynamic ports start from 49152 to 65535. So, well-known ports are port numbers that are reserved for common or popular services and applications such as web browsers, email clients, and remote access clients. They are well-defined and known ports for common server applications and that enables clients to easily identify the associated service required. The registered ports These are port numbers that are assigned by IANA to a requesting entity to use with specific processes or applications. These processes are primarily individual applications that a user has chosen to install rather than common applications that would receive a well-known port number. An example of a registered port would be the Cisco registered port 1. for the RADIUS server authentication process used by the Cisco devices.
Private or dynamic ports are known as ephemeral ports. The client's OS usually assigns port numbers dynamically when a connection to a service is initiated. way less than what we have you know all the available port numbers so for these exams and quizzes you just have to remember this this set of port numbers and its associated application so we have port 20 which is used for ftp which is a tcp port 21 which is tcp again used for ftp port 22 is a tcp used for ssh which is a secure shell port 23 is a tcp for telnet port 25 for tcp for simple mail transfer protocol or smtp port 53 is used for udp and tcp port 67 is used for dscp port 68 is used for dynamic host configuration protocol clients so the dscp clients um for port 69 is used for tftp port 80 is TCP and used for HTTP the four web access port 110 is used for emails 143 is also email as the IMAP and then the port 161 and port 443 those are the ports numbers that you should be familiar with what I would say out of all of these things most of the exam question I got from is port 443 which is the TCP for HTTPS as opposed to port 80 which is HTTP you may get questions related to port 21 so they will list bunch of port numbers and ask which one is the ftp and the other ones are not that important such as like the dscp port number but you should be familiar with all of them as you go through all the labs as well as this course material you will eventually get to know these points if you are not familiar with them already if you have work in the industry or you have some interest in IT, you probably already know ports such as port 80 for HTTP, port 443 for TCP and port 21 for FTP.
You probably already familiar with this if you have used any devices such as Raspberry Pi and servers for example. You should know all of these ports, but just get familiar with it. You don't need to really memorize it because as you learn go through this course you will probably gonna get to know them more than enough to write your final exam the netstat command unexplained tcp connections can pose a major security security threat the netstat is an important tool to verify connections so if you go to your windows computer and you open up your command prompt and type netstat and it will give you a screen similar to this and what it's showing is any established connections to your device and the associated addresses and the state of those established connections so that's a really neat command that you can use to test uh the connections not test actually to verify the connections associated with your end device.
So that's all you need to remember for with respect to the nestat command. And again I have mentioned this on my previous modules some of these things that I actually go over I will cover it in a live demo video that I will be posting to my youtube channel later sometime. TCP communication process TCP server processes Each application process running on a server is configured to use a port number.
Each application process running on a server is configured to use a port number. An individual server cannot have two services assigned to the same port number within the same transport services. an active server application assigned to a specific port is considered open which means that the transport layer accepts and process segments address to that port any incoming client request address to the correct socket is accepted and the data is passed to the server application so these are very important concepts like on the right hand side uh that's what they are trying to explain here you have two clients client one and client two and we have a server in here with two open ports or configured ports http port which is a port 80 and smtp port which is the port 25 a server responds to tcp client uses the destination port from the request packet at the source port right so what's going to happen is when a client requests for a http page it gonna respond with the destination port sorry sorry the packet from the client goes to the server with the destination port 80 and the source port of the client going to be 49152 but if the client is requesting to smtp access from the server It's gonna have the source port of 25 and the destination port which the client's port going to be one sorry 5 1 1 5 2 so 51 1 52 So what that basically means is TCP is using that the source and the destination port to determine how the Packet should be routed TCP connection establishment So this is a very important topic. I will post a link to a Cisco created a demonstration as well as a like a presentation made by a cisco engineer that explained this concept as well this is very important that you understand the tcp connection establishment process for your exams as well as your labs otherwise you will be having a hard time you know understanding some advanced concepts that we'll be covering later down this lecture series so first tcp connection establishment the very first thing going to happen is the initiating the client request a server communication session with the server so the initiating client request a client to server communication session with the server this is typically known as a sync or it's a syn sync it's send a sync and the server acknowledge the client to server communication session and request a server to client communication session.
So it's going to send a sync arc back and then the next thing going to happen is the initiating client acknowledge the server to client communication session. So these steps are very important and it will show up on your exams and make sure that you understand that. Session termination. This is also another concept that is very important that you understand and will show up on your exams both CCNA and CCNP.
So in TCP session termination, what's going to happen when the client has no more data to send in the stream, it send a segment with the FIN flag set. FIN is like an N flag set. So it send the FIN flag.
the server sends an arc to acknowledge the receipt of the finp uh receipt of the uh finp to the termination to terminate the session from the client to server so basically the server sent an acknowledgement arc you know back to the client saying hey i got that information that you are stopping uh the data stream then the third thing is going to happen is the server send a fin to the client to terminate to server to client session and then the client respond with an arc to acknowledge the fin from the server so in this case what happened is we have the first step here so we have the client that has no more data so it send a message with the fin tag which is the end tag set and then the receiving end the receiving device or client or server gonna send an arc tag saying hey you know the arc was received uh so saying hey it got the you know fin tag and then it also send a um you know fin uh the to the client to terminate the server to the client session and as a result the the the the in in this case the device a gonna send an arc uh you know back to the uh the the other device the device b so that uh it it is an acknowledgement saying that the arc has been received again this is a very important concept It will show up on your exams both CCNA and CCNP make sure you understand the session termination process as well. TCP 3-way handshake analysis Functions of the 3-way handshake which we just covered in these two previous slides. This is called the 3-way handshake. termination so the establishment as termination so the functions of those three way handshake is to establish that the destination device is present on the network it verifies that the destination device has an active service and is accepting request on the destination port number that the initiating clients intends to use it informs the destination device that the source client intends to establish a communication session on that port number.
After the communication is completed the sessions are closed and the connection is terminated. The connection and session mechanisms enable tcb reliability function. So remember that the connection and the session mechanisms that we have in this tcp is the reason why we have the tcb reliability function. TCP 3-way Handshake Analysis The 6 control bit flags are URG, ARC, PSH, RST, SYNC, and FIN.
URG is the urgent pointer field significant. ARC is the acknowledgement flag used in connection establishment and session termination. PSH is the push function.
RST is the reset the connection when an error or timeout occurs. SYNC is the synchronized sequence number used in connection establishment. FIN is saying that there is no more data to send in the particular session. For your exams, what is really important that you understand the arc, sync and fin but you should also know that URG, PSH and RST exist in the TCP3 handshake as well. Unless the Cisco changes the exam for CCNA and CCNP, I don't believe you will get a lot of questions about URG and PSH and RST but you will definitely get questions about the arc sync.
can fin processes. There's a video from Cisco NetAcad called TCP 3-way handshake that will cover exactly we just went over. If you do not have access to Cisco NetAcad, either through your academic institution or through your registration with the Cisco, I will leave a link in the description for a copy of this video that you can watch. and I will put a card at the top right hand corner in this video so you can go ahead and watch that.
Reliability and Flow Control TCP reliability guaranteed and ordered delivery. TCP can also help maintain the flow of packets so that devices do not become overloaded. There are times when TCP segments do not arrive at their destination or out of order.
All data must be received and the data in these segments must be reassembled into original order. Sequence numbers are assigned in the header of each packet to achieve this goal. So TCP can maintain the flow of packets so that devices do not become overloaded and data not always going to arrive at the same time at the destination or you know in the correct order and all of those things can be you know mitigated using the tcp protocol and this is what they are trying to show here a little bit on the right hand side diagram and again to understand what we just talk about there is a video called tcp reliability sequence numbers and acknowledgement that video is a really good video you should watch and if you have access to your ccna cisco netacad modules please go ahead and watch them i will try to find a link to this video or i will post a copy of this video in the description if i can get hold of it and if i find one i'll post it on the top right hand corner with the card up here tcp reliability data lost and read transmission no matter how well design a network is the data loss sometimes do happen tcp provide methods of managing these segment losses among this is a mechanism to retransmit segments for unacknowledged data so for example if you have two devices that are communicating between each other and this device is sending data and this device is receiving those data if they are sending 10 segments and if two of the segments are lost Well, that means we have some missing pieces, right?
But however, the TCP provide a method of managing those losses by using that arc, you know acknowledgement messages that being sent back to the sender So the host operating systems today such as Windows computers, Mac computers, typically employ an optional TCP feature called Selective Acknowledgement or SAC negotiated during the 3-way handshake. If both hosts support SAC, the receiver can explicitly acknowledge which segment or bytes were received including any discontinuous segments. So that is what it's trying to describe here.
What you need to remember for your exams or quizzes is that the modern day operating systems do have this new this feature called the selective acknowledgement and it is negotiated during the three-way handshake. Again There is a video called TCP Reliability Data Lost and Retransmission. I will try to find a copy of this video and post it on my YouTube channel and if I find that I will put it on the top right hand corner up here with a card and I will leave that information in the description and if you do have access to your Netacad account you should be able to watch that video. and that will explain exactly the data loss and retransmission with respect to tcp tcp flow control window size and acknowledgements tcp also provides mechanism for flow control by using the window size and those acknowledgement of those information flow control is the amount of data that the destination can receive and process reliably Flow control helps maintain the reliability of TCP transmission by adjusting the rate of data flow between source and destination for a given session. So MSS which is the maximum segment size shown here on the right hand side is like a window size that can be used for such at such process.
The maximum segment size or MSS is the maximum amount of data that the destination device can receive. A common MSS is 1460 bytes when using IPv4. A host determines the value of its MSS field by subtracting the ip and tcp headers from the ethernet maximum transmission unit or mtu which is 1500 bytes by default so what's going to happen is it's going to take that mtu 1500 minus you know in 60 which is 20 bytes for the ipv4 header and 20 bytes for the ipv i'm sorry for the tcp header so that means 40 bytes gone which um um and plus that other you know headers of the all head gonna gonna have 60. so we have 1500 for the mtu minus 60 that's going to leave us with 1460 bytes so what you need to remember is the maximum segment size is the maximum amount of data that can that the destination device can receive and it is determined by the mtu which is 1500 minus 60 which includes the 20 bytes for the ipv6 and 20 bytes for the ip sorry tcp header and that's all you need to remember for these things this slide for your exams and you can see on the right hand side this that information is shown with a diagram here congestion avoidance Another part of the TCP flow control is the congestion avoidance. So when the congestion occurs on a network, it results in packets being discarded by the overloaded router.
So to avoid and control congestion, TCP employs several congestion handling mechanisms, timers and algorithms. We don't go into depth of. all of these mechanisms timers and algorithms in this class but you should know the congestion avoidance is built into the tcp flow control and it uses these mechanisms timers and algorithms to do it udp communication udp low overhead versus reliability so Remember UDP does not establish a connection. UDP provides low overhead data transport because it has a small datagram header and no network management traffic.
So that is a key important concept. What makes UDP different from TCP is UDP does not establish a connection which I have mentioned on my previous slides and UDP provides low overhead data transport. because it has a small datagram header and no network management traffic. UDP Datagram Reassembly UDP does not track sequence numbers the way TCP does. UDP has no way to reorder datagram into their transmission order.
UDP simply reassembles the data in the order that it was received and forwards it to the applications. Remember, unlike TCP, UDP simply reassembles the data in the order that it was received and forward it to the application. So that's an important thing that you should be familiar with.
So if you look at on the diagram on the right hand side, that's what it is trying to, you know, trying to deliver here. So we have a data, a block of data. and that is divided into datagrams and you have here six datagrams but when it goes to datagram one two six five four arrived on the destination and obviously they are in out of order and it needs to be reordered and there are also lost datagrams that are not resent in because it is using the udp right so that's what it is shown here UDP Server Processes and Requests UDP based server applications are assigned well known or registered port numbers. UDP receives a datagram destined for one of these ports. It forwards the application data to the appropriate application based on its port number.
So those are two important concepts. UDP based server applications are assigned well known port numbers. that are registered or ports that are registered remember we discussed the well-known ports versus registered port versus you know the other available ports so udp use either a well-known port or a registered port number and udp receive a datagram destined for one of these ports and it forwards the application data to the appropriate application base on its port number so that's an important concept such as for example the radius server the cisco radio server have its own registered port number for example you know those are all udps udp client processors the udp client processors dynamically selects a port number from the range of port numbers and uses this as the source port for the converse conversation The destination port is usually the well-known or registered port number assigned to the server process.
After a client has selected the source and destination ports, the same pair of ports are used in the header of all datagrams in the transaction. So this is all you need to remember for the UDP. So the UDP client processes dynamically.
select a port number from a range of port numbers and use this as the source port of the conversation so it's just gonna use a dynamic port as a source port The destination port is usually the well-known or the registered port number such as you know the radius server having a specific destination port number and then after a client has established the source and destination ports the same pair then be used in the header of all datagrams in the transaction so that all the data is being received between the sender and the receiver. and that bring us to the end of this lecture and now i will cover quickly what did we learn in this particular module there's a packet tracer lab available on your cisco netacad it is called tcp and udp communications if you have access to the cisco netacad documentation please go ahead and download it and do it and it that will actually cover everything we learn or most of the things we learn in this particular lecture. If you do not have access to Cisco netacad, I will try to find a copy of this file and see if I can post it on my website.
But this is a really good lab that will cover everything and you should go ahead and do them. So what did I learn in this module? So in this module, we learn the transport layer is the link between the application layer and the lower layers that are responsible for the network transmission.
The transport layer includes the TCP and UDP protocols. The TCP establishes sessions, ensures reliability, provides same-order delivery, and supports flow control. UDP is a simple protocol that provides the basic transport layer functions.
UDP reconstructs data in the order that it is received. Loss segments are not recent. no session establishment and UDP does not inform sender of resource availability.
TCP and UDP transport layer protocols use port numbers to manage multiple simultaneous conversations. And there are certain port numbers that you should be familiar with as you learn these modules in this particular course, such as port number 80 for example for HTTP. Each application process running on a server is configured to use a port number.
The port number is either automatically assigned or configured manually by a system administrator. For the original message to be understood by the recipient, all data must be received and the data in these segments must be reassembled into the original order. Sequence numbers are assigned in the header of each packet. Flow control helps maintain the reliability of TCP transmission by adjusting the rate of data flow between source and destination. Remember this is one of the key features of TCP as opposed to UDP.
It has the ability to adjust the rate of data flow between the source and destination. A source might be transmitting 1460 bytes of data within each TCP segment. This is the typical MSS that a destination device can receive. The process of the destination sending acknowledgments as it process bytes received and the continual adjustment of the source send window is known as sliding windows.
Unfortunately, I didn't cover sliding windows clearly in this particular lecture but I will go through them later. To avoid and control congestion, TCP employs several congestion handling mechanisms. And that's everything for this lecture. If you like these modules and these lectures, please subscribe to my channel. please make sure to thumbs up this video and subscribe to my channel.
In the next few weeks, I will be posting the last few modules associated with Cisco Netacad Introduction to Networks lecture series. If you have any questions or concerns regarding these lectures, please feel free to leave a comment in any of my videos and I will try to get back to you. Until next time, good luck with your exams and have a nice day.