0% found this document useful (0 votes)
23 views23 pages

Lecture 21 Intro To TCP

The document provides an introduction to the transport layer in computer networks, detailing its role in process-to-process communication between application layers on local and remote hosts. It discusses key concepts such as addressing, port numbers, encapsulation, multiplexing, and error control, as well as the differences between connection-oriented and connectionless services. Additionally, it covers the importance of flow and congestion control in maintaining effective communication across networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views23 pages

Lecture 21 Intro To TCP

The document provides an introduction to the transport layer in computer networks, detailing its role in process-to-process communication between application layers on local and remote hosts. It discusses key concepts such as addressing, port numbers, encapsulation, multiplexing, and error control, as well as the differences between connection-oriented and connectionless services. Additionally, it covers the importance of flow and congestion control in maintaining effective communication across networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Introduction to Transport Layer

Computer Networks(CS31204)

Prof. Sudip Misra


Department of Computer Science and Engineering
Indian Institute of Technology Kharagpur
Email: [email protected]
Website: http://cse.iitkgp.ac.in/~smisra/
Research Lab: cse.iitkgp.ac.in/~smisra/swan/

1
Introduction
 Provides a process-to-process communication
between two application layers, one at the local
host and the other at the remote host.

 Communication is provided using a logical


connection.

 Two application layers, which can be located in


different parts of the globe, assume that there is
an imaginary direct connection through which
they can send and receive messages.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 2
Process to Process Communication
 A transport-layer protocol is responsible for delivery of the message to the appropriate
process.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 3
Addressing
 A process on the local host, called a client, needs services from a process usually on the
remote host, called a server.

 A remote computer can run several server programs at the same time.

 The local host and the remote host are defined using IP addresses.

 To define the processes, we need an identifiers, called port numbers.

 In the TCP/IP protocol suite, the port numbers are integers between 0 and 65,535 (16 bits).

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 4
Port Numbers
Ephemeral Port number
 The client program defines itself with a
port number, called the ephemeral port
number.
 The word ephemeral means “short-lived”
and is used because the life of a client is
normally short.

Well Known Port number


 TCP/IP has decided to use universal port
numbers for servers; these are called
well-known port numbers.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 5
Ip Addresses Versus Port Numbers
 The destination IP address
defines the host among the
different hosts in the world.

 After the host has been selected,


the port number defines one of
the processes on this particular
host.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 6
ICANN Ranges
ICANN has divided the port numbers into three ranges: well-known, registered, and dynamic (or
private).

 Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled
by ICANN. These are the well-known ports.

 Registered ports. The ports ranging from 1024 to 49,151 are not assigned or controlled by
ICANN. They can only be registered with ICANN to prevent duplication.

 Dynamic ports. The ports ranging from 49,152 to 65,535 are neither controlled nor registered.
They can be used as temporary or private port numbers.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 7
Some Well Known Port Numbers

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 8
Stream and Segment
 Data viewed as a byte stream, i.e., a sequence of bytes

 Segment – the unit of transfer between TCP s/w on two machines

 The stream of bytes is divided into segments, each segment is given a TCP header, and
transmitted

 Usually 1 segment is encapsulated in 1 IP datagram

 Segments may not contain any data

 Ex – segments used to establish/terminate connections, send acks etc.

 Sequence Number – used to specify position within the stream

 Each TCP segment will contain a 32-bit sequence no. to identify its position in the stream

Prof. Sudip Misra, IIT Kharagpur 9


Maximum Segment Size
 Maximum size of a segment (excluding header)

 Ideally, should be (Minimum MTU of any link from the source to the destination –TCP header
size – IP header size)

 Avoids fragmentation and reassembly at IP layer, which is costly

 Hard to know minimum MTU of links end-to-end, though can be known in some cases, for ex, if
all links are Ethernet

 Default MSS = 536

 All IP based networks must support a MTU of 576

 Can be changed during connection establishment time using TCP options

 Cannot be changed once connection is established

Prof. Sudip Misra, IIT Kharagpur 10


Socket Addresses
 A transport-layer protocol in the TCP suite needs both the 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.

 Socket address defines the process uniquely

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 11
Encapsulation and Decapsulation
 Encapsulation happens at the sender site.
 The transport layer receives the data and adds the transport-layer header. The packets at the
transport layer in the Internet are called segments.
 Decapsulation happens at the receiver site.
 When the message arrives at the destination transport layer, the header is dropped and the
transport layer delivers the message to the process running at the application layer.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 12
Multiplexing and Demultiplexing
 Whenever an entity accepts items from more
than one source, this is referred to as
multiplexing (many to one).

 Whenever an entity delivers items to more


than one source, this is referred to as
demultiplexing (one to many).

 The transport layer at the source


performs multiplexing; the transport layer at
the destination performs demultiplexing.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 13
Pushing and Pulling
 Delivery of items from a producer to a consumer can occur in one of two ways: pushing or
pulling.

 If the sender delivers items whenever they are produced- without a prior request from the
consumer- the delivery is referred to as pushing.

 If the producer delivers the items after the consumer has requested them, the delivery is
referred to as pulling.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 14
Flow Control

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 15
Error Control
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.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 16
Congestion Control
 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 that


control the congestion and keep the load below the capacity.

Prof. Sudip Misra, IIT Kharagpur 17


Connectionless Services

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 18
Connectionless Services
 In a connectionless service, the source process (application program) needs to divide its
message into chunks of data of the size acceptable by the transport layer and deliver them
to the transport layer one by one.
 The transport layer treats each chunk as a single unit without any relation between the
chunks.
 When a chunk arrives from the application layer, the transport layer encapsulates it in a
packet and sends it.
 To show the independency of packets, assume that a client process has three chunks of
messages to send
to a server process.
 The chunks are handed over to the connectionless transport protocol in order.
 However, since there is no dependency between the packets at the transport layer, the
packets may arrive out of order at the destination and will be delivered out of order to the
server process.

Prof. Sudip Misra, IIT Kharagpur 19


Connection Oriented Services
 In a connection-oriented service,
the client and the server first need
to establish a logical connection
between themselves.

 The data exchange can only


happen after the connection
establishment.

 After data exchange, the


connection needs to be torn down

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 20
Connectionless and connection-oriented
service represented as FSM
 FSM in connectionless
transport layer with only one
state: the established state.

 The machine on each end


(client and server) is always
in the established state,
ready to send and receive
transport-layer packets.

 An FSM in a connection-
oriented transport layer, on
the other hand, needs to go
through three states before
reaching the established
state. Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-
Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 21
Stream Delivery Service
 Deliver data as a stream of bytes and allows the receiving process to obtain data as a stream of bytes.

 The sending process produces (writes to) the stream and the receiving process consumes (reads from) it.

Source: B. A. Forouzan, “ Data Communications and Networking ,” McGraw-


Prof. Sudip Misra, IIT Kharagpur Hill Forouzan Networking Series,5E. 22
Thank You!!!

23

You might also like