Each host on an IP network requires a unique IP address and a subnet mask. If a host must communicate with other hosts outside if the local network, the IP address of the default gateway must also be specified. The IP address is a 32-bit number, represented in dotted-decimal notation format that identifies each host. An IP address consists of two parts: the network ID and the host ID. The network ID specifies the particular network or subnet that the host is on. The host ID uniquely identifies a host on a specific network or subnet. For example, with the IP address of 12.10.125.2 and a Class A subnet mask of 255.0.0.0, the network ID is 12 and the host ID is 10.125.2. IP Address ClassesIP addresses are organized into different address classes that define the number of bits out of the 32 that are used to identify the network and which are used to identify hosts on a network (see Table 2.1). By examining the address classes you can also determine the number of networks and the number of hosts.
There is also a Class D and a Class E. Class D is reserved for multicasting and Class E is reserved for testing purposes. You can determine the class of an IP address by mapping the first decimal value to one of the ranges outlined in Table 2.1. For example, 198.221.10.254 would be a class C address. Class ranges are defined by the contents of the first few digits of the IP address when in binary format. A Class A address starts with 1, Class B with 10, and Class C with 110. Private IP Address RangesThree ranges of IP addresses have been reserved via RFC 1918, meaning they are not valid for use on the Internet. Any public network node encountering a Private IP Address as the source or destination address in a packet will automatically drop the packet. However, you can use these private address ranges on your private network. One of the disadvantages to this is that a proxy server or NAT server is needed for Internet access because the private IP address must be mapped to or translated into a public address. In terms of advantages, private IP addressing is more cost-effective, can accommodate growth on your network, and can increase security. If you do decide to implement a private IP address range, you can use IP addresses from any of the following classes: Class A 10.0.0.010.255.255.255 Class B 172.16.0.0172.31.255.255 Class C 192.16.8.0.0192.168.255.255 One of the decisions you will be faced with when designing a TCP/IP network is whether you want to use a private IP address range or public IP addresses. There are disadvantages and advantages to both of them. In making your decisions, keep in mind that any computers having a direct connection to the Internet will require at least one public IP address. A public IP address is an address leased from an ISP that allows or enables direct Internet communication. But for those computers with no direct Internet connection, you have the option of using public or private addresses. Converting an IP Address to Binary FormatIP addresses, which consist of four octets, can be converted from decimal format to binary format. When in binary format, each set of 8 bits is known as an octet. When you convert each octet to a number, the value can range from 0 to 255. When these decimal equivalents are written side-by-side separated by a period, this is known as dotted-decimal notation. The values assigned to each of the placeholders in a single octet are as follows:
Let's take a look at an example. An IP address of 131.107.2.10 can be converted to the following binary number: 10000011 01101011 00000010 00000001 Conversely, a binary number of 11000000 11110000 00101000 11110010 can be converted to the following decimal number: 11000000 11110000 00101000 11110010 192.240.40.242 Subnet MasksWhen assigning IP addresses, each host requires a subnet mask to determine which part of an IP address is used as the network ID and which is used as the host ID. The default subnet masks for the three IP address classes are
For example, the default subnet mask for a Class C address is 255.255.255.0, which means the first three octets identify the network and the last octet identifies the host. The subnet mask is also used to determine whether the destination host is on the local subnet or a remote subnet. The subnet mask of the local host is compared against the IP address of the destination host and through a process known as "Anding" it is determined whether the destination IP address is the local or a remote network. Basically the number of 1s in the binary address of the subnet mask are masked against the binary form of the IP address to determine whether the address is on the local network or a remote network. When the bits of the subnet mask are compared against the bits in the IP address, the ANDing process converts the combinations of 1 and 0, 0 and 1, or 0 and 0 into a value of 0, and converts the combination of 1 and 1 into a value of 1. Let's look at an example of how this process works. The source host has an IP address of 192.168.0.10 and subnet mask of 255.255.255.0. The destination host has an IP address of 192.168.20.2.
As you can see from this example, the source IP address is ANDed against the subnet mask. The destination address is ANDed against the subnet mask assigned to the source host. If the results are not the same, the destination host is on a different network or subnet. Conversely, if the results are the same, it is determined that the destination host is on the local network. Subnetting an IP AddressSubnetting is a popular exam topic across many different Microsoft certification exams. It allows you to divide a network into smaller logical networks. Subnetting offers many benefits that include the following:
Subnetting works by taking some of the bits that would normally be used for host IDs to identify logical networks. The number of logical networks you require will determine the number of bits you take away from the host IDs. The first step in subnetting is to determine the number of logical networks you need and the maximum number of hosts that each logical network will support. After you have determined this you can then establish the subnet mask. The following steps outline the general process to follow:
Let's take a look at an example of subnetting a Class B address. The network ID is 131.107.0.0 and the default subnet mask is 255.255.0.0. You require 10 logical networks. To start off the process, convert the number 10 to binary format. Convert to Binary 00001010 Convert to High Order 11110000 Convert to a Decimal 240 Based on this example, the new subnet mask will be 255.255.240.0. When choosing a subnet mask, you also need to be able to determine the number of hosts and subnets that a given subnet mask will support. For example, the subnet mask of 255.255.255.224 would allow for eight subnets. You can determine the number of hosts a subnet mask will support by using the following formula: 2x where x is the number of host bits used for the subnet ID The subnet ID of 224 requires 3 bits. Using this formula, 23 equals 8 subnets. The formula used to determine the number of hosts per subnet is (2x) -2. For this calculation, x equals the number of bits remaining for the host ID. Because 3 bits are being used for the subnet ID, this leaves 5 bits remaining (remember each octet consists of 8 bits). Because (25) -2 equals 30, each subnet can have a maximum of 30 hosts. The two host IDs are removed from the calculation because
If you can remember these formulas, you will be able to determine the number of subnets and hosts that a specific subnet mask will support. Exam Alert Be prepared to perform subnetting calculations on the exam. For example, you might be required to choose the correct subnet mask based on specific subnetting requirements. Make sure you also have the formulas down for determining the number of hosts and subnets a given subnet mask supports. |