























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Computer Network - Unit 4 notes
Typology: Study notes
1 / 31
This page cannot be seen from the preview
Don't miss anything!
























CN :Unit IV - Transport Layer- Chennai Institute of Technology
Introduction – Transport Layer Protocols – Services – Port Numbers – User Datagram Protocol – Transmission Control Protocol – SCTP.
CN :Unit IV - Transport Layer- Chennai Institute of Technology b) Desired average and maximum delay. c) Throughput. d) Priority level. e) Resilience.
3. Data transfer: It transfers data between two transport entities. 4. User Interface: There is not clear mechanism of the user interface to the transport protocol should be standardized. 5. Connection management : If connection-oriented service is provided, the transport entity is responsible for establishing and terminating connections. 6. Status reporting : It gives the following information. a) Addresses. b) Performance characteristics of a connection. c) Class of protocol in use. d) Current timer values. 7. Security : The transport entity may provide a variety of security services.
UDP is a simple, datagram-oriented, transport layer protocol. UDP is connectionless protocol provides no reliability or flow control mechanisms. It also has no error recovery procedures. The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol. It performs very limited error checking.
1. User Datagram UDP packets, called user datagrams, have a fixed-size header of 8 bytes. Figure 4.9 shows the format of a user datagram. The fields are as follows: Source port number. This is the port number used by the process running on the sourcehost. It is 16 bits long, which means that the port number can range from 0 to 65,535. Destination port number. This is the port number used by the process running on thedestination host. It is also 16 bits long.
CN :Unit IV - Transport Layer- Chennai Institute of Technology Connectionless Services UDP provides a connectionless service. This means that each user datagram sent by UDP is an independent datagram. There is no relationship between the different user datagrams even if they are coming from the same source process and going to the same destination program. Flow and Error Control UDP is a very simple, unreliable transport protocol. There is no flow control and hence no window mechanism. The receiver may overflow with incoming messages. There is no error control mechanism in UDP except for the checksum. Encapsulation and Decapsulation To send a message from one process to another, the UDP protocol encapsulates and decapsulates messages in an IP datagram. Queuing In UDP, queues are associated with ports. (Figure 4.12). At the client site, when a process starts, it requests a port number from the operating system. Some implementations create both an incoming and an outgoing queue associated with each process. Other implementations create only an incoming queue associated with each process.
5. Use of UDP The following lists some uses of the UDP protocol: UDP is suitable for a process that requires simple request-response communication with little concern for flow and error control. UDP is suitable for a process with internal flow and error control mechanisms. UDP is a suitable transport protocol for multicasting. UDP is used for some route updating protocols such as Routing Information Protocol (RIP).
TCP is a process-to-process (program-to-program) protocol. TCP is called a connection- oriented, reliable transport protocol. TCP uses flow and error control mechanisms at the transport level.
CN :Unit IV - Transport Layer- Chennai Institute of Technology The services offered by TCP to the processes at the application layer. Process-to-Process Communication TCP provides process-to-process communication using port numbers.
CN :Unit IV - Transport Layer- Chennai Institute of Technology The segment consists of a 20- to 60-byte header. Source port address. This is a 16-bit field that defines the port number of the applicationprogram. Destination port address. This is a 16-bit field that defines the port number of theapplication program in the host that is receiving the segment. Sequence number. This 32-bit field defines the number assigned to the first byte of datacontained in this segment. Acknowledgment number. This 32-bit field defines the byte number that the receiver ofthe segment is expecting to receive from the other party. Header length. This 4-bit field indicates the number of 4-byte words in the TCP header.The length of the header can be between 20 and 60 bytes. Therefore, the value of this field can be between 5 (5 x 4 =20) and 15 (15 x 4 =60). Reserved. This is a 6-bit field reserved for future use. Control. This field defines 6 different control bits or flags as shown in Figure 4.17.One or more of these bits can be set at a time. These bits enable flow control, connection establishment and termination, connection abortion, and the mode of data transfer in TCP. A brief description of each bit is shown in Table 4. Window size. This field defines the size of the window, in bytes, that the other partymust maintain. Checksum. This 16-bit field contains the checksum. Urgent pointer. This l6-bit field, which is valid, only if the urgent flag is set, is usedwhen the segment contains urgent data.
CN :Unit IV - Transport Layer- Chennai Institute of Technology Options. There can be up to 40 bytes of optional information in the TCP header. A TCP Connection TCP is connection-oriented. A connection-oriented transport protocol establishes a virtual path between the source and destination. All the segments belonging to a message are then sent over this virtual path. a. Connection Establishment TCP transmits data in full-duplex mode. When two TCPs in two machines are connected, they are able to send segments to each other simultaneously. Three-Way Handshaking: The connection establishment in TCP is called three way handshaking. Tthe three-way handshaking process as shown in Figure 4.18.
CN :Unit IV - Transport Layer- Chennai Institute of The FIN segment consumes one sequence number if it does not carry data.
CN :Unit IV - Transport Layer- Chennai Institute of
10. Flow Control TCP uses a sliding window to handle flow control. The sliding window protocol used by TCP, however, is something between the Go-Back-N and Selective Repeat sliding window. The size of the window at one end is determined by the lesser of two values: receiver window (rwnd) or congestion window (cwnd). Some points about TCP sliding windows: The size of the window is the lesser of rwnd and cwnd. The source does not have to send a full window's worth of data. The window can be opened or closed by the receiver, but should not be shrunk. The destination can send an acknowledgment at any time as long as it does not result in a shrinking window. The receiver can temporarily shut down the window; the sender, however, can always send a segment of 1 byte after the window is shut down. 11. Error Control TCP is a reliable transport layer protocol. This means that an application program that delivers a stream of data to TCP relies on TCP to deliver the entire stream to the application program on the other end in order, without error, and without any part lost or duplicated. a. Checksum Each segment includes a checksum field which is used to check for a corrupted segment. If the segment is corrupted, it is discarded by the destination TCP and is considered as lost. TCP uses a 16-bit checksum that is mandatory in every segment. b. Acknowledgment TCP uses acknowledgments to confirm the receipt of data segments. c. Retransmission The heart of the error control mechanism is the retransmission of segments. When a segment is corrupted, lost, or delayed, it is retransmitted.. i. Retransmission After RTO A recent implementation of TCP maintains one retransmission time-out (RTO) timer for all outstanding (sent, but not acknowledged) segments.
CN :Unit IV - Transport Layer- Chennai Institute of c. Fast Retransmission In this scenario, we want to show the idea of fast retransmission. Our scenario is the same as the second except that the RTO has a higher value (see Figure 4.25). Example 4.5.1 With TCP's slow start and AIMD for congestion control, show how the windowsize will vary for a transmission where every 5th packet is lost. Assume an advertised window size of 50 MSS. Solution: Since Slow Start is used, window size is increased by the number ofsegments successfully sent. This happens until either threshold, value is reached or time out occurs. In both of the above situations AIMD is used to avoid congestion. If threshold is reached, window size will be increased linearly. If there is timeout, window size will be reduced to half. Assuming the window size at the start of the slow start phase is 2 MSS and the threshold at the start of the first transmission is 8 MSS.
CN :Unit IV - Transport Layer- Chennai Institute of Window size for 1st transmission = 2 MSS Window size for 2nd transmission = 4 MSS Window size for 3rd transmission = 8 MSS threshold reached, increase linearly (according to AIMD) Window size for 4th transmission = 9 MSS Window size for 5th transmission = 10 MSS time out occurs, resend 5thwith window size starts with as slow start. Window size for 6 th transmission = 2 MSS Window size for 7 th transmission = 4 MSS threshold reached, now increase linearly (according to AIMD) Additive Increase: 5 MSS (since 8 MSS isn't permissible anymore) Window size for 8th transmission = 5 MSS Window size for 9th transmission = 6 MSS Window size for 10th transmission = 7 MSS This shows that window size is variable and time out occurs during the fifth transmission. Example 4.5.2 Suppose you are hired to design a reliable byte-stream protocol that uses a sliding window (like TCP). This protocol will run over a 50-Mbps network, the RTT of the network is 80ms and the maximum segment lifetime is 60 seconds. How many bits would you include in the Advertised Window and Sequence Numfields of your protocol header? Solution
The window size (in bytes) must be RTT Bandwidth = 8 (0.08) = 500 bytes We need therefore, 12 bits for the advertized window (allows a maximum windowsize of 33554431 bytes)
CN :Unit IV - Transport Layer- Chennai Institute of
Congestion control refers to techniques and mechanisms that can either prevent congestion, before it happens, or remove congestion, after it has happened. In general, we can divide congestion control mechanisms into two broad categories: open-loop congestion control (prevention) and closed-loop congestion control (removal) as shown in Figure 4.27.
CN :Unit IV - Transport Layer- Chennai Institute of c. Acknowledgment Policy The acknowledgment policy imposed by the receiver may also affect congestion. If the receiver does not acknowledge every packet it receives, it may slow down the sender and help prevent congestion. d. Discarding Policy A good discarding policy by the routers may prevent congestion and at the same time may not harm the integrity of the transmission. For example, in audio transmission, if the policy is to discard less sensitive packets when congestion is likely to happen, the quality of sound is still preserved and congestion is prevented or alleviated. e. Admission Policy An admission policy, which is a quality-of-service mechanism, can also prevent congestion in virtual-circuit networks. Switches in a flow, first check the resource requirement of a flow before admitting it to the network.
CN :Unit IV - Transport Layer- Chennai Institute of TempP We know have Pcount = (1^ ^ count^ ^ TempP) = 1/(100 – count)
1 count 0.01 =^
100 count
Some techniques that can be used to improve the quality of service. The four common methods: scheduling, traffic shaping, admission control, and resource reservation. a. Scheduling Packets from different flows arrive at a switch or router for processing. A good scheduling technique treats the different flows in a fair and appropriate manner. Several scheduling techniques are designed to improve the quality of service. We discuss three of them here: FIFO queuing, priority queuing, and weighted fair queuing. i. FIFO Queuing In first-in, first-out (FIFO) queuing, packets wait in a buffer (queue) until the node (router or switch) is ready to process them. If the average arrival rate is higher than the average processing rate, the queue will fill up and new packets will be discarded. A FIFO queue is familiar to those who have had to wait for a bus at a bus stop. ii. Priority Queuing In priority queuing, packets are first assigned to a priority class. Each priority class has its own queue. The packets in the highest-priority queue are processed first. Packets in the lowest- priority queue are processed last. Figure 4.32 shows priority queuing with two priority levels (for simplicity).
CN :Unit IV - Transport Layer- Chennai Institute of iii. Weighted Fair Queuing A better scheduling method is weighted fair queuing. In this technique, the packets are still assigned to different classes and admitted to different queues. The queues, however, are weighted based on the priority of the queues; higher priority means a higher weight. The system processes packets in each queue in a round-robin fashion with the number of packets selected from each queue based on the corresponding weight. For example, if the weights are 3, 2, and 1, three packets are processed from the first queue, two from the second queue, and one from the third queue. Figure 4.33 shows the technique with three classes. b. Traffic Shaping Traffic shaping is a mechanism to control the amount and the rate of the traffic sent to the network. Two techniques can shape traffic: leaky bucket and token bucket i. Leaky Bucket If a bucket has a small hole at the bottom, the water leaks from the bucket at a constant rate as long as there is water in the bucket. The rate at which the water leaks does not depend on the rate at which the water is input to the bucket unless the bucket is empty. The input rate can vary, but the output rate remains constant. Similarly, in networking, a technique called leaky bucket can smooth out bursty traffic. Bursty chunks are stored in the bucket and sent out at an average rate. Figure 4.34 shows a leaky bucket and its effects.