
TCP and UDP Protocols in the Transport Layer
Dive into the world of TCP and UDP protocols in the Transport Layer, comparing their functionalities, advantages, and use cases. Explore the connection-oriented nature of TCP, retransmission mechanisms, protocol establishment, and finalization processes. Gain insights into how these protocols facilitate data transfer and communication across networks.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Layer 4 The Transport Layer David Ferry CSCI 3500 Operating Systems Saint Louis University St. Louis, MO 63103 1
Recall: 7-Layer OSI Model Application to Application Application Application Protocol to Protocol Presentation Presentation Session Session Process to Process Transport Transport Machine to Machine Network Network Interface to Interface Data-Link Data-Link Hardware to Hardware Physical Physical Physical Connection Last time: Network layer allows for routing of messages between many machines in a network. Today: How is a connection presented to a machine? TCP vs UDP CSCI 3500 - Operating Systems 2
Transport Layer Protocols Two big contenders: TCP Transmission Control Protocol UDP User Datagram Protocol Let s start by comparing/contrasting: TCP Stateful Persistent Reliable Ordered Synchronous UDP Stateless Transactional Best-effort (unreliable) Unordered Asynchronous CSCI 3500 - Operating Systems 3
TCP Connection Oriented The TCP protocol is connection oriented- there are three distinct phases to a TCP communication: 1. Connect 2. Data transfer 3. Terminate Additionally: Communication channel is two-way Communications are acknowledged & retransmitted Communications are ordered CSCI 3500 - Operating Systems 4
TCP Establish Connection Protocol Initiator/ Client Reciever/ Server 1) bind(), listen() 2) connect() 3) accept() 4) connect() returns, in established state 5) accept() returns, in established state CSCI 3500 - Operating Systems 5
TCP Retransmission Timeout Retransmission Duplicate Acknowledgements Sender Receiver Sender Receiver Sender does not receive an acknowledgement in a timely manner and retransmits. Receiver only ACKs the highest sequentially numbered packet it has received. CSCI 3500 - Operating Systems 6
TCP Finalization Peer Peer 1) close() 2) Connection half- closed 3) Can still send data 4) close() 3) Can still receive data 5) Both ends of connection closed CSCI 3500 - Operating Systems 7
UDP - Connectionless Sends a packet into the network and hopes it gets there No connection semantics or acknowledgement Fails silently Low overhead Good for unidirectional or broadcast transmissions No need to listen() or accept() in a UDP server- just bind() a port and start receiving data with recvfrom() No need to connect() in a UDP client- just make a socket and start sending data with sendto() CSCI 3500 - Operating Systems 8
TCP vs UDP Use Cases TCP provides reliability and acknowledgment UDP provides speed Doesn t ACK everything, half as many packets Great for one-way communication and broadcast