OSI Transport Layer Network Fundamentals Chapter 4 Version 4.0 1
Transport Layer Role and Services Transport layer is responsible for overall end-to-end transfer of application data 2
Transport Layer Role and Services The transport layer also encompasses these functions: Enables multiple applications to communicate over the network at the same time on a single device Ensures that, if required, all the data is received reliably and in order by the correct application Employs error-handling mechanisms 3
Transport Layer Role and Services Transport layer enables applications on devices to communicate 4
Purpose / Primary Responsibility of Transport Layer Tracking the individual communications between applications on the source and destination hosts Segmenting data and managing each piece Reassembling the segments into streams of application data Identifying the different applications Performing flow control between end users Enabling error recovery Initiating a session 5
1. Tracking Individual Conversation Any host can have multiple applications communicating across the network TL maintain the multiple communication streams between these applications. Ex. Email, IM, Websites and VoIP simultaneously Each of these applications is sending and receiving data over the network at the same time. However, data from the phone call is not directed to the web browser, and text from an instant message does not appear in an e-mail. 6
1. Tracking Individual Conversation 7
2. Segmenting Data AL passes large amounts of data to TL TL has to break data into smaller pieces =segments suited transmission Without segmentations, only one application would be able to receive data This process includes the encapsulation required on each piece of data Each piece of application data requires headers to be added at the transport layer to indicate to which communication it is associated. 8
2. Segmenting Data 9
3. Reassembling Segments Networks prove multiple routes diff. trans times Data can arrives in the wrong order Numbering and sequencing TL ensure segments are reassembled into the proper order Each segment of data reassembled and directed to appropriate application. TL header information is used to reassemble the data pieces into in-order data streams to be passed to the AL Tracert 10
4. Identifying the Applications To pass data streams to the proper applications TL must identify target application TL assigns an identifier to an application In TCP/IP, the identifier = port number Port number used in TL header to indicate which application the data is associated Each particular set of pieces flowing between a source application and destination application is known as conversation Dividing data into small parts enables many diff comm to be interleaved/multiplexed on the same network 11
5. Flow Control Network hosts have limited resources memory, bandwidth When TL aware, some protocol can request the sending application to reduce the rate of data flow This is done at TL by regulating the amount of data source transmits as a group. =FLOW CONTROL Prevent the loss of segments on net and avoid retransmission 12
6. Error Recovery Possible for piece of data corrupted or lost while transmitted over the network TL ensure all pieces reach destination source device retransmit any data that is lost Download Accelerator How it works 13
7. Initiating a Session TL can provide connection orientation by creating a session between the app. These connections prepare the app to communicate with each other before any data transmitted Data can be closely managed 14
Data Requirements Vary E-mail or web page - slight delays are considered acceptable to ensure that the complete information is received and presented. Missing small parts of a telephone conversation might be considered acceptable. You can either infer the missing audio from the context of the conversation or ask the other person to repeat what he said. The user, not the network, manages the resending or replacement of missing information. Banking info /transaction? 15
Data Requirements Vary Some protocols, such as UDP (User Datagram Protocol), provide just the basic functions for efficiently delivering the data pieces between the appropriate applications. These types of protocols are useful for applications whose data is sensitive to delays. Other transport layer protocols, such as TCP (Transmission Control Protocol), describe processes that provide additional features, such as ensuring reliable delivery between the applications. While these additional functions provide more robust communication at the transport layer between applications, they have additional overhead and make larger demands on the network. 16
Transport Layer Role and Services Supporting Reliable Communication Diff apps have diff requirements for their data Diff transport protocols have been developed to meet these requirements TCP is a TL protocol ensure reliable delivery In networking, reliability means each piece of data the source sends arrives at the destination Three basic operation at TL to support reliability Tracking transmitted data Acknowledging received data Retransmitting any unacknowledged data More control data (in Layer 4 header) is exchanged to support acknowledgement, tracking and retransmission 17
Transport Layer Role and Services Supporting Reliable Communication 18
TCP and UDP Two most common TL protocols of TCP/IP are Transmission Control Protocol (TCP) and User Datagram Protocol (TCP) 19
UDP Simple and connectionless protocol Low-overhead data delivery 8 bytes of overhead UDP segments = datagrams UDP sends datagrams as best effort Applications of UDP DNS Video Streaming VoIP 20
Transport Layer Role and Services Identify the basic characteristics of the UDP and TCP protocols 21
TCP Connection-Oriented protocol Additional overhead to gain functions Additional functions Same-order delivery Reliable delivery Flow-control Each TCP segments has 20 bytes of overhead Applications Web browsers E-mail File transfer 22
Transport Layer Role and Services Basic characteristics of the UDP and TCP protocols 23
Transport Layer Role and Services 24
Port Addressing TCP and UDP based services keep track of various applications. To differentiate segments and datagrams for each application TCP and UDP have header fields that uniquely identify these apps. Header contains source and dest port Server processes have static port number assigned Client dynamically choose a port number for each conversation. netstat ano Task Manager 25
Port Addressing Identifying Conversations 26
Port Addressing The combination of TL port number and NL IP address uniquely identifies a particular process running on specific host device. This combination = socket number Ex : Web server on host 192.168.1.20, and web browser (dynamically assigned port 49152) on host 192.168.100.48 Destined socket = 192.168.1.10:80 Socket for the web page = 192.168.100.48:49152 27
Port Addressing 28
Port Addressing Different types of port numbers Well-known ports (0-1023) Reserved for services and apps FTP 20, SMTP 25, HTTP 80 Registered Ports (1024-49151) Assigned to user processes or application Individual applications that a user has chosen to install rather than common applications that would receive a wellknown port. Dynamic or private ports (49152-65535) Some peer-to-peer file-sharing programs Netstat command 29
Port Addressing 30
Port Addressing 31
Port Addressing The netstat command is an important network utility that you can use to verify those connections. netstat lists protocol in use, the local address and port number, the destination address and port number, and the state of the connection. 32
TCP Connection Establishment and Termination TCP Three-Way Handshake Three steps in TCP connection establishment: 1. Initiating client sends a segment containing an initial sequence value. 2. Server responds with segment containing an acknowledgement value of received sequence+1, plus its own synchronizing sequence value 3. Initiating client responds with an acknowledgement received sequence+1 33
TCP Session Termination Client has no more data to send, it sends a segment with FIN flag set The server sends an ACK to acknowledge the receipt of the FIN to terminate the session from client to server The server sends a FIN to the client to terminate server to client session Client responds with ACK to acknowledge the FIN from server 34
Managing TCP Sessions TCP sequence numbers are used to reconstruct the data stream with segments placed in the correct order 35
Managing TCP Sessions TCP Acknowledgement with Windowing The sequence number indicates the relative number of bytes that have been transmitted in this session, including the bytes in the current segment. TCP use acknowledgement number in segment sent back to indicate the next byte expects to receive. But if A had to wait for ack of the receipt of each 10 bytes lot of overhead 36
Managing TCP Sessions TCP Acknowledgement with Windowing Multiple segments of data can be sent and ack with a single TCP message in opposite direction. Ex start with SEQ = 2000, if 10 segments of 1000bytes were received, an ACK = 12001 would be returned to the source. Amount of data can be transmitted before ACK = window size Window size is a field in TCP header used for management of lost data and flow control 37
Managing TCP Sessions TCP Acknowledgement with Windowing?? 38
TCP Retransmission Data loss will occasionally occur Dest host using TCP only ack data for contiguous sequence bytes If one or more segments are missing, only segments that complete the stream is ack Ex. Segments with SEQ=1500 to 3000 and SEQ=3400 to 3500 were received, the ACK will be =3001 Hosts today can also employ an optional feature called selective acknowledgments. only need to retransmit the missing data 39
TCP Congestion Control : : Minimizing Segment Loss Flow Control & Dynamic Window Sizes 40
TCP Congestion Control Flow Control Adjusting the effective rate of data flow. Window size field in TCP header specifies amount of data can be transmitted before an ACK Initial window size determined through 3-way handshake TCP feedback mechanism adjusts the effective rate to the maximum flow network and destination can support without loss During the delay in receiving the ACK, sender will not sent additional segments for the session 41
TCP Congestion Control Flow Control When the sender has transmitted 3000 bytes, it waits for an acknowledgment of these bytes before transmitting more segments in this session. 42
TCP Congestion Control Dynamic Window Size When network resources are constrained, TCP can reduce the window size After no data losses or constrained resources, receiver will begin to increase the window size field This dynamic increasing and decreasing of window size is a continuous process in TCP If the destination needs to slow the rate of communication because of limited buffer memory, it can send a smaller window size value to the source as part of an acknowledgment. 43
TCP Congestion Control Dynamic Window Size 44
UDP Protocol Communicating with low overhead 45
UDP Protocol Simple protocol Basic TL functions Lower overhead than TCP Not connection oriented Does not provide sophisticated retransmission, sequencing and flow control mechanism UDP does not provide reliability..so be careful.. But, are not always unreliable just the reliability is not provided 46
UDP: Low Overhead Versus Reliability Some applications, such as online games or VoIP, can tolerate loss of some data. If these applications used TCP, they might experience large delays while TCP detects data loss and retransmits data. These delays would be more detrimental to the application than small data losses. Some applications, such as DNS, will simply retry the request if they do not receive a response, and therefore they do not need TCP to guarantee the message delivery. The low overhead of UDP makes it desirable for such applications. 47
UDP Datagram Reassembly Session are not established When app has data to send, it simply sends the data When larger amounts of data split into multiple segments =datagrams Multiple datagrams may take different paths and arrives in the wrong order UDP has no way to reorder the datagrams into their transmission order. UDP simply reassembles the data in order it was received and forward to app If seq is important for app, the app will have to identify the proper sequence and how it should be processed 48
UDP Datagram Reassembly 49
UDP Protocol =TCP Servers use port numbers to identify a specified application layer process and direct segments to the proper service or application 50
UDP Protocol When applications or processes are running, they will accept the data matched with the assigned port number. When UDP receives a datagram destined for one of these ports, it forwards the application data to the appropriate application based on its port number 51
UDP Protocol UDP protocol and port numbers are utilized in clientserver communication 52
Exercise 7. The acknowledgment number is always one more than the last segment received. 53
Summary 54
55