The transport layer is responsible for process-to-process
delivery - the delivery of a packet, part of a message, from one process to another. Two processes communicate in a client/server relationship. Client/Server Paradigm A process on local host is called a client. The service is provided by a process running on a remote host, called server. At transport layer , we need a transport layer address, called a port number, to choose among multiple processes running on the destination host. The destination port is needed for delivery, the source port number is needed for reply. In the Internet model, the port numbers are 16 bit integers between 0 and 65,535. Client/Server Paradigm 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 port number of server process cannot be chosen randomly. The Internet has decided to use universal port numbers for servers; these are called well-known port numbers. Client/Server Paradigm Day time client uses an ephemeral (temporary) port number 52000 to identify itself. Day time server must use the well-known (permanent) port number 13. Client/Server Paradigm IANA (Internet Assigned Number Authority) Ranges: Well-known ports: 0 to 1023. Assigned and controlled by IANA Registered ports: 1024 – 49,151. Not assigned and controlled by IANA. They can only be registered with IANA to prevent duplication. Dynamic ports: 49,152 – 65,535. Neither controlled nor registered. They can be used by any process. These are ephemeral ports. Client/Server Paradigm IP addresses versus port numbers Socket address The combination of an IP address and a port number is called a socket address. Encapsulation and decapsulation Multiplexing and Demultiplexing Multiplexing and Demultiplexing The transport layer at the client site accepts three messages from the three processes and creates three packets. It acts as a multiplexer. The packets 1 and 3 use the same logical channel to reach the transport layer of the first server. When they arrive at the server, the transport layer does the job of a demultiplexer and distributes the messages to two different processes. The transport layer at the second server receives packet 2 and delivers it to the corresponding process. Multiplexing and Demultiplexing Multiplexing and Demultiplexing Flow Control Pushing or Pulling: Pushing: If the sender delivers items whenever they are produced ⎯ without a prior request from the consumer ⎯ the delivery is referred to as pushing. When the producer pushes the items, the consumer may be overwhelmed and there is a need for flow control, in the opposite direction, to prevent discarding of the items. Pushing: If the producer delivers the items after the consumer has requested them, the delivery is referred to as pulling. Flow Control Error Control Reliability can be achieved to add error control services to the transport layer. Error control at the transport layer is responsible for 1. Detecting and discarding corrupted packets. 2. Keeping track of lost and discarded packets and resending them. 3. Recognizing duplicate packets and discarding them. 4. Buffering out-of-order packets until the missing packets arrive. Error Control Sequence Numbers: A field to the transport-layer packet holds the sequence number of the packet. 1. When a packet is corrupted or lost, the receiving transport layer can somehow inform the sending transport layer to resend that packet using the sequence number. 2. The receiving transport layer can also detect duplicate packets if two received packets have the same sequence number. 3. The out-of-order packets can be recognized by observing gaps in the sequence numbers. For error control, the sequence numbers are modulo 2m, where m is the size of the sequence number field in bits. If m is 4, the only sequence numbers are 0 through 15, inclusive Error Control Acknowledgment:
The receiver side can send an acknowledgment (ACK) for each
of a collection of packets that have arrived safe and sound.
Combination of Flow and Error Control:
These two requirements can be combined if we use two numbered buffers, one at the sender, one at the receiver – Sliding Window Protocol. Congestion Control Congestion in a packet switched 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 that control the congestion and keep the load below the capacity. Congestion in a network or internetwork occurs because routers and switches have queues. If a router cannot process the packets at the same rate at which they arrive, the queues become overloaded and congestion occurs. Congestion at the transport layer is the result of congestion at the network layer, which manifests itself at the transport layer. Connectionless Service Connectionless Service: The packets are sent from one party to another with no need for connection establishment or connection release. Packets are not numbered. They may be delayed or lost or may arrive out of sequence. No acknowledgement. Connection-Oriented Service Connection-Oriented Service: A connection is first established between the sender and the receiver. Data are transferred. Then connection is released. FSM Position of UDP, TCP, and SCTP in TCP/IP suite