You are on page 1of 21

Transport Layer

• This is between application and network layer


• It has the critical role of providing
communication services directly to the
application processes running on different
hosts

• Two transport layer protocols are important


• TCP ---connection oriented
• UDP---connectionless

26-10'09 transport layer 1


• A transport layer provides for logical
communication between application
processes running on different hosts

• Logical communication-meaning- as if
the hosts running processes are
directly connected, --- in reality they
are not---- the hosts may be on
opposite sides of the planet

• Connected via numerous routers and a


wide range of link types
26-10'09 transport layer 2
• Application processes use the logical
communication provided by the
transport layer to send the messages to
each other

• Free from the worry of the details of


the infrastructure used to carry these
messages

26-10'09 transport layer 3


• Transport layer protocols are implemented in
the end systems but not in network routers

26-10'09 transport layer 4


• 2 distinct transport layer protocols are
available to the application layer

• UDP--- Unreliable—connectionless service to


the invoking application

• TCP-provides a reliable ,connection oriented


service to the invoking application

• Application developer selects one of these 2


protocols

26-10'09 transport layer 5


• Refer to the transport layer packet as a
segment

• Datagram ---network layer packet

• Data flows from transport layer to the


network layer— uses IP

• IP provides logical communication


between hosts
26-10'09 transport layer 6
• The most fundamental responsibility of UDP
and TCP is to extend IP’s delivery service
between the 2 end systems to a delivery
service between 2 processes running on the
end systems

• This is known as ‘ transport layer multiplexing


and demultiplexing’

• TCP and UDP also provide integrity checking


by including error detection fields in their
segments’ headers

26-10'09 transport layer 7


• TCP offers several additional services to
applications----foremost- ‘reliable data
transfer’

• Uses flow control, sequence numbers,


acknowledgements, and timers---to ensure
correctness and the order

• TCP also provides congestion control

• It is not a service provided to the application


layer
26-10'09 transport layer 8
• It is a service for the internet as a whole, a
service for the good

• It prevents any one TCP connection sinking


(swamping) an excessive amount of traffic

• This is done by regulating the rate at which


the sending-side TCPs can send traffic into
the network

• UDP on the other hand is unregulated

26-10'09 transport layer 9


Multiplexing and Demultiplexing
• A process can have one or more sockets, each
having a unique identifier- depends on
whether it is a UDP or a TCP socket

• At any given time there can be more than one


socket in the receiving host

• How a receiving host directs an incoming


transport –layer segment to the appropriate
socket?

26-10'09 transport layer 10


Multiplexing and Demultiplexing

Application
Application P4
P3 P1 Application P2
Transport Transport Transport

Network Network
Network
Data link Data link
Data link
Physical Physical
Physical

Process

Socket

26-10'09 transport layer 11


• Each transport-layer segment has a set of
fields in the segment for this purpose

• At the receiving end, the transport layer


examines the fields to identify the receiving
socket and then directs the segment to that
socket

• This job of delivering the data in a transport


layer segment to the correct socket is---
demultiplexing

26-10'09 transport layer 12


• The job of gathering data chunks at the
source host from different sockets,
encapsulating each data chunk with header
information to create segments, and passing
the segments to the network layer is---
multiplexing

26-10'09 transport layer 13


• Transport-layer MUX requires:

Sockets having unique identifiers

Each segment have special fields that indicate


the socket to which the segment is to be
delivered

26-10'09 transport layer 14


16 bits number, ranging from 0 to 65535
0-1023 are called well known port numbers
And are restricted
32 bits

Source port # Dest.port #

Other header fields

Application data
(message)

Source and destination port-number fields in a


Transport layer segment

26-10'09 transport layer 15


Connection oriented Mux & D’mux
• Connection oriented-TCP connection
• TCP socket and the TCP connection
• TCP socket is identified by 4 fields:
Source IP address
Source port number
Destination IP address
Destination port number

26-10'09 transport layer 16


The inversion of source and destination port numbers

Server B

Host A
Source port: Dest.port:
19157 46428

Source port: Dest.port:


46428 19157

26-10'09 transport layer 17


Web servers and TCP

26-10'09 transport layer 18


Web
Server
Web B
Source Dest.port:
Source Client port: 80
Dest.
port:
port: Host 26145 Dest.IP:
7532 Source IP: B
80 C
Source IP: C
Dest. IP:
C
B

2 clients using
the same Transport layer
Destination port Source Dest. Demultiplexing
number port: port:
(80) To communicate 26145 26145
with Source IP: Dest. IP:
The same web server A B
application

Web
Host
A

26-10'09 transport layer 19


• Nonpersistent connections:
• Steps of transferring a web page from server to client

• Suppose the page consists of a base HTML file and 5


JPEG images, and all of these 6 objects reside on the
same server

•http://www.someSchool.edu/someDepartment/home.index

1.The HTTP client process initiates a TCP connection to the


server- www.someSchool.edu on port 80

2.The HTTP client sends an HTTP request message to the


server via its socket associated with the TCP connection.
The request message includes the path name
/someDepartment/home.index
26-10'09 transport layer 20
3. The HTTP server process receives the request message
via its socket associated with the connection, retrieves
the object--/someDepartment/home.index from its
storage, encapsulates the object in an HTTP response
message, and sends it to the client via its socket
4. The HTTP server process tells TCP to close the process
connection.
5. The HTTP client receives the response message. The
TCP connection terminates. The message indicates that
the encapsulated object is an HTML file The client
extracts the file from the response message, examines
the HTML file, and finds references to the 5 JPEG objects
6. The first 4 steps are then repeated for each of the
referenced JPEG objects

26-10'09 transport layer 21

You might also like