Typically an API
embedded in Operating System.
Berkeley UNIX sockets
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.
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 has to manage:
- acks (or lack of ack)
- and hide this from higher layer
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.
(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.
is Network layer (does the routing). IP packets.
IP is unreliable (may lose packets).
TCP provides reliable, connection-oriented service on top of IP.
- acks of IP packets
- timers and timeouts
- 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:
- telnet, ssh
- SMTP, POP3
Internet protocol stack
UDP - alternative Transport layer for Internet.
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.
can use TCP, but mostly uses UDP.
- Online multiplayer games
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).
Similar algorithms may be used on higher-level objects
to provide a reliable service in
(i.e. across entire network).
More difficult because instead of a single line (a)
the entire network is now in the way (b):
Note port nos.
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.
is quite weak
This is ok since CRC probably also used in Data Link layer
Normal communication sessions
have error-checking in both Data Link and Transport layers.