IP Addressing

  • Identify IP addresses (IPv4, IPv6) and their default subnet masks.

Addressing is perhaps the most challenging aspect of TCP/IP. It's certainly a topic that has many people scratching their heads for a while. The following sections look at how IP addressing works for both IPv4 and the newest version of the IP, IPv6. In today's IT environment, and certainly in the immediate future, IPv4 will remain the protocol of choice for networking. For that reason, this chapter dedicates considerably more time to it.

General IP Addressing Principles

To communicate on a network using the TCP/IP protocol, each system has to be assigned a unique address. The address defines both the number of the network to which the device is attached and the address of the node on that network. In other words, the IP address provides two pieces of information. It's a bit like a street name and a house number of a person's home address.

NOTE

IP Terminology Two important phrases in IP addressing are network address and node address. The IP address defines both, but you must understand that the network address and the node address are different from one another. You need to be aware, also, that some people call the network address the network ID and the host address the host ID.


Each device on a logical network segment must have the same network address as all the other devices on the segment. All the devices must have different node addresses.

So how does the system know which part of the address is the network part and which is the node part? That is the function of a subnet mask. On its own, an IP address is no good to the system because it is simply a set of four numbers. The subnet mask is used in concert with the IP address to determine which portion of the IP address refers to the network address and which refers to the node address.

IPv4

An IPv4 address (which we just call an IP address from now on) is comprised of four sets of 8 bits, or octets. The result is that IP addresses are 32 bits in length. Each bit in the octet is assigned a decimal value. The leftmost bit has a value of 128, followed by 64, 32, 16, 8, 4, 2, and 1, left to right.

Each bit in the octet can be either a 1 or a 0. If the value is 1, it is counted as its decimal value, and if it is 0, it is ignored. If all the bits are 0, the value of the octet is 0. If all the bits in the octet are 1, the value is 255, which is 128+64+32+16+8+4+2+1. Figure 6.10 shows a chart representing the binary-to-decimal conversion. In Figure 6.10, the chart is used to derive the decimal of 195.

Figure 6.10. A binary-to-decimal conversion chart showing how 195 is derived.


By using the set of 8 bits and manipulating the 1s and 0s, any value between 0 and 255 can be obtained for each octet. Table 6.7 shows a few examples of this.

Table 6.7. Examples of Numbers Derived Through Binary
Decimal Value Binary Value Decimal Calculation
10 00001010 8+2=10
192 11000000 128+64=192
205 11001101 128+64+8+4+1=205
223 11011111 128+64+16+8+4+2+1=223

As mentioned earlier, the IP address is composed of four sets of these bits, each of which is separated by a period. For this reason, an IP address is said to be expressed in dotted-decimal format.

IP Address Classes

IP addresses are grouped into logical divisions called classes. In the IPv4 address space, there are five address classes (A through E), although only three are used for assigning addresses to clients. Class D is reserved for multicast addressing, and Class E is reserved for future development.

Of the three classes available for address assignments, each uses a fixed-length subnet mask to define the separation between the network and the node address. A Class A address uses only the first octet to represent the network portion, a Class B address uses two octets, and a Class C address uses three octets. The upshot of this system is that Class A has a small number of network addresses but a very large number of possible host addresses. Class B has a larger number of networks but a smaller number of hosts, and Class C has an even larger number of networks, as well as an even smaller number of hosts. The exact figures are provided in Table 6.8.

Table 6.8. IPv4 Address Classes and the Number of Available Network/Host Addresses
Address Class Range Number of Networks Number of Hosts per Network Binary Value of First Octet
A 1–126 126 16,777,214 0xxxxxxx
B 128–191 16384 65,532 10xxxxxx
C 192–223 2,097,152 254 110xxxxx
D 224–247 NA NA 1110xxxx
E 248–255 NA NA 1111xxxx

Notice in Table 6.8 that the network number 127 is not included in any of the ranges. The 127 network ID is reserved for the local loopback. The local loopback is a function that is built in to the TCP/IP protocol suite and can be used for troubleshooting purposes.

EXAM TIP

Address Classes For the Network+ exam, you should be prepared to identify into which class a given address falls. You should also be prepared to identify the loopback address.


Subnet Mask Assignment

Like an IP address, a subnet mask is a 32-bit address expressed in dotted-decimal format. Unlike an IP address, though, a subnet mask performs just one function: It defines which parts of the IP address refer to the network address and which refer to the node address. Each of the classes of IP address that are used for address assignment has a standard subnet mask associated with it. The default subnet masks are listed in Table 6.9.

Table 6.9. Default Subnet Masks Associated with IP Address Classes
Address Class Default Subnet Mask
A 255.0.0.0
B 255.255.0.0
C 255.255.255.0

Broadcast Addresses and “This Network”

Two important concepts to keep in mind when working with TCP/IP are broadcast addresses and the addresses used to refer to “this network.” When referring to “this network,” the host ID portion of the address is expressed as 0s. So, for network number 192.168, the reference would be 192.168.0.0. For a Class A network number 12, it would be 12.0.0.0.

Broadcast addresses work much the same way as “this network” addresses, except that the host ID portion of the address is set to 255, to reflect that the message is going to be sent to all the hosts on that network. Using the preceding examples, the broadcast addresses would be 192.168.255.255 and 12.255.255.255.

Classless Interdomain Routing (CIDR)

Classless interdomain routing (CIDR) is a method of assigning addresses outside the standard Class A, B, and C structure. By specifying the number of bits in the subnet mask as a specific number, there is more flexibility than with the three standard class definitions.

Using CIDR, addresses are assigned using a value known as the slash. The actual value of the slash is dependent on how many bits of the subnet mask are used to express the network portion of the address. For example, a subnet mask that uses all 8 bits from the first octet and 4 from the second would be described as /12, or “slash 12.” A subnet mask that uses all the bits from the first three octets would be called /24. Why the slash? In actual addressing terms, the CIDR value is expressed after the address, using a slash. So the address 192.168.2.1/24 means that the IP address of the node is 192.168.2.1 and the subnet mask is 255.255.255.0.

IPv6

IPv4 has served faithfully for many years, and it seems that it is still not yet ready to yield to the next version of IP, IPv6. However, sooner or later we will be moved to IPv6, so an understanding of what is involved in IPv6 and its addressing is both useful and required for the Network+ exam.

IPv6 Addressing

By far the most significant aspect of IPv6 is its addressing capability. The address range of IPv4 is nearly depleted, and it is widely acknowledged that we are at just the beginning of the digital era. Therefore, we need an addressing scheme that offers more addresses than could possibly be used in the foreseeable future. IPv6 delivers exactly that. Whereas IPv4 uses a 32-bit address, IPv6 uses a 128-bit address that yields a staggering 340,282,366,920,938,463,463,374,607,431,768,211,456 possible addresses. And no, the numeric pad on the PC didn't go nuts; that is actually the number. Anyone for a subnetting exercise?

IPv6 addresses are expressed in a very different format from those used in IPv4. An IPv6 address is composed of eight octet pairs in hexadecimal, separated by colons. The following is an example of an IPv6 address:

42DE:7E55:63F2:21AA:CBD4:D773:CC21:554F

Notice that the format of this address is similar to that used to express a MAC address, although it is longer. Because the address is expressed in hexadecimal format, only numbers and the letters A though F are used in IPv6 addresses.

Other Benefits of IPv6

Although addressing is the biggest change in IPv6, the new version of the protocol will bring a number of other features, including the following:

  • Smaller header— Some of the fields included in the IPv4 packet header format have been dropped or made optional. The upshot of this is that IPv6 has lower overhead than IPv4.

  • Packet labeling— Packets can be labeled in such a way that they are recognized by a router as being special. This makes it possible for the router to prioritize data.

  • Improved authentication/security— Realizing our increasing need for more security and authentication capabilities, the IPv6 specification includes extensions to support features such as IPSec (see Chapter 8, “Remote Access and Security Protocols,” for more information).

Most manufacturers are building IPv6 support into their products now, to get ready for the time when we move to the new system. In the meantime, we will continue to use IPv4.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.174.195