IP Addressing
An IP Address is a number
that uniquely identifies a TCP/IP host on the Internet or on an Intranet. Host
in the parlance of TCP/IP means any machine with a network interface or other
communication device configured to use a TCP/IP network. An IP address
is a logical address and is not intrinsically tied to any specific hardware until
assigned. A computer may have one or more assigned IP addresses depending on the number of
installed network interfaces, or the capability of the software that implements the
protocol stack. IP addresses were designed to unambiguously specify both the address of a
network device and the address of the network to which the device is attached. All IP
addresses have two parts: network ID and host ID. However the number of bits used for each
address varies according to a complex set of rules for the purpose of allowing flexibility in addressing.
Physical (MAC) Address
The fixed "hardware" address of a computer is the address(s) encoded in
firmware on the NIC(s)
(Network Interface Card(s)) found in the computer. A computer may have one or more
fixed (or physical or hardware) addresses if it has more than one NIC. At the physical
layer of a network, any device on the network must communicate using a physical address. A
physical address is also called a hardware address or a MAC (media access control)
address. Ethernet networks employ a 48 bit physical address.
Terminology: A Media Access Control address is another way of saying any of the
following: fixed address, firmware address, hardware address, physical address, MAC
address, NIC address.
If a computer uses another method, other than a network adapter with a physical address,
to connect to the network, the connection must be made through a communications device
that will convert a given communications signal to the signal used on the native media
employed by that network's network adapters. In this case, the computer without a physical
address can only communicate to the network by virtue of the fact that it communicates
through a communications device that does have a physical address.
The IEEE (Institute of Electrical
and Electronics Engineers) allocates a 24 bit vendor code to each manufacturer of an
Ethernet network interface adapter. The manufacturer is responsible to see that those 3
bytes or octets, which represent the unique identifying code for the manufacturer, is the
first 24 bits of every 48 bit address that the manufacturer allocates to any network
interface adapter it makes. The second 24 bits is a unique identifier for each device
manufactured. This guarantees that no two manufacturers will allocate the same hardware
address to a network interface adapter. These 48 bits are written as 6 bytes in
hexadecimal notation with dashes between each byte.
When reading this, about IP addressing, if you have any questions about binary,
hexidecimal and decimal numbering and their relationships, you should read this.
|
IP addresses (IPv4) are typically written in the decimal number system and the Ethernet
address is generally written in the hexadecimal number system. These are representations
of the binary values used by network devices. Each field in either address represents 8
binary digits. While they are distinctly different methods of addressing a computer, both
are needed to communicate using TCP/IP protocols on an Ethernet LAN. The most important
use of an IP address, however, is for routing. Routing is the method by which separate
networks can talk. A router is a device that
connects two independent LANs. A router is a host (at least dual ported if not
multiported--which is to say that a router has more than one IP address, one for a local
segment and some number of others to talk to remote segments.) When a client node wishes
to connect to a server on a remote network, the connection is made through the router.
Quite simply, TCP/IP protocols contain a number of methods used to provide, record, store,
retrieve and catalog IP addresses. There is no uniform parallel for physical addresses.
The method whereby a host discovers the address of a destination host and the network path
that will be followed is called address resolution. Address resolution permits a host
address to be discovered without user input. TCP/IP protocols employ IP addresses to
determine if information packets should remain only on the originating network or if the
information packets should be transmitted to a remote network. There are no common
protocols defined that act to allow physical addresses to be employed for this work.
TCP/IP is a common protocol employing logical addresses that can be implemented on a wide
variety of platforms.
The Format of an IP address
An IP address is an assembly of bits. This address can be represented in binary,
hexadecimal, or decimal format, but typically it is represented as dotted decimal
notation. An IP address (IPv4) is 32 bits long and can be represented as 4 bytes or 4
octets of 8 bits each. Most often, an IP addresses is assigned or configured in decimal
format, but occasionally, it must be recognized in hexadecimal format. This is how an IP
address (IPv4) operates at the machine level using binary encoding. In this case of "dotted
decimal notation", the four octets are each represented by a decimal number
and each number is separated by decimal points. Each octet can have a decimal value
between 0 and 255.
|
The distinguishing characteristics of a class address are the number of octets that define
a class network ID and the value of the high order bits in the first octet. A Class A
address always has the high order bit of the first octet set to zero (0) and the network
ID for a unique class A network is discovered in the first octet. A Class B address always
has the first two high order bits of the first octet set to one and zero respectively
(10), and the network ID for a unique class B network is discovered in the first two
octets. A Class C address always has the first three high order bits of the first octet
set to one, one and zero respectively (110), and the network ID for a unique class C
network is discovered in the first three octets. The demarcating zero in each case is a
delimiter which announces that the class has been defined, and that the remaining values
that distinguish one network from another in that class follow in the number of bits
(remaining in the specified number of octets) allocated for that
class. Looked at another way, the Class designation reserves some number of bits for a
Network ID and uses the remainder of the 32 bit address for a Host ID.
Table 2:
| Class |
|
Prefix |
|
Network Number |
|
Host Numnber |
| A |
|
0 |
|
Bits 1-7 ( 7 bits) |
|
Bits 8-31 (24 bits) |
| B |
|
10 |
|
Bits 2-15 (14 bits) |
|
Bits 16-31 (16 bits) |
| C |
|
110 |
|
Bits 3-23 (21 bits) |
|
Bits 25-31 ( 8 bits) |
| D |
|
1110 |
|
N/A |
|
|
| E |
|
1111 |
|
N/A |
|
|
|
Comparing the table above with the previous table, we can deduct the method employed to
discover the number of networks and the number of hosts available for a given IP network
address. We'll have a brief look at this now and return to it later.
Table 3:
| Class |
|
Number of Networks |
|
Number of Hosts |
| A |
: |
27 |
= |
126 * |
|
224 - 2 ! |
= |
16,777,214 |
| B |
: |
214 |
= |
16,384 |
|
216 - 2 ! |
= |
65,534 |
| C |
: |
221 |
= |
2,097,152 |
|
28 - 2 ! |
= |
254 |
| |
* The addresses 0 and 127 are not used for Class A
! No host address can consist of all 0's or all 1's
- a grand total of 2,113,928,964 unique host IP addresses
|
|
Note that no Host ID's can consist of all zeros nor can any Host ID consist of all ones.
These addresses are reserved for special addresses. A host ID of all zeros is considered
to be the address of a network. A host field with all ones in it is considered to be a
broadcast address. Hence, we remove host addresses that consist of all zeros or all ones
from the range of available addresses for hosts. There are just two of these for each
class and so the formula for discovering the number of hosts available on a network is 2n
- 2, where n is the number of bits available for the Host ID.
A class "A" address is assigned to very large networks with a large number of
host computers on the network. It provides 24 bits to define the number of hosts with a
Host ID on a given class A network. There are only 126 class A networks available. In this
day of Network growth, you can expect that there are none left to be allocated by the
InterNIC. Each of the 126 Class A networks can address 16,777,214 (over 16 million) unique
host IDs per network. The range of these networks is annotated by substituting letters for
possible host IDs. The range of a class A address can be stated as the networks from
1.x.y.z to 126.x.y.z inclusive. In most cases, you can expect that an organization that
has been allocated a Class A address will further divide the network using a practice
called subnetting. Subnetting allows a single IP address to be segmented to accommodate
more than one network segment. Subnetting is applied to all classes for this purpose.
A class B address provides 16 bits to define the number of hosts with a Host ID on a
given class B network. A class B address defines 16,384 networks that can each support up
to 65,534 hosts per network. The range of a class B address can be stated as the networks
from 128.0.y.z to 191.255.y.z inclusive.
A class C address provides 8 bits to define the number of hosts with a Host ID on a
given class C network. A class C address defines 2,097,152 networks that can each support
up to 254 hosts per network. The range of a class C address can be stated as the networks
from 192.0.0.z to 223.255.255.z inclusive.
Table 4:
| Examples of Class Addresses |
| Class |
1st Octet |
2nd Octet |
3rd Octet |
4th Octet |
Network ID |
| Class A |
0 0000001 |
xxxxxxxx |
yyyyyyyy |
zzzzzzzz |
1.x.y.z |
| 0 0000010 |
xxxxxxxx |
yyyyyyyy |
zzzzzzzz |
2.x.y.z |
| 0 0000011 |
xxxxxxxx |
yyyyyyyy |
zzzzzzzz |
3.x.y.z |
| 0 1111101 |
xxxxxxxx |
yyyyyyyy |
zzzzzzzz |
125.x.y.z |
| 0 1111110 |
xxxxxxxx |
yyyyyyyy |
zzzzzzzz |
126.x.y.z |
| |
| Class B |
10 000000 |
00000001 |
yyyyyyyy |
zzzzzzzz |
128.1.y.z |
| 10 000000 |
00000010 |
yyyyyyyy |
zzzzzzzz |
128.2.y.z |
| 10 000000 |
00000011 |
yyyyyyyy |
zzzzzzzz |
128.3.y.z |
| 10 000001 |
00000001 |
yyyyyyyy |
zzzzzzzz |
129.1.y.z |
| 10 000001 |
00000010 |
yyyyyyyy |
zzzzzzzz |
129.2.y.z |
| 10 111111 |
00000001 |
yyyyyyyy |
zzzzzzzz |
191.1.y.z |
| 10 111111 |
11111111 |
yyyyyyyy |
zzzzzzzz |
191.255.y.z |
| |
| Class C |
110 00000 |
00000000 |
00000001 |
zzzzzzzz |
192.0.1.z |
| 110 00000 |
00000000 |
00000010 |
zzzzzzzz |
192.0.2.z |
| 110 00000 |
00000001 |
00000001 |
zzzzzzzz |
192.1.1.z |
| 110 00000 |
00000010 |
00000001 |
zzzzzzzz |
192.2.1.z |
| 110 11111 |
11111111 |
11111111 |
zzzzzzzz |
223.255.255.z |
Class D addresses are reserved for multicasting. Multicasting
is a delivery of a single packet to multiple specified destinations. Only hosts that have
been registered to receive the multicast address will accept the packet. Class D addresses
have the high order bits of the first octet set to 1110nnnn. Class D addresses cannot be
assigned to hosts. Multicasting is meant to be a more efficient method of reaching
multiple hosts than Broadcasting. If an IP datagram is broadcast to a subnet, every host
on the subnet will receive it, and have to process it, to determine whether the target
protocol is active. If it is not, the IP datagram is discarded. Multicasting avoids this
overhead by using groups of IP addresses. Each group is represented by a 28-bit number,
which is included in a Class D address. The first four bits of a multicast IP address
contain the class identification bits. The 28 bits that follow are the multicast address.
Multicast group addresses are IP addresses in the range 224.0.0.0 to 239.255.255.255.
For each multicast address there is a set of zero or more hosts which are listening to
it. This set is called the host group. There is no requirement for any host to
first be a member of a group in order to send to that group. There are two kinds of host
group: permanent and transient. For permanent host groups, the IP address is permanently
assigned by IANA. The membership of a host group is not permanent; a host may leave or
join the group at will. The list of IP addresses assigned to permanent host groups is
included in STD 2 - Assigned Internet Numbers (AIN) Some of the important permanent host
groups are listed in the Multicast Address Examples below (with the AIN acronym.) A
permanent group exists even if it has no members.
Any group which is not permanent is transient and is available for dynamic assignment
as needed. Transient groups cease to exist when their membership drops to zero. To join a
multicasting host group on a single segment physical network, a process running on a host
must somehow inform its network device drivers that it is wishes to be a member of the
specified group. The device driver software itself must map the multicast address to a
physical multicast address and enable the reception of packets for that address. The
device driver must also ensure that the receiving process does not receive any spurious
datagrams by checking the destination address in the IP header before passing it to the IP
layer.
The basic explanation of IP addresses in this document exposes the rules of IPv4
address space first deployed in 1983. There are two types of IP addresses in active usage:
IPv4 and IPv6. IPv6 was first deployed in 1999. Theoretically, there are 232
host addresses (4.3 billion) under IPv4, but in practice, the rules for how addresses are
formed, and the rules for how addresses are used, reduces the number considerably.
This limitation is recognized and addressed by IPv6. IPv6 employes 128 bit numbers
for IP addresses instead of the 32 bit numbers employed by IPv4. Under IPv6, this works
out to about 1.8 x 1023 addresses for every square foot of land
on earth. This ought to hold us for awhile. Authority
for assignment of IP addresses is delegated.
There are three basic ways for a sender to
transmit identical data to multiple receivers: broadcast , multiple
unicast, and multicast.
These methods address the issue of mass distribution of information. We talked about
multicasting above. Essentially, Unicast communications are the traditional one message to
one destination from one source type; here a source node sends the same message over and
over again until all destinations have been reached.
Broadcast communications originate one message from one source and the message is
delivered to every host on a network. This is more efficient but it ties up every node in
the network with a message whether or not every node needs to get the message.
Multicast messages on a local network segment are less problematic than attempting to
multicast messages across routers. Some routers do not support forwarding of multicast
packets. Multicast has the benefit of not transmitting packets on network segments that
have no designated recipients, yet like a broadcast it transmits a single data stream to
multiple receivers.
Any protocol which is connectionless may send broadcast or multicast messages as
well as unicast messages. A protocol which is connection-oriented can only use
unicast addresses because the connection exists between a specific pair of hosts.
Table 5:
| Special IP Addresses |
| Network Fields |
Host Fields |
Description |
| IP_address |
all 1's |
Broadcast message to all devices at the Network IP address. This is also called the network-directed
broadcast address or the subnet-directed broadcast address. If the network
number is a valid network number, the network is not subnetted, and the host number is all
ones (for example, 128.2.255.255), then the address refers to all hosts on the specified
network. Routers should forward these broadcast messages unless configured otherwise. This
is used in ARP requests for unsubnetted networks. For a subnetted network, if the network
number is a valid network number, the subnet number is a valid subnet number and the host
number is all ones, then the address refers to all hosts on the specified subnet. Because
the sender's subnet and the target subnet may have different subnet masks, the sender must
somehow find out the subnet mask in use at the target. The actual broadcast is performed
by the router which receives the datagram into the subnet. Another possibility is the all-subnets-directed
broadcast address. If the the network number is a valid network number, the network is
subnetted and the local part is all ones (for example, 128.2.255.255), then the address
refers to all hosts on all subnets in the specified network. In principle routers may
propagate broadcasts for all subnets but are not required to do so. In practice, they
do not; there are few circumstances where such a broadcast would be desirable, and it
can lead to problems, particularly if a host has been incorrectly configured with no
subnet mask. Consider the wasted resource involved if a host 9.180.214.114 in the
subnetted Class A network 9 thought that it was not subnetted and used 9.255.255.255 as a
``local'' broadcast address instead of 9.180.214.255 and all of the routers in the network
respected the request to forward the request to all clients. If routers do respect
all-subnets-directed broadcast address, they use an algorithm called Reverse Path
Forwarding to prevent the broadcast messages from multiplying out of control. |
| all 1's |
all 1's |
Broadcast message to all devices on "THIS" network. That is the broadcast
message will never leave the current segment. This can only be a destination address--it
makes no sense for it to ever be a source address. This is also called the limited
broadcast address, 255.255.255.255 (all bits are1 in all parts of the IP address) The
limited broadcast message is used to send a single message which is received by all hosts
on the subnet. It does not require the host to know any IP configuration information at
all. All hosts on the local network will recognize the address, but routers will never
forward it. There is one exception to the "routers-will-never-forward-it" rule,
called BOOTP forwarding. The BOOTP protocol uses the limited broadcast address to
allow a diskless workstation to contact a boot server. BOOTP forwarding is a configuration
option available on some routers. |
| all 0's |
IP_address |
A source address used when the source does not yet know its network IP address. This
form never applies to a destination address. |
| all 0's |
all 0's |
The address of "this" host on "this" network, that is, the host is
referring to itself on its own network. |
| IP address |
all 0's |
The IP address of a network |
| 127 |
any value |
This is called the LoopBack address. It is used for communication between processes on
the same computer. A packet with this destination address never leaves the source
computer. This address is used for testing internal connectivity. |
Broadcast Addresses
The broadcast address is the address to which devices send packets meant for all other
devices. All devices "listen" for broadcasts in addition to their own address.
Address Resolution Protocol (ARP) packets and routing information are examples of packets
sent to the broadcast address. Most often, the broadcast address is the last address in
the network (or subnet), with the host portion being all 1's binary (some networks use
0.0.0.0 or 255.255.255.255, however). Below are some examples of broadcast addresses.
Table 6:
| Broadcast Addresses |
| Class |
Network |
Subnet Mask |
Broadcast Address |
| A |
42.0.0.0 |
255.0.0.0 |
42.255.255.255 |
| B |
129.143.0.0 |
255.255.0.0 |
129.143.255.255 |
| C |
199.31.12.0 |
255.255.255.0 |
199.31.12.255 |
| A * |
45.21.16.0 |
255.255.252.0 |
45.21.19.255 |
| B * |
198.41.9.64 |
255.255.255.224 |
198.41.9.95 |
The first three entries are traditional Class A, B, and C network addresses and use
traditional masks. This is usually all that you are shown for broadcast examples and every
body expects that the host ID's for broadcasts will be discovered as FFh entries or 255
entries in the IP address. But this is a world where subnetting occurs and the number of
bits in a Host ID are not always going to be 8 bits. After you read about subnetting, come
back to this explanation. The last two entries in this table are not the usual examples
given for broadcast addresses. The fourth entry shows a legitimate Class A broadcast
address where the last three octets are not all 1's because of borrowed bits given to a
subnetwork. Furthermore, the third octet contains a value that covers both the Subnet ID
and the required 1's in the host ID portion of the third octet for the broadcast
requirement. Entries 4 and 5 could be "real world"; examples. The fifth entry
shows a Class C subnetted address and while there is not 255 entry, nevertheless, the Host
ID still is composed entirely of 1's making this a broadcast address. Don't be fooled.
Class E addresses have been reserved for future use and experimental purposes.
Class E addresses have the high order bits of the first octet set to 11110nnn.
Class E addresses cannot be assigned to hosts.
Class addressing is not the only method of IP addressing. We take a brief side trip
before returning to class based addressing. In the growing internet world, 32 bit IP
addressing is not enough for the expanding number of users with computers who want
connectivity.
It appears that there are many more computers to network than there are network addresses.
A new network is connected to the Internet every 30 minutes.
Several stopgap measures to avoid running out of addresses have been introduced; new IP
addressing schemes have been proposed and are under consideration (IPv6.)
In general, the use of Internet Service Providers is a primary method of distributing
the available addresses. ISP's either dynamically allocate IP addresses or assign an IP
address to a customer from the block of addresses given to the ISP by the InterNIC. The
problem with volume is not only IP addresses for the very large number of computers that
want to connect to the Internet. Routing
tables are also growing at unprecedented rates. Routing tables are now 30 times the size
that they were 10 years ago and they require that the amount of memory devoted to those
tables be increased accordingly. 30 times is a very large growth for memory indeed. New Inter-domain Routing
paradigms are needed. One method of reducing the load on routing tables is to use
an IP addressing scheme called CIDR (Classless Inter-Domain
Routing.) or supernetting. CIDR does not recognize the
class of an IP address as indicated by the high order bits of the address; instead it uses
a variable length network identifier similar to a subnet
mask. CIDR
(Classless Inter-Domain Routing) employs hierarchical routing aggregation to minimize
routing table entries.
Addressing concerns:
- Plan for the Future: Select a class and subnets that will allow expansion in the
future.
- Ensure Uniqueness: When assigning network IDs for an intranet, its important to
make sure that each network has a unique network ID. Every segment of your network that is
bordered by two router interfaces must have its own unique ID (even if the only two
devices on the segment are the two routers.) Each host ID within a network or subnet must
be unique.
- Avoid restricted addresses: Certain addresses are not allowed for normal
use--don't use them. Host ID's cannot consist of all 0's or all 1's.
- Plan for security: Subnets are one way to restrict privileged traffic.
- Have a method: A logical plan of distribution is useful. Low ID's could be given
to Routers. High ID's could be given to servers. The rest might be allocated to
workstations. Maybe you should group Unix workstations and Microsoft workstations.
- Mobility: IP addresses must be changed if the host is moved to a new network.
- Record Keeping: is essential.
Internet Addressing:
- A network ID on an internetwork must be unique.
- A network ID cannot be all 0's or all 1's.
- A network ID cannot begin with 127.x.y.z
Private Internets (How you address your network not connected to the
Internet)
RFC 1597 - Address Allocation for Private Internets relaxes the rule that IP
addresses are globally unique by reserving part of the address space for networks which
are used exclusively within a single organization and which do not require IP connectivity
to the Internet. There are three ranges of addresses which have been reserved by IANA for
this purpose:
- 10 ... A single Class A network
- 172.16 through 172.31 ... 16 contiguous Class B networks
- 192.168.0 through 192.168.255 ... 256 contiguous Class C networks
Any organization may use any addresses in these ranges without reference to any other
organization. However, because these addresses are not globally unique, they cannot be
referenced by hosts in another organization and they are not defined to any external
routers. Routers in networks not using private addresses, particularly those operated by
Internet service providers, are expected to quietly discard all routing information
regarding these addresses. Routers in an organization using private addresses are expected
to limit all references to private addresses to internal links; they should neither
advertise routes to private addresses to external routers nor forward IP datagrams
containing private addresses to external routers. Hosts having only a private IP address
do not have IP-layer connectivity to the Internet. This may be desirable and may even be a
reason for using private addressing. All connectivity to external Internet hosts must be
provided with application gateways.
Disclaimer: The half life of the information above could possibly be less than that of
the average isolated sub-atomic particle.
Please note that the links in the article above were checked within the last two weeks.
I note that several have decayed already. Web sites frequently change the location of
their documents or remove documents that may not be accessed often. If a link above takes
you to a site, but the expected document is not displayed, try searching the site for the
document--they may just have moved it.
Alternately, if you take the term that was linked and submit that string to a search
engine, it is likely that you will find numerous references to any topic in the post
above.
|