Professional Documents
Culture Documents
Lecture 11
CHAPTER 3
th
26 October, 2021
Nauman Moazzam Hayat
nauman.moazzam@lhr.nu.edu.pk Office Hours:
our goals:
❖ understand services:
principles behind ▪ multiplexing,
transport layer demultiplexing
▪ reliable data transfer ▪ UDP: connectionless
▪ flow control transport
▪ congestion control ▪ TCP: connection-oriented
❖ learn about Internet reliable transport
transport layer protocols: ▪ TCP congestion control
Chapter 3 outline
3.5 connection-oriented
3.1 transport-layer transport: TCP
services ▪ segment structure
3.2 multiplexing and ▪ reliable data transfer
demultiplexing ▪ flow control
▪ connection management
3.3 connectionless
3.6 principles of congestion
transport:
control
UDP
3.7 TCP congestion control
3.4 principles of reliable
data transfer
Transport Layer 3-3
delivery.
Transport vs. network layer
between hosts
❖ network layer:
❖ transport layer:
logical
logical
communication
communication ❖ hosts = houses
❖ processes = kids
between processes ❖ app messages = letters in
▪ relies on, enhances, envelopes
network layer ❖ transport protocol = Ann
❖ reliable,
data link
▪ congestion
in-order physical network
▪ flow control
physical
network data link
▪ connection setup
physical network data
link physical
network
❖ unreliable, unordered data link
delivery: UDP
▪ no-frills extension guarantees
❖ services not physical
of “best-effort” IP network data link
▪ bandwidth
Transport Layer 3-8
Chapter 3 outline
transport:
3.1 transport-layer UDP
services 3.4 principles of reliable
3.2 multiplexing and data transfer
demultiplexing 3.5 connection-oriented
3.3 connectionless transport: TCP
▪ segment structure 3.6 principles of congestion
▪ reliable data transfer control
▪ flow control 3.7 TCP congestion control
▪ connection management
Port
- Port is a transport layer address / identifier to choose
among the multiple processes running among the same
host
- The server side ports are not random but well known and
pre assigned
multiplexing at sender:
demultiplexing at receiver: handle data from multiple
sockets, add transport header (later use header info to deliver received
used for demultiplexing) segments to correct socket
application
n P4
transport transport
network network transport
link link network
application
physical physical link
P3 P1 P2
applicatio physical
socket
proces
s
How datagrams
demultiplexing
works 32 bits
❖ host receives IP
▪ each datagram has source IP address, destination IP
address header fields
▪ each datagram carries one
transport-layer segment
application
▪ each segment has source,
data
destination port number (payload)
❖ host uses IP addresses &
port numbers to direct TCP/UDP segment format
segment to appropriate
socket
source port # dest port # other
❖ recall:
created socket has
host-local port #:
❖ whenhost receives UDP
DatagramSocket mySocket1
= new segment:
DatagramSocket(12534);
▪ checks destination port #
❖ recall:
when creating in segment
datagram to send into ▪ directs UDP segment to
UDP socket, must specify ▪ socket with that port #
destination IP address (thus UDP socket identified by 2-tuple: •
dest IP address
▪ destination port # • dest port number)
and/or source port
IP datagrams with same numbers will be directed
dest. port #, but different to same socket at dest
source IP addresses
Transport Layer 3-13
DatagramSocket
DatagramSocket network application
mySocket2 = new link P1
DatagramSocket physical
(9157); serverSocket transport
P3 DatagramSocket link
physical
transport
(6428);
application link
DatagramSocket
mySocket1 = new P4
DatagramSocket
transport physical
(5775);
network
sour source port: ?
ce dest port: ?
port:
source port: 6428
9157 dest dest source port: ?
port: 6428 port: dest port: ?
9157
Connection-oriented demux
▪ source IP address
❖ TCP socket identified ▪ source port number
by 4-tuple:
▪ dest IP address ▪ each socket identified by
▪ dest port number its own 4-tuple
❖ demux: receiver uses all ❖ web servers have
four values to direct different sockets for
segment to appropriate each connecting client ▪
socket non-persistent HTTP will
❖ server host may support have different socket for
many simultaneous TCP each request
sockets:
P3 P3
transport
P2
source IP,port: B,80 physical
transport
network
network
link
link
physical
physical host: IP
server: IP address C
address B
transport
network
dest IP,port: A,9157 host: IP
link
address A
source IP,port: A,9157
dest IP, port: B,80 IP,port: B,80
source IP,port: C,5775 dest
IP,port: B,80 source IP,port: C,9157 dest
three segments, all destined to IP address:
B, dest port: 80 are demultiplexed to
Transport Layer 3-16
different sockets
threaded server
application
application P3 P2
P3
P4
application transport
source IP,port: B,80
transport
network
network
link
dest IP,port: A,9157 host: IP
link
physical
physical
server: IP physical address C
address B
transport
network
host: IP
link
address A source IP,port: C,5775 dest
IP,port: B,80
source IP,port: source IP,port: C,9157 dest
A,9157 dest IP, port: B,80 IP,port: B,80
Chapter 3 outline
32 bits
source port # dest port # length
UDP segment format
checksum length, in bytes of
UDP segment,
including header
application
data why is there a UDP?❖ no
(payload)
connection
establishment (which can add header size
delay) ❖ no congestion control: UDP
❖ simple: no connection state can blast away as fast as
at sender, receiver ❖ small desired
UDP checksum