Computer Communication and Networks PDF
Document Details
Uploaded by WieldyDulcimer
NWC201 at CST
Karma Wangchuk
Tags
Summary
These lecture notes cover the transport layer in computer networks, including topics like UDP, TCP, port numbers, and socket programming. The notes also discuss quality of service (QoS) parameters and different transport layer protocols.
Full Transcript
Computer Communication and Networks Transport Layer Session 16 Tutor: Karma Wangchuk Transport Layer Learning Outcomes: At the end of the lesson, you are expected to be able to: Introduction User Datagram Protocol (UDP)...
Computer Communication and Networks Transport Layer Session 16 Tutor: Karma Wangchuk Transport Layer Learning Outcomes: At the end of the lesson, you are expected to be able to: Introduction User Datagram Protocol (UDP) UDP Datagram format Port Numbers Transmission Control Protocol (TCP) TCP Datagram format Types of addresses used by TCP/IP NWC201@ CST-Karma Wangchuk 2 11 October 2024 Transport Layer Introduction: Whenever we need to deliver something to one specific destination among many, we need to address: At the data link layer, we need a MAC address to choose one node among several nodes if the connection is not point-to-point. At the network layer, we need an IP address to choose one host among millions At the transport layer, we need a transport layer address called a Port Number (Port Address). NWC201@ CST-Karma Wangchuk 3 11 October 2024 Transport Layer Design Issue The transport layer provides essential services to the Session Layer. It is responsible for end-to-end communication, ensuring complete data transfer between the source and destination systems. The following are the key design issue: 1. Services Provided to the Session Layer 2. Quality of Service (QoS) 3. Transport Service Primitives 4. Socket Programming NWC201@ CST-Karma Wangchuk 4 11 October 2024 Transport Layer Design Issue Services Provided to the Session Layer The transport layer provides several services to the session layer to ensure seamless communication: Guarantees the correct delivery of data without loss, 1. Reliable Data Transfer duplication, or errors. 2. Flow Control 3. Error Control Manages the rate of data transmission to avoid overwhelming the receiver. 4. Connection-oriented Services 5. Multiplexing Detects and corrects errors in the transmitted data. Establishes and terminates logical connections between devices. Supports multiple applications simultaneously by distinguishing them with port numbers. NWC201@ CST-Karma Wangchuk 5 11 October 2024 Transport Layer Design Issue Quality of Service (QoS) QoS refers to the performance characteristics that define the transport layer’s ability to deliver data. Important QoS parameters include: 1. Throughput: The rate of successful data transmission. 2. Delay (Latency): The time taken for a message to travel from source to destination. 3. Jitter: Variations in packet arrival times. 4. Reliability: Ensures delivery with minimal data loss or corruption. 5. Bandwidth: The capacity available for data transmission. NWC201@ CST-Karma Wangchuk 6 11 October 2024 Transport Layer Design Issue Transport Service Primitives Transport service primitives are a set of operations that define how communication is initiated, maintained, and terminated. Key primitives include: 1. LISTEN: Waits for a connection from a remote host. 2. CONNECT: Requests a connection to the remote host. 3. SEND: Sends data to the established connection. 4. RECEIVE: Receives data from the remote host. 5. DISCONNECT: Terminates the connection. NWC201@ CST-Karma Wangchuk 7 11 October 2024 Transport Layer Design Issue Socket Programming Sockets are endpoints of communication used in transport layer protocols like TCP and UDP. A socket is defined by an IP address and a port number. Socket programming allows developers to establish communication between different machines over a network. It supports two main types of communication: 1. Stream Sockets (TCP): Provide reliable, connection-oriented data transfer. 2. Datagram Sockets (UDP): Provide connectionless, unreliable data transfer. NWC201@ CST-Karma Wangchuk 8 11 October 2024 Transport Layer Port Number: 16-bits port number ranges from 0 to 65535 IANA (Internet Assigned Number Authority) divides the addresses into three ranges: 1. Well-known port 2. Registered ports 3. Dynamic ports NWC201@ CST-Karma Wangchuk 9 11 October 2024 Transport Layer Port Number: Well-known ports: Ranges from 0 to1023, assigned and controlled by IANA Registered ports: It ranges from 1024 to 49151, not assigned and controlled by IANA They can only be registered with IANA to prevent duplication Dynamic ports: The ports ranging from 49152 to 65535 are neither controlled by IANA nor registered. Used temporary or private port numbers NWC201@ CST-Karma Wangchuk 10 11 October 2024 Transport Layer Transport layer Protocols: Several application programs (processes) simultaneously running on a source host has to communicate with corresponding processes running on the remote destination host through the internet. There is a need for an additional mechanism and is called process-to- process delivery. Process-to-process delivery of segments in the transport layer takes place through an address known as the port number. NWC201@ CST-Karma Wangchuk 11 11 October 2024 Transport Layer Transport layer Protocols: There are several ways to achieve process-to-process communication The most common one is the Client/Server paradigm. A process on the localhost, called a Client, needs services from a process usually on the remote host, called a Server. NWC201@ CST-Karma Wangchuk 12 11 October 2024 Transport Layer Socket Addresses: Process-to-process delivery needs two identifiers, IP address and the port number, at each end to make a connection. The combination of an IP address and a port number is called a Socket address. The Client socket address defines the client process uniquely just as the server socket address defines the server process uniquely. NWC201@ CST-Karma Wangchuk 13 11 October 2024 Transport Layer Socket Addresses: A Transport layer protocol needs a pair of socket addresses: 1. The Client socket address 2. The Server socket address The internet has two main protocols in the transport layer: Connectionless protocol (UDP) Connection-oriented protocol (TCP) A new transport-layer protocol, SCTP, has been designed. NWC201@ CST-Karma Wangchuk 14 11 October 2024 Transport Layer: User Datagram Protocol (UDP) User Datagram Protocol: The relationship of the UDP to the other protocols and layers of the TCP/IP protocol suite: UDP is located between the application layer and the IP layer, and serves as the intermediary between the application programs and the network operations. NWC201@ CST-Karma Wangchuk 15 11 October 2024 Transport Layer: User Datagram Protocol (UDP) User Datagram Protocol: A transport layer protocol usually has several responsibilities. One is to create a process-to-process communication; UDP uses port numbers to accomplish process-to-process communication. Another responsibility is to provide control mechanisms at the transport level. UDP does this task at a very minimal level. There is no flow control mechanism and there is no acknowledgment for received packets. UDP, however, does provide error control to some extent. If UDP detects an error in the received packet, it silently drops it. NWC201@ CST-Karma Wangchuk 16 11 October 2024 Transport Layer: User Datagram Protocol (UDP) User Datagram Protocol: UDP is called a connectionless, unreliable transport protocol. It does not add anything to the services of IP except to provide process-to- process communication instead of host-to-host communication. It performs very limited error checking. If UDP is so powerless, why would a process want to use it? UDP is a very simple protocol using a minimum of overhead. If a process wants to send a small message and does not care much about reliability, it can use UDP. Sending a small message by UDP takes much less interaction between the sender and receiver than TCP NWC201@ CST-Karma Wangchuk 17 11 October 2024 Transport Layer: UDP Ports UDP Datagram Format: UDP packets are called user datagrams and have a fixed-size header of 8 bytes. Source port number. This is the port number used by the process running on the source host. It is 16 bits long, which means that the port number can range from 0 to 65,535. NWC201@ CST-Karma Wangchuk 18 11 October 2024 Transport Layer: UDP Ports UDP Datagram Format: Destination port number. This is the port number used by the process running on the destination host. It is also 16 bits long. NWC201@ CST-Karma Wangchuk 19 11 October 2024 Transport Layer: UDP Ports UDP Datagram Format: Length. This is a 16-bit field that defines the total length of the user datagram, header plus data. Checksum. This field is used to detect errors over the entire user datagram (header plus data). NWC201@ CST-Karma Wangchuk 20 11 October 2024 Transport Layer: UDP Ports Well-Known Ports used by UDP: NWC201@ CST-Karma Wangchuk 21 11 October 2024 Transport Layer Services provides by UDP: 1. Process-to-process Communication 2. Connectionless Services 3. Flow Control 4. Error Control 5. Congestion Control There is no error control mechanism in UDP except for the checksum. This means that the sender does not know if a message has been lost or duplicated. When the receiver detects an error through the checksum, the user datagram is silently discarded. NWC201@ CST-Karma Wangchuk 22 11 October 2024 Transport Layer Characteristics of UDP: Provides unreliable connectionless delivery service using IP to transport messages between two processes. UDP messages can be lost, duplicated, delayed and can be delivered out of order. UDP is a thin protocol (no significant functionality added to IP) It cannot provide reliable stream transport service. Guess what Protocol overcomes this limitation? ???. http://www.gripinit.com/2015/03/29/udp-theory/ NWC201@ CST-Karma Wangchuk 23 11 October 2024 Transport Layer Transmission Control Protocol: TCP provides reliable, full-duplex, stream delivery service using IP to transport messages between two processes. Reliability is ensured by: Connection oriented services Flow control using sliding window protocol Error detection by Checksum Error control by go-back-NARQ technique. Congestion avoidance algorithms ,such as slow-start, multiplicative decrease. NWC201@ CST-Karma Wangchuk 24 11 October 2024 Transport Layer TCP Datagram Format: NWC201@ CST-Karma Wangchuk 25 11 October 2024 Transport Layer Three types of addresses used by TCP/IP: NWC201@ CST-Karma Wangchuk 26 11 October 2024 Transport Layer Well-Known Ports used by TCP: NWC201@ CST-Karma Wangchuk 27 11 October 2024 Transport Layer Services Provided by TCP: 1. Process-to-process Communication 2. Stream Delivery Service 3. Connection-Oriented Service 4. Flow Control 5. Error Control 6. Control Congestion NWC201@ CST-Karma Wangchuk 28 11 October 2024 Transport Layer Services Provided by TCP Connection-Oriented Service TCP, unlike UDP, is a connection-oriented protocol. When a process at site A wants to send to and receive data from another process at site B, the following three phases occur: 1. The two TCPs establish a virtual connection between them. 2. Data are exchanged in both directions. 3. The connection is terminated. NWC201@ CST-Karma Wangchuk 29 11 October 2024 Transport Layer Stream Control Transmission Protocol SCTP is designed as a general-purpose transport layer protocol that can handle multimedia and stream traffic, which are increasing every day on the Internet. SCTP, however, is mostly designed for Internet applications that have recently been introduced and need a more sophisticated service than TCP can provide. These new applications, such as: 1. IUA (ISDN over IP), 2. M2UA and M3UA (telephony signalling), 3. H.248 (media gateway control), 4. H.323 (IP telephony), and 5. SIP (IP telephony). NWC201@ CST-Karma Wangchuk 30 11 October 2024 Transport Layer SCTP Service Provided by the SCTP: 1. Process-to-Process Communication 2. Connection-Oriented Service 3. Full-duplex Communication 4. Multi-homing Service 5. Multi-Stream Service NWC201@ CST-Karma Wangchuk 31 11 October 2024 Transport Layer Well-Known Ports used by SCTP: NWC201@ CST-Karma Wangchuk 32 11 October 2024 Transport Layer Elements of Transport Protocols Transport protocols include various mechanisms to ensure reliable communication between hosts: The following are Elements of Transport Protocols: 1. Addressing 2. Connection Establishment 3. Connection Release Multiplexing 4. Error Control Allows multiple applications to use the network simultaneously by 5. Flow Control assigning unique port numbers for each application. 6. Multiplexing Crash Recovery 7. Crash Recovery Allows multiple applications to use the network simultaneously by assigning unique port numbers for each application. NWC201@ CST-Karma Wangchuk 33 11 October 2024 Transport Layer Congestion Control Congestion control prevents network congestion by regulating the sending rate of data and managing network resources efficiently. The following are Congestion Control methods: 1. Desirable Bandwidth Allocation Ensuring that all users get a fair share of bandwidth without overloading the network. 2. Regulating the Sending Rate Proportional Fairness and Max-Min Fairness are common 3. Wireless Issues strategies Techniques like TCP’s Congestion Control Algorithms (Slow Start, Congestion Avoidance, Fast Retransmit) adjust the sender’s rate dynamically based on network conditions. Wireless networks face unique congestion challenges due to interference, varying signal strengths, and mobility of devices. Explicit Congestion Notification (ECN) and hybrid techniques are used to handle wireless congestion. NWC201@ CST-Karma Wangchuk 34 11 October 2024 Transport Layer Congestion Control: Bandwidth Allocation Ensuring that all devices in a network get a fair share of available bandwidth is crucial. The following are the key strategies for bandwidth allocation: 1. Max-Min Fairness This method ensures that resources are allocated in a way that 2. Proportional Fairness prioritizes the smallest demands first, ensuring that no user is starved of bandwidth 3. Weighted Fair Queuing Allocates bandwidth in proportion to the demand of each user, balancing fairness and efficiency. Allocates bandwidth based on weights assigned to different data flows, allowing high-priority flows to get more bandwidth. NWC201@ CST-Karma Wangchuk 35 11 October 2024 Recapitulation We have learned: Introduction User Datagram Protocol (UDP) UDP Datagram format Port Numbers Transmission Control Protocol (TCP) TCP Datagram format Types of addresses used by TCP/IP Stream Control Transmission Protocol NWC201@ CST-Karma Wangchuk 36 11 October 2024 References References: 1. Stallings, W., Data & Computer Communication, Prentice-Hall 2. Tanenbaum, Computers Networks, PHI 3. Forouzan, B.A., Data Communication & Networkings, 4th Edition. 4. Mr. Yeshi Wangchuk’s CCN Class Slides (2014), College of Science and Technology, Rinchending, Phuentsholing, Bhutan NWC201@ CST-Karma Wangchuk 37 11 October 2024 See you in next class. NWC201@ CST-Karma Wangchuk 38 11 October 2024