IP Datagrams
IP transmits data in packets called datagrams. A datagram
contains a header and some data, thus:
Note: this diagram shows the
datagram format of the "current" version of IP, IPv4.
Datagram Details
- The datagram header contains both the source and
destination IP addresses as well as various other administrative data.
This means that every datagram can be identified, in terms of "where it
came from" and "where it's going".
- Virtually all "real world" datagrams have a minimal length (20 byte)
header. Although various optional (extra) header fields are permitted,
these are rarely used in practice.
- Each network in the Internet is characterised by a Maximum
Transmission Unit (MTU), which defines the largest datagram
which can be sent on that network. Whilst the total length of a datagram
can (in theory) be up to 64 KB, "real world" MTU limits usually mean
datagrams are < 1500 bytes in total length.
- The data field contains "higher layer" protocol data--usually a TCP
segment[1] which IP is delivering across
the Internet. We say that the TCP segment is
encapsulated in an IP datagram. The TCP segment, in
turn, usually contains application protocol data in its
data field.
[1]
although not always: for example, see UDP, later in
this lecture.
IP Routing
There are two levels of complexity involved in IP routing:
- Local delivery
- when the IP software is presented
with a datagram for delivery, it first checks the network part of the
destination address to see if matches its own network number. If it
does, then the datagram can be delivered locally, and is simply handed
to the physical network delivery system (typically an Ethernet device
driver) for direct delivery over the local network.
- Internet delivery
- if the network numbers are
different, then the datagram must be forwarded to a router (or IP
gateway). In this case, the datagram is forwarded (using direct
delivery as above) to the appropriate router for on-delivery
- Datagrams cross gateways (routers) from network to network until
they reach a network where they can be locally delivered.
- The IP software must keep a routing table to know the IP
address of an appropriate router. This is commonly done by defining
a default route for each network machine.
- Note that routers must have (at least) two IP addresses!
IP: Connectionless Datagram Delivery
IP data transfer across an internet is based on three fundamental
principles:
- Unreliable delivery
- delivery
of data is not guaranteed. A packet of data may be lost in the network,
may be duplicated (ie: delivered twice) or may be delivered out of
order. The IP service will not detect such conditions, nor will it
notify the sender or receiver if they occur.
- Connectionless delivery
- each packet is treated
entirely indpendently of all others. No information is kept as to which
packets have been forwarded, and packets may travel over different
routes to the same destination.
- Best-Effort delivery
- the packet delivery
mechanism is engineered to always deliver packets if possible. It will
not gratuitously drop packets: unreliability should only occur when
underlying resources (eg buffer space) are exhausted.
These specifications allow the IP service to concentrate on its job:
delivering packets. As we have seen, higher level protocols (usually
TCP) transform the IP service into a reliable, sequenced interprocess
communications mechanism.
The Structure of the Internet
The Internet consists of networks
(or, more commonly nowadays -- subnets) connected by routers. The
traceroute
utility shows the path a datagram takes -- the
following traceroute
is from ironbark to the Victorian
Regional Network (VRN).
1 r-busbgo.bendigo.latrobe.edu.au (149.144.21.254) 1 ms 2 ms 1 ms
2 r-bgoatm34.bendigo.latrobe.edu.au (149.144.10.250) 1 ms 1 ms 1 ms
3 r-sctech-atm.latrobe.edu.au (131.172.239.3) 5 ms 4 ms 3 ms
4 cisco-ltu-fddi.latrobe.edu.au (131.172.20.12) 5 ms 4 ms 4 ms
5 vic-gw.vrn.EDU.AU (203.21.130.129) 4 ms 5 ms 4 ms
The Transport Layer Revisited: UDP
The User Datagram Protocol provides a connectionless alternative
transport service to TCP for applications where reliable stream service
is not needed. UDP datagrams can be droppped, duplicated or delivered
out of order, exactly as for IP.
The UDP transport service add to IP the ability to deliver a datagram to
a specified destination process using a port abstraction, in an
analogous way to that used by TCP.
Examples of applications where UDP is used include:
- Any application where loss of a datagram is not critical because later
datagrams will imply the missing information. Examples include:
- A "timekeeper" host sends the current "wallclock" time to a
slave host.
- Routers broadcast copies of their routing tables
every 30 seconds.
- An application process which performs its own error correction is
used.
- The reduced overhead of
connectionless operation suits some time-critical applications where
(occasional) loss of data may be unimportant. An example is voice
communications over the Internet.
The Future: IPv6
(Optional material)
The current version of IP is widely acknowledged to have many
shortcomings. To address these, the Internet Engineering Task
Force (IETF) has defined IP version 6[1]. Some of its features include:
- Addresses are now 128 bits in total length, instead of 32 bits in
IPv4. This is a huge increase!
- The address structure is
hierarchical, but is much more complicated than the simple "address
class" used in IPv4.
- Compatible with IPv4 for transition purposes.
- Support for a variety of "service types", etc.
[2] or, as it was called during its
development, IPng.
This lecture is also available in PostScript
format. The tutorial for this lecture is Tutorial #09.
[Previous Lecture]
[Lecture Index]
[Next Lecture]
Phil
Scott