Subjects ->
Computer Networks ->
Lectures ->
Lecture #13
Lecture 13: IP Networks
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. The functions of the yellow-shaded header fields are
outside the scope of this subject -- see Data Communications if interested.
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".
- The TTL (Time to Live, or "hop count") field sets
a maximum number of routers which this datagram may traverse before
it's assumed to be "looping" and is discarded.
- Virtually all "real world" datagrams have a minimal length (20
byte) header. Although various optional (extra) header fields are
permitted, these are rarely observed in the Real World™.
- 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 or UDP segment which IP is delivering across the Internet. The
protocol field identifies which transport level
protocol data is being carried. We say that the TCP/UDP segment is
encapsulated in an IP datagram. The TCP/UDP
segment, in turn, usually contains application protocol data in
its data field.
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/subnet part of the destination
address to see if matches its own network/subnet number -- the
current netmask is used to discover if these
match. If the network/subnet part does match, 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
sent to a directly-connected router (or IP gateway), using
direct delivery as above, for "on-delivery" across the
Internet. Note that when the datagram is received at the
router, its destination IP address is not that of the
router.
- Datagrams are forwarded from router to router across each
of the intervening networks until they reach a router
connected to a network where they can be locally delivered.
- The IP software in each router must keep a routing
table to know the IP address of an appropriate
next-hop router which brings the datagram closer to its
destination.
- Note that routers must have (at least) two IP addresses,
since they are connected to (at least) two different
networks/subnets!
IP Routing
Hosts and routers maintain a routing table which is
consulted when a datagram cannot be locally delivered. The routing
table indicates which router, of those available, is the best
next hop for the destination network address of this
particular datagram. For hosts, this is commonly done by configuring a
default route, since only one router is usually
available.
Where the network is more complex (for example, a router can be
connected to several other routers) a routing protocol
is used to maintain the routing tables. Routing protocols operate by
sending routing updates to each of their neighbour
routers, informing them of routes which this router "knows about", and
with some indication of how "close" it is to the other networks -- this
is called a metric. Route information which has been
received at a router will be propagated to the next router, and so on.
Routers make decisions as to which route is the one they will use,
based on the routing metric information.
Different routing protocols are used within Autonomous Systems
(AS) -- typically organisation-level networks -- and the
various high-speed intercontinental and international
backbone networks which make up the "heavy haulage"
sections of the Internet. Within an AS, the original routing protocol
was RIP, nowadays largely replaced by
OSPF. On the backbones, the original protocol was
EGP, now replaced by BGP (strictly
speaking, BGP4).
Detailed analysis of routing protocol operation is outside the scope of
this subject, see Data Communications
and Internetworking.
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 datagram may be lost
(dropped, discarded, etc) 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
Private IP Addresses/Networks
(This is Optional Material)
These are an interesting development in Internetworking. IP addresses
have recently become more difficult to obtain, and therefore more
expensive. Many organisations (and home users!) have moved to a
private address space for their "internal" networks --
ie, networks consisting of machines which do not require globally-valid
IP addresses. This has advantages both in terms of cost and security
(see later).
RFC1918 specifies a range of addresses: 10.0.0.0
,
172.16.0.0 - 172.31.255.255
and
192.168.0.0 - 192.168.255.255
which can be used for
this purpose. No IP addresses in these three ranges are ever valid in
the Internet (ie, an Internet router should never forward them), and
may only be used within private networks.
A variety of technologies are available to allow "internal" (private IP)
machines to gain access to services in the outside Internet. The two
most common are Network Address Translation (NAT) and
SOCKS. For "Web-only" access, an HTTP proxy server can
be used.
The Future: IPv6
(This is 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.
The tutorial for this lecture is
Tutorial #13.
[Previous Lecture]
[Lecture Index]
[Next Lecture]
Copyright © 2005 by
Philip Scott,
La Trobe University.