Data Communications & Computer Networks


Transport Layer

  • Process-to-process Delivery:
    * The data link layer is responsible for delivery of frames between two neighboring nodes over a link. This is called node-to-node delivery.
    * The network layer is responsible for delivery of datagram between two hosts. This is called host-to-host delivery.
    * Real communication takes place between two processes (application programs) in a
    network. This is called process-to process delivery.
    * The transport layer is responsible for process-to-process delivery-the delivery of a packet, part of a message, from one process to another.
    * At the transport layer, we need a transport layer address, called a port number, to choose among multiple processes running on the destination host.
    * In the Internet model, the port numbers are 16-bit integers between 0 and 65,535.
    * The client program defines itself with a port number, chosen randomly by the transport layer software running on the client host. This is the ephemeral port number.
    * The server process must also define itself with a port number. This port number, however, cannot be chosen randomly.
    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.
    * A transport layer protocol needs a pair of socket addresses: the client socket address and the server socket address.

    Multiplexing and Demultiplexing:
    * The addressing mechanism allows multiplexing and demultiplexing by the transport layer.

    * At the sender site, there may be several processes that need to send packets. However, there is only one transport layer protocol at any time. This is a many-to-one relationship and requires multiplexing.
    * The protocol accepts messages from different processes, differentiated by their assigned port numbers.
    * After adding the header, the transport layer passes the packet to the network layer.
         At the receiver site, the relationship is one-to-many and requires demultiplexing. The transport layer receives datagrams from the network layer. After error checking and dropping of the header, the transport layer delivers each message to the appropriate process based on the port number.
    Connectionless Versus Connection-Oriented Service:
    A transport layer protocol can either be connectionless or connection-oriented.
    * Connectionless Service In a connectionless service, the packets are sent from one party to another with no need for connection establishment or connection release. The packets are not numbered; they may be delayed or lost or may arrive out of sequence. There is no acknowledgment either. We will see shortly that one of the transport layer protocols in the Internet model, UDP, is connectionless.
    * Connection Oriented Service
         In a connection-oriented service, a connection is first established between the sender and the receiver. Data are transferred. At the end, the connection is released. We will see shortly that TCP and SCTP are connection-oriented protocols.
    Reliable Versus Unreliable:
    * The transport layer service can be reliable or unreliable.
    * If the application layer program needs reliability, we use a reliable transport layer protocol by implementing flow and error control at the transport layer. This means a slower and more
    Complex service:
    * On the other hand, if the application program does not need reliability because it uses its own flow and error control mechanism or it needs fast service or the nature of the service does not demand flow and error control (real-time applications), then an unreliable protocol can be used.

    User Datagram Protocol (UDP):
    * The 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-toprocess communication instead of host-to-host communication. Also, it performs very limited error checking.
    * If UDP is so powerless, why would a process want to use it? With the disadvantages come some advantages. 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 using UDP takes much less interaction between the sender and receiver than using.
    User Datagram:
    * UDP packets, called user datagram, have a fixed-size header of 8 bytes. Below figure 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 source host. It is 16 bits long, which means that the port number can range from 0 to 65,535.
    * If the source host is the client (a client sending a request), the port number, in most cases, is an ephemeral port number requested by the process and chosen by the UDP software running on the source host.
    * If the source host is the server (a server sending a response), the port number, in most cases, is a well-known port number.
    Destination port number:
    * This is the port number used by the process running on the destination host. It is also 16 bits long.
    * If the destination host is the server (a client sending a request), the port number, in most cases, is a well-known port number.
    * If the destination host is the client (a server sending a response), the port number, in most cases, is an ephemeral port number. In this case, the server copies the ephemeral port number it has received in the request packet.
    * This is a 16-bit field that defines the total length of the user datagram, header plus data.
    * The 16 bits can define a total length of 0 to 65,535 bytes.
    * This field is used to detect errors over the entire user datagram (header plus data).
    UDP Operation:
    UDP uses concepts common to the transport layer.
    * Connectionless Services: As mentioned previously, 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. The user datagrams are not numbered. Also, there is no connection establishment and no connection termination, as is the case for TCP. This means that each user datagram can travel on a different path.
    * 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. 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.
    * 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. 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.
    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. For example, the Trivial File Transfer Protocol (TFTP) process includes flow and error control.
    * UDP is a suitable transport protocol for multicasting. Multicasting capability is embedded in the UDP software but not in the TCP software.
    * UDP is used for management processes such as SNMP.
    * UDP is used for some route updating protocols such as Routing Information Protocol (RIP).
    * TCP is called a connection-oriented, reliable transport protocol.
    * It adds connection-oriented and reliability features to the services of IP.
    TCP Services:
          Before we discuss TCP in detail, let us explain the services offered by TCP to the processes at the application layer.
    * Process-to-Process Communication:
    * Like UDP, TCP provides process-to-process communication using port numbers.
    * Stream Delivery Service TCP, unlike UDP, is a stream-oriented protocol. In UDP, a process (an application program) sends messages, with predefined boundaries, to UDP
    for delivery. UDP adds its own header to each of these messages and delivers them to IP for transmission. Each message from the process is called a user datagram and becomes, eventually, one IP datagram. Neither IP nor UDP recognizes any relationship between the datagrams.
         TCP, on the other hand, allows the sending process to deliver data as a stream of bytes and allows the receiving process to obtain data as a stream of bytes. TCP creates an environment in which thetwo processes seem to be connected by an imaginary "tube" that carries their data across the Internet.
    * Full-Duplex Communication:
         TCP offers full-duplex service, in which data can flow in both directions at the same time. Each TCP then has a sending and receiving buffer, and segments move in both directions.
    * Connection-Oriented Service:
         TCP, unlike UDP, is a connection-oriented protocol. When a process at site A wants to send and receive data from another process at site B, the following occurs:
    1. The two TCPs establish a connection between them.
    2. Data are exchanged in both directions.
    3. The connection is terminated.
    TCP Segment Format:
         The segment consists of a 20- to 60-byte header, followed by data from the application program. The header is 20 bytes if there are no options and up to 60 bytes if it contains options.
    * Source port address: This is a 16-bit field that defines the port number of the application program in the host that is sending the segment. This serves the same purpose as the source port address in the UDP header.
    * Destination port address: This is a 16-bit field that defines the port number of the application program in the host that is receiving the segment. This serves the same purpose as the destination port address in the UDP header.
    * Sequence number: This 32-bit field defines the number assigned to the first byte of data contained in this segment. As we said before, TCP is a stream transport protocol. To ensure connectivity, each byte to be transmitted is numbered. The sequence number tells the destination which byte in this sequence comprises the first byte in the segment. During connection establishment, each party uses a random number generator to create an initial sequence number (ISN), which is usually different in each direction.

    * Acknowledgment number: This 32-bit field defines the byte number that the receiver of the segment is expecting to receive from the other party. If the receiver of the segment has successfully received byte number x from the other party, it defines x + I as the acknowledgment number. Acknowledgment and data can be piggybacked together.
    * 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. One or more of these bits can be set at a time.
    > URG The value of the urgent pointer field is valid.
    > ACK The value of the acknowledgment field is valid.
    > PSH Push the data.
    > RST Reset the connection.
    > SYN Synchronize sequence numbers during connection.
    > FIN Terminate the connection
    * Window size: This field defines the size of the window, in bytes, that the other party must maintain.
    * Checksum: This 16-bit field contains the checksum. The calculation of the checksum for TCP follows the same procedure as the one described for UDP. However, the inclusion of the checksum in the UDP datagram is optional, whereas the inclusion of the checksum for TCP is mandatory.
    * Urgent pointer: This l6-bit field, which is valid, only if the urgent flag is set, is used when the segment contains urgent data. It defines the number that must be added to the sequence number to obtain the number of the last urgent byte in the data section of the segment.
    * Options: There can be up to 40 bytes of optional information in the TCP header.
    * Congestion Control and Quality of Service: Congestion control and quality of service are two issues so closely bound together that improving one means improving the other and ignoring one usually means ignoring the other. Most techniques to prevent or eliminate congestion also improve the quality of service in a network.
    * An important issue in a packet-switched network is congestion.
    * Congestion in a network may occur if the load on the network-the number of packets sent to the network-is greater than the capacity of the network-the number of packets a network can handle.
    * Congestion control refers to the mechanisms and techniques to control the congestion and keep the load below the capacity.
    * Flow Characteristics: Traditionally, four types of characteristics are attributed to a flow: reliability, delay, jitter, and bandwidth.
    * Reliability: Reliability is a characteristic that a flow needs. Lack of reliability means
    losing a packet or acknowledgment, which entails retransmission. However, the sensitivity of application programs to reliability is not the same. For example, it is more important that electronic mail, file transfer, and Internet access have reliable transmissions than telephony or audio conferencing.
    * Delay: Source-to-destination delay is another flow characteristic. Again applications can tolerate delay in different degrees. In this case, telephony, audio conferencing, video conferencing, and remote log-in need minimum delay, while delay in file transfer or email is less important.
    * Jitter: Jitter is the variation in delay for packets belonging to the same flow. For example, if four packets depart at times 0, 1, 2, 3 and arrive at 20, 21, 22, 23, all have the same delay, 20 units of time. On the other hand, if the above four packets arrive at 21, 23, 21, and 28, they will have different delays: 21, 22, 19, and 24. Jitter is defined as the variation in the packet delay. High jitter means the difference between delays is large; low jitter means the variation is small.
         To define QoS in terms of its characteristics. In this section, we discuss some techniques that can be used to improve the quality of service. We briefly discuss four common methods: scheduling, traffic shaping, admission control, and resource reservation.
    Leaky bucket:
         A leaky bucket algorithm shapes bursty traffic into fixed-rate traffic by averaging the data rate. It may drop the packets if the bucket is full.

    Token bucket:
    The token bucket allows bursty traffic at a regulated maximum rate.

         Two models have been designed to provide quality of service in the Internet: Integrated Services and Differentiated Services. We discuss the first model here. Integrated Services is a flow-based QoS model designed for IP.
    Path messages:

    Resv messages:

         Differentiated Services (DS or Diffserv) was introduced by the IETF (Internet Engineering Task Force) to handle the shortcomings of Integrated Services. Differentiated Services is a class-based QoS model designed for IP.

Industry      Interaction

Higher Education

Job Skills

Soft Skills

Comm. English

Mock Test