Why?

For a host to communicate with a remote host over the Internet, it must know the remote host’s IP address. Each host, or node, has its own 32-bit IP address (also known as Internet address) that uniquely identifies and distinguishes it from any other host on the Internet.

This lesson will cover the current version of Internet Protocol (IP) addressing used on the Internet and most TCP/IP networks today: IPv4. Internet address structure, binary versus decimal format, address classes, addressing rules, reserved addresses, subnetworks, and default subnet masks will be discussed.

To ensure that each user (host) on the Internet has a unique IP address, a central authority called the “Internet Assigned Numbers Authority (IANA)” issues all Internet addresses. Most Internet addresses contain the network portion and the host portion. The network portion precedes the host portion:

network portion, host portion

Internet addresses are specified by four fields, separated by periods:

field1.field2.field3.field4

They are typically written in dotted decimal notation. Each field has a decimal value ranging from 0 to 255, as demonstrated by the following Internet address:

208.157.24.111

In this example, the network portion is 208.157.24, and the host portion is 111. To help distinguish the network portion from the host portion, Internet addresses are divided into classes, which are described later in this lesson.

Decimal vs. Binary Format:

IP addresses are called “32-bit addresses” because each field is actually a byte and a byte equals 8 bits. Because an IP address has four bytes, the total number of bits in an IP address is 32.

8 + 8 + 8 + 8 = 32

To determine the bit value of an Internet address, the address must be converted from decimal to binary format. Binary format is a combination of zeros and ones that computers use to process information. The binary equivalent is determined by calculating the value of each bit within each byte from left to right, based on the bit’s place value in the byte. Spend a few minutes memorizing these bit place values, as they will be used throughout this lesson:

Bit
Value

128 64 32 16 8 4 2 1

So, if an IP address (in binary format) contains the value 01111001, you can determine its decimal value by adding the corresponding bit values that are equal to 1. For example:

01111001 = 0 + 64 + 32 + 16 + 8 + 0 + 0 + 1 = 121

You can do this for each byte in the 32-bit Internet address. For example:

10000011 11100010 00001000 11001000 = 131.226.8.200

(Do Exercise 5-1: Converting Internet Addresses – decimal and binary values)

Without a classification system for Internet addresses, the 3 trillion plus possible Internet addresses worldwide would have no structure. To provide structure, IP addresses are categorized into classes. Classes can be determined by looking at the first byte of an Internet address.

Internet addresses are divided into five classes: A, B, C, D and E. The characteristics of each class are detailed and followed by an explanation, as follows:

Class A: Ranges from 0.0.0.0 to 127.255.255.255
0
Network (1 byte)
Host (3 bytes)

(starting 126 networks 16,777,214 hosts

binary

value is 0)

Class B: Ranges from 128.0.0.0 to 191.255.255.255

1 0
Network (2 bytes)
Host (2 bytes)

(starting 16,384 networks 65,534 Hosts

binary value is

10)

Class C: Ranges from 192.0.0.0 to 223.255.255.255

1 1 0
Network (3 bytes)
Host (1 byte)

(starting binary value is 2,097,152 networks 254 Hosts

110)

Class D: Ranges from 224.0.0.0 to 239.255.255.255

1110
Multicasting --- Network (4 bytes)

(starting binary value is 1110)

Class E: Ranges from 240.0.0.0 to 247.255.255.255

1 1 1 1 0
Experimental / Reserved for future use

(starting binary value is 11110)

Class A addresses use 8 bits for the network portion and 24 bits for the host portion. They provide the potential for 126 networks with up to 16,777,214 hosts each. The first byte (8 bits) specifies the network number and class; the first byte can range from 0 to 126 (127 is reserved for a “loopback” address). The first bit of a Class A network address is always a 0 bit.

The following is an example of a Class A address (the first byte is the network address):

121.1.1.32

The binary equivalent of this address is:

01111001 00000001 00000001 00100000

Class B addresses use 16 bits for the network portion and 16 bits for the host portion. They provide the potential for 16,384 networks with up to 65.534 hosts each. The first two bytes (16 bits) specify the network number and class; the first byte can range from 128 to 191. The first two bits of a Class B address are always 10.

The following is an example of a Class B address (the first two bytes are the network address):

168.100.1.32

The binary equivalent of this address is:

10101000 01100100 00000001 00100000

Class C addresses use 24 bits for the network portion and 8 bits for the host portion. They provide the potential for 2,097,152 networks with up to 254 hosts each. The first 3 bytes (24 bits) specify the network number and class; the first byte can range from 192 to 223. The first three bits of a Class C address are always 110.

The following is an example of a Class C address (the first 3 bytes are the network address):

205.96.224.32

The binary equivalent of this address is:

11100110 00000101 01111100 00111110

Class D addresses support multicasting. With multicasting, a datagram (message) is targeted to a group that is identified by a network address only (no host portion exists). The first byte can range from 224 to 239. The first four bits of a Class D address are always 1110.

The following is an example of a Class D address (all four bytes are the network address):

230.5.124.62

The binary equivalent of this address is:

11100110 00000101 01111100 00111110

Class E addresses reserved for future use. The first byte can range from 240 to 247. The first five bits of a Class E address are always 11110.

Review:

The 32-bit Internet address (a.k.a. IP address) must be unique. It is typically written in dotted decimal notation. The following is an example of the address notation:

Dotted decimal: 131.226.8.200

32-bit address: 1000011 11100010 00001000 11001000

Note that this is a Class B address because the first byte is between 128 and 191. Also, the address contains four bytes; the first two bytes (131.226.) refer to the network portion of the address, and the last two bytes refer to the host portion of the address.

Internet addresses must follow several guidelines to function properly. Although you have learned about the ranges of Classes A, B and C addresses, not all addresses within these ranges can be used. This section describes the exceptions.

The loopback address (127) cannot be used as a valid Internet address. This address allows a client and server on the same host computer to communicate with each other. The loopback address is ideal for testing and troubleshooting. For example, if your computer hosts a Web server and you enter http://127.0.0.1 in your Web browser’s address field (as a client), you will access your own website. The loopback address can also be used to test TCP/IP functionality on your own client computer by using the ping command utility.

For Unix and Windows NT operating systems, the loopback address is defined in the letc / hosts file and is typically 127.0.0.1 with the assigned name localhost.

Limited Broadcast: 255.255.255.255. Used for configuring hosts when they boot up. For example, a computer without an IP address can broadcast this address to obtain an IP address (that is, from a DHCP or BOOTP server).

Net-directed Broadcast: netid.255.255.255. Used to broadcast to all hosts in a network. For example, if the network portion of your IP address is 192.34.200 and the host portion is 12, your computer can broadcast messages to all network hosts by using the destination address 192.32.200.255 to reach all hosts on this network.

Subnet-directed Broadcast: If a network is divided into several subnets, a broadcast can be limited to the hosts within a subnet (subnetwork). You will learn about subnets later in this section.

All-subnets-directed Broadcast: If a network is divided into several subnets, a broadcast can be sent to all hosts within all network subnets. This type of broadcast has become obsolete; multicasting (see Class D addresses) is preferred.

The network and / or host IP address portions can contain zeros, but they cannot be entirely zeros. For instance, the Class C IP address: 198.168.3.0 is a network address (for a Class C address) and cannot be assigned to a node.

The special-case source IP address of a computer is all zeros (0.0.0.0) when it initializes and is requesting an IP address (e.g. from a DHCP or BOOTP server). Although the computer broadcasts the request for an IP address, its source address is initially 0.0.0.0, until it is assigned a network IP address. The special-case source address can also specify a host on the network during initialization. For instance, the network portion of a Class C address can be all zeros, and the host portion can be 11, which is 0.0.0.11. These addresses cannot be used as valid IP addresses for a node.

The Internet Assigned Numbers Authority (IANA) has reserved three blocks of the entire IP address space for private Internets (also known as “Intranets”), as defined in the RFC 1918:

Class A
10.0.0.0 through 10.255.255.255
Reserved for internal (Intranet) use

Class B
172.16.0.0 through 172.31.255.255
Reserved for internal (Intranet) use

Class C
192.168.0.0 through 192.168.255.255
Reserved for internal (Intranet) use

The IANA suggests that companies use these network Ids if they fit into one of the following categories:

The host does not require access to other enterprise or Internet hosts
The host’s Internet needs can be handled by mediating (application-layer) gateways; for example, the hosts may require only limited Internet services, such as email, FTP, newsgroups and Web browsing.

These private network addresses have no global meaning. Therefore, Internet routers are expected to reject (filter out) routing information about them (the rejection will not be treated as a routing protocol error).

The benefits of using private network addresses include the following:

Conservation of globally-unique IP addresses when global uniqueness is not required. Uniqueness is only required within the Intranet itself.
More flexibility in enterprise design because of the large address space available.
Prevention of IP-address clashes when an enterprise gains Internet connectivity without receiving additional addresses from the IANA.

The drawbacks of private network addresses include:

Possible reduction of an enterprise’s flexibility in Internet access. If your company decides to provide Internet connectivity to all or some of your hosts, you will have to re-number some or all systems.
If your company merges with another company and all hosts use private network addresses, you will probably have to combine several Intranets into a single one. Addresses within the combined Intranet may no longer be unique, and you will have to re-number hosts to accommodate identical addresses. All IP addresses within one Intranet and on the Internet must be unique.

NOTE: In Intranets, there are no rules for creating IP addresses, unlike the Internet. Classes A, B and C do not need to be applied to Intranet addresses.

Subnetworks:

Subnetworks are a useful way to organize hosts within a network into logical groups. Thus, one network is divided into several “sub” networks.

Subnet routing allows numerous subnetworks to exist within a network. If subnet routing is used, the host bits of an IP address are divided into two groups: subnetwork and host. For example, subnetting would borrow from (and use) the lower-order 16 bits (the host bits) for a Class B network and the lower-order 8 bits, which are the host bits, for a Class C network.

Therefore a subnetwork address consists of the following 3 portions:

Network portion \ Subnetwork portion \ Host portion

Because an IP address consists of only a network and host address portion, a second element must be introduced: the Subnet Mask. The Subnet Mask is always configured with a network IP address.

A subnet mask, also called a “net mask”, is a 32-bit number (similar to an IP address) with a one-to-one correspondence to each of the 32 bits in the Internet address.

Distinguishes the network and host portions of an IP address.
Specifies whether a destination address is local or remote.

First, the subnet mask distinguishes the network and host portions of an IP address. Because the system does not know which bits in the host field(s) should be interpreted as the subnetwork part of the Internet address, it refers to the Subnet Mask. The Subnet Mask tells the system which bits of the Internet address should be interpreted as the network, subnetwork and host address.

The simplest type of Subnet Mask is the default Subnet Mask. By default, each 8-bit field is turned ON (255 = all binary 1s) or OFF (0 = all binary 0s), depending on the address class (A, B or C). (applies to Internet addresses only)

The following list identifies the default Subnet Masks for Class A, B and C addresses. Class D and E addresses do not have hosts, and therefore do not require Subnet Masks.

255.0.0.0
Class A (default)

255.255.0.0
Class B (default)

255.255.255.0
Class C (default)

Subnet Masks also specify whether a destination address is local or remote. Note that the Subnet Mask is used to “mask” the network address, so that only the host address remains. In routing, this masking is extremely important. It allows a computer to determine whether a destination address is intended for a computer on the same (local) network or a for a different (remote) one.

If the destination address is on the same (local) network, the information can be transmitted locally. If the destination address is on a different (remote) network, the information must be sent to a router, which can locate the remote network.

The Subnet Mask identifies whether the destination address is local or remote through a process called ANDing.

The ANDing Process:

The network portion of an Internet address can be determined by using the Boolean AND operation with the Internet address and the Subnet Mask. This process is internal to TCP/IP, but understanding its function is very important.

When the computer is initialized, it uses the ANDing process with its local IP address and local Subnet Mask. Whenever, it sends information to a destination address, it uses the ANDing process again with the destination address and the local Subnet Mask. If the value matches the initial ANDing result, it is a local address. If the value is different, it is a remote address.

To use the ANDing process, convert your local IP address and Subnet Mask into binary (bit) form. For the following example, your IP address is 131.226.85.1 and your Subnet Mask is 255.255.0.0 (the default for a Class B address). Calculate each corresponding bit using the following rules:

1 AND 1 = 1
Any other combination = 0

When your computer initializes, the ANDing process calculates the following result:

Local IP Address 10000011 11100010 01010101 00000001

11111111 11111111 00000000 00000000

First ANDing Result
10000011 11100010 00000000 00000000

By converting the ANDing result to a decimal value, the process reveals that the network portion of the address is: 131.226.

Your computer uses this ANDing result from the initialization process to determine whether all future destination addresses are local or remote. For example, you want to send information to the destination address 131.226.50.4.

Destination IP Address 10000011 11100010 00110010 00000100

11111111 11111111 00000000 00000000

Second ANDin Result
10000011 11100010 00000000 00000000

The network address here (in decimal) is: 131.226. Compare the first and second ANDing results. The ANDing results are the same, so the data is sent locally, and a router is NOT used. If they were different results, the network address of the destination computer would be different from the local network. The data would then have to be sent through a router to a remote network.

Internet Protocol – version 6 (IPv6):

With Internet usage growing so rapidly, the current addressing scheme is in real danger of running out of IP addresses. It is also creating unmanageable routing tables for the Internet’s backbone routers. IPv6 addresses these problems and will allow the Internet to function well into the future.

IPv6 uses 128-bit addresses instead of 32-bit addresses. It can support approximately 4 trillion IP addresses. Not only does it tackle addressing and routing-table problems, but it also improves the Internet (IP) Protocol. For example, it is more efficient and requires less administrative overhead than the current IPv4.

IPv6 may be implemented between 2005 and 2015, depending on how fast current IP addresses are used up. IPv6 and IPv4 will be part of Internet usage for several more generations to come.

Lesson Summary:

In this lesson, you discovered the key concepts of IPv4 32-bit IP addresses, including IP address structure, address classes, addressing rules and reserved addresses. You applied this knowledge (through examples) by converting binary addresses to decimal format, and vice versa. You also studied subnetworks and default subnet masks.

After you have figure it out what about Ranges and IP Adress listing you can choose a IP range to sxan or even look at some to choose.