Transport Layer
Typically an API
embedded in Operating System.
e.g.
Berkeley UNIX sockets
First true
end-to-end
layer.
What defines boundary of Transport and Network layers
is that Transport code runs only on user machines, not on routers.
Boundary of Network layer
is boundary of what routers need to run.
Quality of service:
-
Often quality of service provided by Network layer
is out of our control
- because it involves Network layer on many routers
across the Internet, which we do not own
(the carriers own them).
These have errors, lose packets, crash, etc.
To deal with poor service, we can't change Network layer
- We don't own those machines.
Our only option is to put a further layer on top of
Network layer to try to improve quality of service.
-
Transport layer
tries to provide reliable service
to Application layer.
Transport service can be more reliable than
underlying Network service.
Unreliability of Network service is hidden from higher layer.
-
This is what we mean when we said previously that
error-recovery can be done in higher
(Transport) layer.
e.g. TCP.
Transport layer has to manage:
- acks (or lack of ack)
- timers
- re-transmits
- and hide this from higher layer
API:
-
Transport layer
provides API
for application programmers.
Library calls are independent of the underlying network.
Application-layer code should work on many different networks.
-
Transport is the real boundary of the layered model,
the first one that really hides the network from higher layers.
Layers 1-4 - "transport service provider"
Higher layers - "transport service user"
Transport Protocol Data Unit (TPDU)
What transport layers send to each other.
Contains the "real" data of the communication.
Remember discussion of
packet and frame.
TPDUs
(exchanged by transport layer)
are contained in packets
(exchanged by network layer)
which are contained in frames
(exchanged by data link layer).
Internet protocol stack:
TCP - Transport layer for Internet.
IP
is Network layer (does the routing). IP packets.
IP is unreliable (may lose packets).
TCP provides reliable, connection-oriented service on top of IP.
Provides:
- acks of IP packets
- timers and timeouts
- re-transmits
- re-ordering of packets into correct sequence at receiver
before passed to higher layer
(have to wait for missing packet before send all up to higher layer
- we may not want this wait - e.g. media stream)
Applications that use TCP:
- HTTP
- FTP
- telnet, ssh
- SMTP, POP3
Internet protocol stack:
UDP - alternative Transport layer for Internet.
Unreliable, connectionless.
No acks and re-transmits.
Faster, but may lose packets, or get damaged packet,
and packets may arrive out of order.
But much faster.
Applications that use UDP, not TCP:
- Streaming media, e.g.
RealAudio and RealVideo.
Often, streaming client uses its own error-checking
to compensate for lost/damaged data.
RTP
can use TCP, but mostly uses UDP.
- VoIP
- Online multiplayer games
- DNS
Usage
As at c.2002, c.95% of all Internet packets were TCP, c.5% UDP, less than 1% other.
UDP use (video, audio streams, VoIP, online games) growing since,
but TCP use (TCP file sharing, TCP torrents,
HTTP video streaming, YouTube)
also growing since.
6.2 Transport protocols
We saw previously
algorithms for
acks, re-transmits and flow control
used on frames
in Data Link layer
(i.e. across a single physical link).
See
here
and
here.
Similar algorithms may be used on higher-level objects
to provide a reliable service in
Transport layer
(i.e. across entire network).
More difficult because instead of a single line (a)
the entire network is now in the way (b):
6.5 TCP
TCP header.
See meaning.
Note port nos.
Uses
sliding window
protocol.
Initially go back n.
More recently selective repeat.
Note seq and ack.
These refer to next byte expected.
Every byte is numbered
0 .. n (and then repeat)
in the TCP byte-stream.
n = 232-1 = 4 billion.
TCP checksum
(explained here)
is quite weak
(not CRC).
This is ok since CRC probably also used in Data Link layer
(e.g. PPP
and Ethernet).
Normal communication sessions
will
have error-checking in both Data Link and Transport layers.