Understanding IP addressing is critical to understanding how IP works. An IP address is a numeric identifier assigned to each device on an IP network. This type of address is a logical software address that designates the device’s location on the network. It isn’t the physical hardware address hard- coded in the device’s network interface card.
In this section, you will see how IP addresses are used to identify uniquely every machine on the network (MAC address).
The Hierarchical IP Addressing Scheme
An IP address consists of 32 bits of information. These bits are divided into four sections (sometimes called octets or quads) containing 1 byte (8 bits) each. There are three common methods for specifying an IP address:
■ Dotted decimal, as in 130.57.30.56
■ Binary, as in 10000010.00111001.00011110.00111000
■ Hexadecimal, as in 82 39 1E 38
All of these examples represent the same IP address.
The 32- bit IP address is a structured, or hierarchical, address as opposed to a flat, or nonhierarchical, address. Although IP could have used either flat addressing or hierarchical addressing, its designers elected to use the latter for a very good reason, as you will now see.
IP Address Structure
IP addressing works the same way. Instead of the entire 32 bits being treated as a unique identifier, one part of the IP address is designated as the network address (or network ID) and the other part as a node address (or host ID), giving it a layered, hierarchical structure. Together, the IP address, the network address, and the node address uniquely identify a device within an IP network.
The network address— the first two sets of numbers in an IP address— uniquely identifies each network. Every machine on the same network shares that network address as part of its IP address, just as the address of every house on a street shares the same street name. In the IP address 130.57.30.56, for example, 130.57 is the network address.
The node address— the second two sets of numbers— is assigned to, and uniquely identifies, each machine in a network, just as each house on the same street has a different house number. This part of the address must be unique because it identifies a particular machine— an individual, as opposed to a network. This number can also be referred to as a host address. In the sample IP address 130.57.30.56, the node address is .30.56.
Understanding IP Addressing
Understanding Network Classes
The designers of the Internet decided to create classes of networks based on network size.
For the small number of networks possessing a very large number of nodes, they created the Class A network. At the other extreme is the Class C network, reserved for the numerous networks with small numbers of nodes. The class of networks in between the very large and very small ones is predictably called the Class B network.
The default subdivision of an IP address into a network and node address is determined by the class designation of your network. Table 4.2 summarizes the three classes of networks, which will be described in more detail in the following sections.
TABLE 4.2 Network address classes
Class | Mask bits | Leading bit pattern | Decimal range of first octet of IP address | Assignable networks | Maximum nodes per network |
A | 8 | 0 | 1–126 | 126 | 16,777,214 |
B | 16 | 10 | 128–191 | 16,384 | 65,534 |
C | 24 | 110 | 192–223 | 2,097,152 | 254 |
Classless Inter- Domain Routing (CIDR), explained in detail later in this chapter, has effectively done away with these class designations. You will still hear and should still know the meaning behind the class designations of addresses because they are important to understanding IP addressing. However, when you’re working with IP addressing in practice, CIDR is more important to know.
To ensure efficient routing, Internet designers defined a mandate for the leading bits section of the address for each different network class. For example, because a router knows that a Class A network address always starts with a 0, it can quickly apply the default mask, if necessary, after reading only the first bit of the address. Table 4.2 illustrates how the leading bits of a network address are defined. When considering the subnet masking between network and host addresses, the number of bits to mask is important. For example, in a Class A network, 8 bits are masked, making the default subnet mask 255.0.0.0; in a Class C, 24 bits are masked, making the default subnet mask 255.255.255.0.
Some IP addresses are reserved for special purposes and shouldn’t be assigned to nodes.
Table 4.3 describes some of the reserved IP addresses. See RFC 3330 for others.
TABLE 4.3 Special network addresses
Address | Function |
Entire IP address set to all 0s | Depending on the mask, this network (that is, the network or subnet of which you are currently a part) or this host on this network. |
A routing table entry of all 0s with a mask of all 0s | Used as the default gateway entry. Any destination address masked by all 0s produces a match for the all 0s reference address. Because the mask has no 1s, this is the least desirable entry, but it will be used when no other match exists. |
Network address 127 | Reserved for loopback tests. Designates the local node, and it allows that node to send a test packet to itself without generating network traffic. |
Node address of all 0s | Used when referencing a network without referring to any specific nodes on that network. Usually used in routing tables. |
Node address of all 1s | Broadcast address for all nodes on the specified network, also known as a directed broadcast. For example, 128.2.255.255 means all nodes on the Class B network 128.2. Routing this broadcast is configurable on certain routers. |
169.254.0.0 with a mask of 255.255.0.0 | The “link- local” block used for autoconfiguration and communication between devices on a single link. Communication cannot occur across routers. Microsoft uses this block for Automatic Private IP Addressing (APIPA). |
Entire IP address set to all 1s (same as 255.255.255.255) 10.0.0.0/8172.16.0.0 to 172.31.255.255 | Broadcast to all nodes on the current network; sometimes called a limited broadcast or an all- 1s broadcast. This broadcast is not routable. |
192.168.0.0/16 | The private- use blocks for Classes A, B, and C. As noted in RFC 1918, the addresses in these blocks must never be allowed into the Internet, making them acceptable for simultaneous use behind NAT servers and non- Internet- connected IP networks. |
In the following subsections, we will look at the three network types.