contains a detailed
description of how IP performs routing.
1.3.2. IP host addresses
The internet protocol identifies hosts with a
number called an IP
address or a host address. To avoid
confusion with MAC addresses (which
are
machine or station addresses), the term IP
address will be used to designate this kind of address. IP addresses
come in two flavors: 32-bit IP Version 4 (IPv4) or 128 bit IPv6
address. We will talk about IPv6 addresses later in this chapter. For
now, we will focus on IPv4 addresses. IPv4 addresses are written as
four dot-separated decimal numbers between 0-255 (a dotted quad):
192.9.200.1
IP addresses must be unique among all connected machines. Connected
machines in this case are any hosts
that you can get to over a network or connected set of networks,
including your local area network, remote offices joined by the
company's wide-area network, or even the entire Internet
community. For a standalone system or a small office that is not
connected (via an IP network) to the outside world, you can use the
standard, private network addresses assigned such purposes. See Section 1.3.3, "IPv4 address classes" later in this chapter. If
your network is connected to the Internet, you have to get a range of
IP addresses assigned to your machines through a central network
administration authority, via your Internet Service Provider. If you
are planning on joining the Internet in the future, you will need to
obtain an address from your network service provider. This may be
either an actual provider of Internet service, or your own
organization, if it has addresses to hand out. We won't go into
this further in this book.
The IP address uniqueness requirement differs from that for MAC
addresses. IP addresses are unique only on connected networks, but
machine MAC addresses are unique in the world, independent of any
connectivity. Part of the reason for the difference in the uniqueness
requirement is that IPv4 addresses are 32 bits, while MAC addresses
are 48 bits, so mapping every possible MAC address into an IPv4
address requires some overlap. There are a variety of reasons why the
IPv4 address is only 32 bits, while the MAC address is 48 bits, most
of which are historical.
Since the network and data link layers use different addressing
schemes, some system is needed to convert or map the IP addresses to
MAC addresses. Transport-layer services and user processes use IP
addresses to identify hosts, but packets that go out on the network
need MAC addresses.
The
Address Resolution Protocol (ARP) is used to convert the 32-bit IPv4
address of a host into its 48-bit MAC address. When a host wants to
map an IP address to a MAC address, it broadcasts an ARP request on
the network, asking for the host using the IP address to respond. The
host that sees its own IP address in the request returns its MAC
address to the sender. With a MAC address, the sending host can
transmit a packet on the Ethernet and know that the receiving host
will recognize it.
A host can have more than one IP address. Usually this is because the
host is connected to multiple physical network segments (requiring
one network interface, such as an Ethernet controller, per segment),
or
because
the host has multiple interfaces to the same physical network
segment.
1.3.3. IPv4 address classes
Each IPv4 address has a network number and a
host number. The
host number identifies a particular
machine on an organization's network. IP addresses are
divided
into classes that determine which parts of the
address make up the network and host numbers, as demonstrated in
Table 1-2.
Table 1-2. IPv4 address classes
Address Class and First Octet Value |
Network Number Octets |
Host Number Octets |
Address Form |
Number of Networks |
Number of Hosts per Network |
Maximum Number of Hosts per Class |
Class A: 1-126 |
1 |
3 |
N.H.H.H |
126 |
2563 - 2 |
2,113,928,964 |
Class B: 128-191 |
2 |
2 |
N.N.H.H |
16,384 |
2562 - 2 |
1,073,709,056 |
Class C: 192-223 |
3 |
1 |
N.N.N.H |
2,097,152 |
254 |
532,676,608 |
Class D: 224-239 |
N/A |
N/A |
M.M.M.M |
N/A |
N/A |
N/A |
Class E: 240-255 |
N/A |
N/A |
R.R.R.R |
N/A |
N/A |
N/A |
Each N represents part of the network number and
each H is part of the address's host
number. The 8-bit octet has 256 possible values, but 0 and 255 in the
last host octet are reserved for forming broadcast addresses.
Network numbers with first octet values of 240-254 are reserved for
future use. The network numbers 0, 127, 255, 10, 172.16-172.31, and
192.168.0-192.168.255 are also reserved:
Note that there are only 126 class A network numbers, but well
over two million class C network
numbers. When the Internet was founded, it was almost impossible to
get a class A network number, and few organizations (aside from
entire networks or countries) had enough hosts to justify a class A
address. Most companies and universities requested class B or class C
addresses. A medium-sized company, with several hundred machines,
could request several class C network numbers, putting up to 254
hosts on each network. Now that the Internet is much bigger, the
rules for class A, B, and C network number assignment have changed,
as explained in Section 1.3.4, "Classless IP addressing".
Class D addresses look similar to the other classes in that each
address consists of 4 octets with a value no higher than 255 per
octet. Unlike classes A, B, and C, a class D address does not have a
network number and host number. Class D addresses are multicast
addresses, which are used to send messages to more than one recipient
host, whereas IP addresses in classes A, B, and C are unicast
addresses destined for one recipient. Multicast on the Internet
offers plenty of potential for efficient broadcast of information,
such as bulk file transfers, audio and video, and stock pricing
information, but has achieved limited deployment. There is an ongoing
experiment known as the "MBONE" (Multicast backBONE) on
the Internet to exploit this
technology.
Class E addresses are reserved for future assignment.