Understanding IP Addresses

When you have many computers on a network, you need a way to identify each one uniquely. In TCP/IP networking, the address of a computer is known as the IP address. Because TCP/IP deals with internetworking, the address is based on the concepts of a network address and a host address. You might think of the idea of a network address and a host address as having to provide two addresses to identify a computer uniquely:

♦ Network address: Indicates the network on which the computer is located

♦ Host address: Indicates a specific computer on that network

The IP address is a 4-byte (32-bit) value with some of the bits devoted to the network address and the rest used for the host address. The convention is to write each byte Secret as a decimal value and to put a dot (.) after each number. Thus, you see network addresses such as This way of writing IP addresses is known as dotted-decimal or dotted-quad notation. Each of the four decimal numbers in the dotted-decimal notation is often referred to as an octet. Note that each decimal number in the dotted-decimal notation must be between 0 and 255 because that's the range of values a byte can hold.

The bits in an IP address are organized in the following manner:

<Network Address, Host Address>

In other words, a specified number of bits of the 32-bit IP address are used as a network address, and the rest of the bits are interpreted as a host address. The network address identifies the LAN to which your PC is connected and the host address identifies your PC as one of many hosts within the LAN. Other PCs in the LAN share the same network address, but have different bits in the host address portion fo their IP addresses.

When IP addresses were initially allocated to organizations, a class system was devised to accommodate networks of various sizes. (The network size is the number of computers in that network.) Although the network classes are largely ignored nowadays, it is important to understand what the network classes are and how they work because they linger on in the backbone of the Internet. In place of predefined classes, IP networks use classless addressing schemes with network marks to separate the network address from the host address.

There are five classes of IP addresses, named class A through class E, as shown in Figure 6-3.

32-bit IP Address

Class A


7-bit Network Address (1-126 24-bit Host Address (16,777,214 or allowed, 0 and 126 reserved) 16 million hosts per network)

Class B

11 0

7-bit Network Address (16,384 networks, 16-bit Host Address (65,534 hosts per first octet between 128 and 191) network, all zeros and all ones reserved)

Class C

11 1 0

21-bit Network Address (2,097,152 or 2 million 8-bit Host Address networks, first octet between 192 and 223) (254 hosts per network, all zeros and all ones reserved)

Class D

11 1 1 0

28-bit Multicast Address for addressing groups of hosts (first octet between 224 and 239)

Class E

|1|1|1|1|0| 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

27-bits reserved for future use (first octet between 240 and 255)


6-3: Classes of IP Addresses.

Of the five address classes, only classes A, B, and C are used for addressing networks and hosts; classes D and E are reserved for special use.

Class A addresses support 126 networks, each with up to 16 million hosts. Although the network address is 7-bit, two values (0 and 127) have special meaning; therefore, you can have only 1 through 126 as Class A network addresses. There can be approximately 2 billion class A hosts.

Class B addresses are for networks with up to 65,534 hosts. There can be at most 16,384 class B networks. All class B networks, taken together, can have approximately 1 billion hosts.

Class C addresses are meant for small organizations. Each class C address allows up to 254 hosts, and there can be approximately 2 million class C networks. Therefore, there can be at most approximately 500 million class C hosts. If you are in a small company, you probably have a class C address. Nowadays, it is customary to aggregate multiple class C addresses into a single block and use them for efficient routing.

All together, class A, B, and C networks can support at most approximately 3.5 billion hosts.

You can tell the class of an IP address by the first number in the dotted-decimal notation, as follows:

♦ Class A addresses: 1.xxx.xxx.xxx through 126.xxx.xxx.xxx

♦ Class B addresses: 128.xxx.xxx.xxx through 191.xxx.xxx.xxx

♦ Class C addresses: 192.xxx.xxx.xxx through 223.xxx.xxx.xxx

Even within the five address classes, the following IP addresses have special meaning:

♦ An address with all zeros in its network portion indicates the local network: the network where the data packet with this IP address originated. Thus, the address means host number 200 on this class C network.

♦ The class A address 127.xxx.xxx.xxx is used for loopback: communications within the same host. Conventionally, is used as the loopback address. Processes that need to communicate through TCP with other processes on the same host use the loopback address to avoid having to send packets out on the network.

♦ Turning on all the bits in any part of the address indicates a broadcast message. The address, for example, means all hosts on the class B network 128.18. The address is known as a limited broadcast; all workstations on the current network segment will receive the packet.

♦ The following three blocks of IP addresses are reserved for private networks:

Getting IP Addresses for Your Network

If you are setting up an independent network of your own that will be connected to the Internet, you need unique IP addresses for your network. You would typically get a range of IP addresses for your network from the ISP that connects your network to the Internet. You can get the domain name from one of the Internet domain name registration services. For example, for the .com domain, you can obtain domain names from VeriSign located on the Web at www.networksolutions.com/. To learn more about domain name and IP address services, point your Web browser to the InterNIC website at www.internic.net/.

ISPs typically get their IP address allocation in large blocks from regional Internet registries such as ARIN (American Registry for Internet Numbers, www.arin.net/) in the United States, RIPE (Réseaux IP Européens, www.ripe.net/) in Europe, and APNIC (Asia Pacific Network Information Centre, www.apnic.net/) for the Asia-Pacific region. For more information about IP address allocation services, visit the Internet Assigned Numbers Authority (IANA) website at www.iana.org/ipaddress/ip-addresses.htm.

If you don't plan to connect your network to the Internet, you really don't need a unique IP address. RFC 1918 (the "Address Allocation for Private Internets" section) provides guidance about what IP addresses you can use within private networks (the term "private Internet" refers to any network not connected to the Internet). Three blocks of IP addresses are reserved for private Internets:

You can use addresses from these blocks for your private network without having to coordinate with an organization. For example, I (and many others) use the Class C address for a home network. Additionally, the cable/DSL routers use one of these private Class C addresses for the local network interface.

If you have only one public Internet address from your ISP, you can still use a Network Address Translation (NAT) router to connect your local network with private IP addresses to the public Internet.

Figuring Out Network Masks

The network mask is an IP address that has 1s in the bits that correspond to the network address, and 0s in all other bit positions. The class of your network address determines the network mask.

If you have a class C address, for example, the network mask is Thus, class B networks have a network mask of, and class A networks have as the network mask. Of course, you do not have to use the historical class A, B, or C network masks. Nowadays, you can use any other network mask that's appropriate for your network address.

Extracting Network Addresses

The network address is the bitwise AND of the network mask with any IP address in your network. If the IP address of a system on your network is, and the network mask is, the network address is The network address is written with zero bits in the part of the address that's supposed to be for the host address.

Using Subnets

If your site has a class B address, you get one network number, and that network can have up to 65,534 hosts. Even if you work for a megacorporation that has thousands of hosts, you may want to divide your network into smaller subnetworks (or subnets). If your organization has offices in several locations, for example, you may want each office to be on a separate network. You can do this by taking some bits from the host-address portion of the IP address and assigning those bits to the network address. This procedure is known as defining a subnet mask.

Was this article helpful?

0 0
Make Money Writing

Make Money Writing

This Report Will Show You How To Make Money By Providing Writing Services To Other Internet Marketers. Learn how to make money by writing the right way. Grab your copy of this report now and learn. Why writing is a great way to earn money. How to compete with cheap writers, even if you charge a lot more money.

Get My Free Ebook

Post a comment