1 NET 431 D TRANSPORT LAYER PROTOCOLS Networks

  • Slides: 35
Download presentation
1 NET 431 D: TRANSPORT LAYER PROTOCOLS Networks and Communication Department Lecture 4: TCP

1 NET 431 D: TRANSPORT LAYER PROTOCOLS Networks and Communication Department Lecture 4: TCP Vs UDP

Transportation of Data Role of the Transport Layer The transport layer is responsible for

Transportation of Data Role of the Transport Layer The transport layer is responsible for establishing a temporary communication session between two applications and delivering data between them. TCP/IP uses two protocols to achieve this: Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Primary Responsibilities of Transport Layer Protocols Tracking the individual communication between applications on the source and destination hosts Segmenting data for manageability and reassembling segmented data into streams of application data at the destination Identifying the proper application for each communication stream

Transportation of Data Role of the Transport Layer (Cont. )

Transportation of Data Role of the Transport Layer (Cont. )

Transportation of Data Conversation Multiplexing Segmenting the Data Enables many different communications, from many

Transportation of Data Conversation Multiplexing Segmenting the Data Enables many different communications, from many different users, to be interleaved (multiplexed) on the same network, at the same time. Provides the means to both send and receive data when running multiple applications. Header added to each segment to identify it.

Transportation of Data Conversation Multiplexing (Cont. )

Transportation of Data Conversation Multiplexing (Cont. )

Transportation of Data Conversation Multiplexing (Cont. )

Transportation of Data Conversation Multiplexing (Cont. )

Transportation of Data Transport Layer Reliability Different applications have different transport reliability requirements. TCP/IP

Transportation of Data Transport Layer Reliability Different applications have different transport reliability requirements. TCP/IP provides two transport layer protocols, TCP and UDP. TCP Provides reliable delivery ensuring that all of the data arrives at the destination. Uses acknowledged delivery and other processes to ensure delivery Makes larger demands on the network – more overhead. UDP Provides just the basic functions for delivery – no reliability. Less overhead. TCP or UDP There is a trade-off between the value of reliability and the burden it places on the network. Application developers choose the transport protocol based on the requirements of their applications.

Introducing TCP and UDP Introducing TCP Connection-oriented – Creates a session between the source

Introducing TCP and UDP Introducing TCP Connection-oriented – Creates a session between the source and destination Reliable delivery – Retransmits lost or corrupt data Ordered data reconstruction – Reconstructs numbering and sequencing of segments Flow control – Regulates the amount of data transmitted

TCP Header 9 The segment consists of a 20 -60 -byte header. 12 -Jan-22

TCP Header 9 The segment consists of a 20 -60 -byte header. 12 -Jan-22 Networks and Communication Department

TCP 10 TCP is one of the main protocols in TCP/IP networks. Whereas the

TCP 10 TCP is one of the main protocols in TCP/IP networks. Whereas the IP protocol deals only with packets, TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent. TCP stands for Transmission Control Protocol. TCP is a connectionoriented protocol that is responsible for reliable communication between two end processes. The unit of data transferred is called a segment, which is simply a sequence of bytes. Being connection-oriented means that before actually transmitting data, you must open the connection between the two end points. The data can be transferred in full duplex (send and receive on a single connection). When the transfer is done, you have to close the connection to free system resources. Both ends know when the session is opened (begin) and is closed (end). The data transfer cannot take place before both ends have agreed upon the connection. The connection can be closed by either side; the other is notified. 12 -Jan-22 Networks and Communication Department

TCP 11 TCP (Transmission Control Protocol) is the most commonly used protocol on the

TCP 11 TCP (Transmission Control Protocol) is the most commonly used protocol on the Internet. The reason for this is because TCP offers error correction. When the TCP protocol is used there is a "guaranteed delivery. " This is due largely in part to a method called "flow control. " Flow control determines when data needs to be re-sent, and stops the flow of data until previous packets are successfully transferred. This works because if a packet of data is sent, a collision may occur. When this happens, the client rerequests the packet from the server until the whole packet is complete and is identical to its original. 12 -Jan-22 Networks and Communication Department

Introducing TCP and UDP Introducing UDP Connectionless Unreliable delivery No flow control Stateless protocol

Introducing TCP and UDP Introducing UDP Connectionless Unreliable delivery No flow control Stateless protocol Applications that use UDP: Domain Name System (DNS) Video Streaming Vo. IP

UDP 13 Short for User Datagram Protocol, a connectionless protocol that, like TCP, runs

UDP 13 Short for User Datagram Protocol, a connectionless protocol that, like TCP, runs on top of IP networks. Unlike TCP/IP, UDP/IP provides very few error recovery services, offering instead a direct way to send and receive datagrams over an IP network. It's used primarily for broadcasting messages over a network. UDP provides a connectionless host-to-host communication path. UDP has minimal overhead; each packet on the network is composed of a small header and user data. It is called a UDP datagram. UDP is connectionless. It means that a datagram can be sent at any moment without prior advertising, negotiation or preparation. Just send the datagram and hope the receiver is able to handle it. UDP is an unreliable protocol. There is absolutely no guarantee that the datagram will be delivered to the destination host. But to be honest, the failure rate is very low 12 -Jan-22 Networks and Communication Department on the Internet and nearly null on a LAN unless the bandwidth

UDP 14 UDP (User Datagram Protocol) is anther commonly used protocol on the Internet.

UDP 14 UDP (User Datagram Protocol) is anther commonly used protocol on the Internet. However, UDP is never used to send important data such as webpages, database information, etc; UDP is commonly used for streaming audio and video. Streaming media such as Windows Media audio files (. WMA) , Real Player (. RM), and others use UDP because it offers speed! The reason UDP is faster than TCP is because there is no form of flow control or error correction. The data sent over the Internet is affected by collisions, and errors will be present. Remember that UDP is only concerned with speed. This is the main reason why streaming media is not high quality. 12 -Jan-22 Networks and Communication Department

UDPHeader 15 12 -Jan-22 Networks and Communication Department

UDPHeader 15 12 -Jan-22 Networks and Communication Department

16 12 -Jan-22 Networks and Communication Department

16 12 -Jan-22 Networks and Communication Department

Introducing TCP and UDP Port Addressing

Introducing TCP and UDP Port Addressing

Introducing TCP and UDP Port Addressing (Cont. )

Introducing TCP and UDP Port Addressing (Cont. )

Introducing TCP and UDP Port Addressing (Cont. )

Introducing TCP and UDP Port Addressing (Cont. )

Introducing TCP and UDP Port Addressing (Cont. ) Netstat is used to examine TCP

Introducing TCP and UDP Port Addressing (Cont. ) Netstat is used to examine TCP connections that are open and running on a networked host.

Introducing TCP and UDP Segmentation The transport layer divides the data into pieces and

Introducing TCP and UDP Segmentation The transport layer divides the data into pieces and adds a header for delivery over the network

TCP Communication TCP Server Processes

TCP Communication TCP Server Processes

TCP Communication TCP Server Processes (Cont. )

TCP Communication TCP Server Processes (Cont. )

TCP Communication TCP Connection, Establishment and Termination Three-Way Handshake Establishes that the destination device

TCP Communication TCP Connection, Establishment and Termination Three-Way Handshake Establishes that the destination device is present on the network Verifies that the destination device has an active service and is accepting requests on the destination port number that the initiating client intends to use for the session Informs the destination device that the source client intends to establish a communication session on that port number

TCP Communication TCP Three-Way Handshake Step 1: The initiating client requests a client-to-server communication

TCP Communication TCP Three-Way Handshake Step 1: The initiating client requests a client-to-server communication session with the server Step 2: The server acknowledges the client-to-server communication session and requests a server-to-client communication session. Step 3: The initiating client acknowledges the server-to-client communication session.

TCP Communication TCP Session Termination

TCP Communication TCP Session Termination

Reliability and Flow Control TCP Reliability – Ordered Delivery Sequence numbers are used to

Reliability and Flow Control TCP Reliability – Ordered Delivery Sequence numbers are used to reassemble segments into their original order.

Reliability and Flow Control Acknowledgement and Window Size The sequence number and acknowledgement number

Reliability and Flow Control Acknowledgement and Window Size The sequence number and acknowledgement number are used together to confirm receipt. The window size is the amount of data that a source can transmit before an acknowledgement must be received.

Reliability and Flow Control Window Size and Acknowledgements

Reliability and Flow Control Window Size and Acknowledgements

Reliability and Flow Control TCP Flow Control – Congestion Avoidance

Reliability and Flow Control TCP Flow Control – Congestion Avoidance

UDP Communication UDP Low Overhead vs. Reliability UDP Simple protocol that provides the basic

UDP Communication UDP Low Overhead vs. Reliability UDP Simple protocol that provides the basic transport layer function Used by applications that can tolerate small loss of data Used by applications that cannot tolerate delay Used by DNS Simple Network Management Protocol (SNMP) Dynamic Host Configuration Protocol (DHCP) Trivial File Transfer Protocol (TFTP) IP telephony or Vo. IP Online games

UDP Communication Datagram Reassembly

UDP Communication Datagram Reassembly

Applications that use TCP

Applications that use TCP

Applications That Use UDP

Applications That Use UDP

35 Q&A 12 -Jan-22 Networks and Communication Department

35 Q&A 12 -Jan-22 Networks and Communication Department