460 likes | 577 Views
OSI Transport Layer. Network Fundamentals – Chapter 4. Objectives. Explain the role of Transport Layer protocols and services in supporting communications across data networks. Analyze the application and operation of TCP mechanisms that support reliability.
E N D
OSI Transport Layer Network Fundamentals – Chapter 4
Objectives • Explain the role of Transport Layer protocols and services in supporting communications across data networks. • Analyze the application and operation of TCP mechanisms that support reliability. • Analyze the application and operation of TCP mechanisms that support reassembly and manage data loss. • Analyze the operation of UDP to support communicate between two processes on end devices.
Transport Layer Role and Services • Transport layer is responsible for overall end-to-end transfer of application data
Transport Layer Role and Services • Transport layer enables applications on devices to communicate • Fig 4.2
Purpose 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
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 • Fig 4-3
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 • Fig 4.4
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.
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
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
Error Recovery • Possible • Piece of data corruptedor lost while transmitted over the network • TL ensure all pieces reach destination – source device retransmit any data that is lost 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
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
Transport Layer Role and Services • Supporting Reliable Communication
TCP and UDP • Two most common TL protocols of TCP/IP are • Transmission Control Protocol (TCP) and User Datagram Protocol (TCP)
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
Transport Layer Role and Services • Identify the basic characteristics of the UDP and TCP protocols
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
Transport Layer Role and Services • Identify the basic characteristics of the UDP and TCP protocols
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.
Port Addressing • Identifying Conversations
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 • Ex : Web server on host 192.168.1.20, 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
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 • Dynamic or private ports (49152-65535) • Netstat command
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 • Fig 4.11
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 • Fig 4-12
Managing TCP Sessions • Describe how TCP sequence numbers are used to reconstruct the data stream with segments placed in the correct order
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. • Fig 4-13 • But if A had to wait for ack of the receipt of each 10 bytes – lot of overhead
Managing TCP Sessions • TCP Acknowledgement with Windowing
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
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
TCP Congestion Control • Flow Control & Dynamic Window Sizes
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 • Fig 4-14 • During the delay in receiving the ACK, sender will not sent additional segments for the session
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
UDP Protocol • Communicating with low overhead
UDP Protocol • Simple protocol • Basic TL functions • 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
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
UDP Protocol • Servers use port numbers to identify a specified application layer process and direct segments to the proper service or application
UDP Protocol • UDP protocol and port numbers are utilized in client-server communication