Chapter 3 - Transport Layer
Chapter 3 - Transport Layer
Transport
Layer
different hosts
lo
gi
ca
transport protocols run in
enl
end systems
d-
en
send side: breaks app
d
tr
messages into
a
ns
segments, passes to
po
network layer
r
t
rcv side: reassembles applicatio
n
segments into transport
network
messages, passes to data link
physical
app layer
more than one transport
protocol available to apps
Internet: TCP and UDP
Transport Layer 3-3
Transport vs. network
layer household analogy:
network layer:
logical 12 kids in Ann’s house
communication sending letters to 12
kids in Bill’s house:
between hosts hosts = houses
transport layer: processes = kids
lo
network data link
gi
data link physical
flow control
ca
physical
network
l en
connection setup data link
d-
physical
en
unreliable, network
d
data link
tr
unordered delivery:
a
physical
ns
network
po
UDP data link
r
physical
t
network
no-frills extension of data link
physical
applicatio
n
“best-effort” IP network
data link transport
network
physical
services not data link
physical
available:
delay guarantees
bandwidth
guarantees Transport Layer 3-5
HTTP FTP TFTP
Web
Server
TCP
TCP
Email and
TCP TFTP
UDP Server
TCP
UDP
A single client might have multiple TCP or UDP connections with multiple servers
at the same time.
As the TCP perform handshaking , it is represented by a two ways arrow.
6
Segmentation and
•
Reassembly
An Ethernet frame has a maximum frame size or Maximum Transmission Unit (MTU)
of 1,518 bytes.
1500 – packet
size
8
Chapter 3 outline
3.1 transport-layer 3.5 connection-
services oriented transport:
3.2 multiplexing TCP
segment structure
and
demultiplexing reliable data transfer
flow control
3.3 connectionless connection
transport: UDP management
3.4 principles of 3.6 principles of
reliable data congestion control
transfer
3.7 TCP congestion
control
Transport Layer 3-9
Transport Layer
Functions
Prepares the data to be sent over the network layer.
Uses port number and sequence number to assemble and distinguish between
multiple application segments received at a device.
This also allows data to be multiplexed on the line.
Multiplexing/demultiplexing
host receives IP datagrams 32 bits
each datagram has source IP
address, destination IP address source port # dest port #
each datagram carries one
transport-layer segment
each segment has source, other header fields
destination port number
host uses IP addresses & port
numbers to direct segment to application
appropriate socket
data
(payload)
5004 – RTP
8080 – Alternate HTTP
Note: Some peer-to-peer file-sharing programs use these ports as Register Ports.
Client Server
Example : Establishing a Telnet
session
Telnet
Client TCP Header
4922 23
2
Telnet Data
21
Client Server
Telnet
Server TCP Header
23 49222
Telnet Data
C:\netstat -n
Destination Port Connection
Active Connections Source Port State
TCP
Proto Local Address Foreign Address State
or TCP 192.168.1.101:49888 198.133.219.25:80 TIME_WAIT
UDP TCP 192.168.1.101:49890 198.133.219.25:80 TIME_WAIT
23 Source IP Destination IP
Chapter 3 outline
3.1 transport-layer 3.5 connection-
services oriented transport:
3.2 multiplexing TCP
segment structure
and
demultiplexing reliable data transfer
flow control
3.3 connectionless connection
transport: UDP management
3.4 principles of 3.6 principles of
reliable data congestion control
transfer
3.7 TCP congestion
control
Transport Layer 3-24
UDP: User Datagram Protocol
[RFC 768]
“no frills,” “bare bones” UDP use:
Internet transport streaming
protocol
multimedia apps
“best effort” service,
UDP segments may be: (loss tolerant, rate
lost sensitive)
delivered out-of-order DNS
to app SNMP
connectionless: reliable transfer
no handshaking
between UDP sender, over UDP:
receiver add reliability at
each UDP segment application layer
handled application-specific
independently of error recovery!
others
length checksum
why is there a UDP?
no connection
application establishment (which
data can add delay)
(payload) simple: no connection
state at sender,
receiver
small header size
UDP segment format no congestion control:
UDP can blast away as
fast as desired
wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
L 8000 bits
Dtrans = R = 9 = 8 microsecs
10 bits/sec
U sender : utilization – fraction of time sender busy sending
U L/R .008
sender = = = 0.00027
RTT + L / R 30.008
U L/R .008
sender = = = 0.00027
RTT + L / R 30.008
U 3 L/R .0024
sender = = = 0.00081
RTT + L / R 30.008
window size
acknowledgements: N
seq # of next byte
expected from other
side sender sequence number space
User
types
‘C’
Seq=42, ACK=79, data = ‘C’
host ACKs
receipt of
‘C’, echoes
Seq=79, ACK=43, data = ‘C’ back ‘C’
host ACKs
receipt
of echoed
‘C’ Seq=43, ACK=80
300
(milliseconds)
RTT
250
RTT (milliseconds)
200
sampleRTT
150
EstimatedRTT
100
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
time Transport Layer 3-50
SampleRTT Estimated RTT
TCP round trip time,
timeout
timeout interval: EstimatedRTT plus “safety
margin”
large variation in EstimatedRTT -> larger safety margin
estimate SampleRTT deviation from EstimatedRTT:
DevRTT = (1-)*DevRTT +
*|SampleRTT-EstimatedRTT|
(typically, = 0.25)
SendBase=92
Seq=92, 8 bytes of data Seq=92, 8 bytes of data
timeo
ACK=100
ut
ut
X
ACK=100
ACK=120
SendBase=120
X
ut
ACK=120
cumulative ACK
Transport Layer 3-56
TCP ACK generation [RFC 1122, RFC
2581]
ACK=100
timeo
ACK=100
ut
ACK=100
ACK=100
Seq=100, 20 bytes of data
LAST_ACK
FINbit=1, seq=y
TIMED_WAIT can no longer
send data
ACKbit=1; ACKnum=y+1
timed wait
for 2*max CLOSED
segment lifetime
CLOSED
Application Header
i.e. (HTTP) header
or + data
68
Some types of data where errors can be tolerated might be send quickly.
TCP/IP Application Layer
Protocols
Application
Layer
Transport
Layer
Internet
Layer
Network
Access
Layer
LAN / WAN
70
Media
Independent
The Data Link layer prepares the IP packet for transmission over the
communications medium.
71
Summary: Port Numbers
Port Layer 4
Application Description
Number Protocol
20 FTP TCP File Transfer Protocol – Data