Networking / Beginners

Introducing IP Addresses

An IP address is a number that uniquely identifies every host on an IP network. IP addresses operate at the Network layer of the TCP/IP protocol stack, so they are independent of lower-level Data Link layer MAC addresses, such as Ethernet MAC addresses.

IP addresses are 32-bit binary numbers, which means that theoretically, a maximum of something in the neighborhood of 4 billion unique host addresses can exist throughout the Internet. You'd think that would be enough, but TCP/IP places certain restrictions on how IP addresses are allocated. These restrictions severely limit the total number of usable IP addresses. Many experts predict that we will run out of IP addresses as soon as next year. However, new techniques for working with IP addresses have helped to alleviate this problem, and a standard for 128-bit IP addresses has been adopted, though it still is not yet in widespread use.

Networks and hosts

IP stands for Internet protocol, and its primary purpose is to enable communications between networks. As a result, a 32-bit IP address actually consists of two parts:

  • The network ID (or network address): Identifies the network on which a host computer can be found
  • The host ID (or host address): Identifies a specific device on the network indicated by the network ID

Most of the complexity of working with IP addresses has to do with figuring out which part of the complete 32-bit IP address is the network ID and which part is the host ID, as described in the following sections.

As describe the details of how host IDs are assigned, you may notice that two host addresses seem to be unaccounted for. For example, the Class C addressing scheme, which uses eight bits for the host ID, allows only 254 hosts - not the 256 hosts you'd expect. That's because host 0 (the host ID is all zeros) is always reserved to represent the network itself. The host ID can't be 255 (the host ID is all ones) because that host ID is reserved for use as a broadcast request that's intended for all hosts on the network.

The dotted-decimal dance

IP addresses are usually represented in a format known as dotted-decimal notation. In dotted-decimal notation, each group of eight bits - an octet - is represented by its decimal equivalent. For example, consider the following binary IP address:


To convert this value to dotted-decimal notation, first divide it into four octets, as follows:

11000000 10101000 10001000 00011100

Then, convert each of the octets to its decimal equivalent:

11000000 10101000 10001000 00011100
192 	 168 	  136 	   28

Then, use periods to separate the four decimal numbers, like this:

This is the format in which you'll usually see IP addresses represented.

Classifying IP Addresses When the original designers of the IP protocol created the IP addressing scheme, they could have assigned an arbitrary number of IP address bits for the network ID. The remaining bits would then be used for the host ID. For example, suppose that the designers decided that half of the address (16 bits) would be used for the network, and the remaining 16 bits would be used for the host ID. The result of that scheme would be that the Internet could have a total of 65,536 networks, and each of those networks could have 65,536 hosts.

In the early days of the Internet, this scheme probably seemed like several orders of magnitude more than would ever be needed. However, the IP designers realized from the start that few networks would actually have tens of thousands of hosts. Suppose that a network of 1,000 computers joins the Internet and is assigned one of these hypothetical network IDs. Because that network will use only 1,000 of its 65,536 host addresses, more than 64,000 IP addresses would be wasted.

As a solution to this problem, the idea of IP address classes was introduced. The IP protocol defines five different address classes: A, B, C, D, and E. Each of the first three classes, A-C, uses a different size for the network ID and host ID portion of the address. Class D is for a special type of address called a multicast address. Class E is an experimental address class that isn't used.

The first four bits of the IP address are used to determine into which class a particular address fits, as follows:

  • If the first bit is zero, the address is a Class A address.
  • If the first bit is one and if the second bit is zero, the address is a Class B address.
  • If the first two bits are both one and if the third bit is zero, the address is a Class C address.
  • If the first three bits are all one and if the fourth bit is zero, the address is a Class D address.
  • If the first four bits are all one, the address is a Class E address.

Because Class D and E addresses are reserved for special purposes, focus the rest of the discussion here on Class A, B, and C addresses. Table-3 summarizes the details of each address class.

Table-3 IP Address Classes
ClassAddress Number Starting BitsRangeStarting BitsLength of Network IDNumber of NetworksHosts


Most of the current Internet is based on version 4 of the Internet Protocol, also known as IPv4. IPv4 has served the Internet well for more than 20 years. However, the growth of the Internet has put a lot of pressure on IPv4's limited 32-bit address space. This tutorial describes how IPv4 has evolved to make the best possible use of 32-bit addresses. Eventually, though, all the addresses will be assigned, and the IPv4 address space will be filled to capacity. When that happens, the Internet will have to migrate to the next version of IP, known as IPv6.

IPv6 is also called IP next generation, or IPng, in honor of the favorite television show of most Internet gurus, Star Trek: The Next Generation.

IPv6 offers several advantages over IPv4, but the most important is that it uses 128 bits for Internet addresses instead of 32 bits. The number of host addresses possible with 128 bits is a number so large that it would have made Carl Sagan proud. It doesn't just double or triple the number of available addresses, or even a thousand-fold or even a million-fold. Just for the fun of it, here is the number of unique Internet addresses provided by IPv6:

340,282,366,920,938,463,463,374,607,431,768,21 1,456

This number is so large it defies understanding. If the IANA had been around at the creation of the universe and started handing out IPv6 addresses at a rate of one per millisecond - that is, 1,000 addresses every second - it would now, 15 billion years later, have not yet allocated even 1 percent of the available addresses.

The transition from IPv4 to IPv6 has been a slow one. IPv6 is available on all new computers and has been supported on Windows since Windows XP Service Pack 1 (released in 2002). However, most Internet service providers (ISPs) still base their service on IPv4. Thus, the Internet will continue to be driven by IPv4 for at least a few more years.

[Previous] [Contents] [Next]