UEU-co logo

ch07lev1sec2.html


Previous Page Next Page

Understanding TCP/IP

The TCP/IP protocol suite is often referred to as the Internet protocol suite because it was created during the development of the Internet. As it later became integrated into all UNIX servers, TCP/IP entered wide use with large networks (often referred to as enterprise networks). TCP/IP’s scalability from small to large networks and the current heavy interest in connecting LANs to the Internet has enabled TCP/IP to evolve into the most widely used network protocol today. TCP/IP is installed by default on your server running Windows Server 2008. TCP/IP is actually required by the Active Directory and the access protocols that are used to access Active Directory information.

Figure 7.1 shows the TCP/IP stack mapped to the OSI model (it doesn’t map exactly to the seven layers, but it does provide some insight into what the TCP/IP protocols do). The list that follows describes a number of the protocols in the TCP/IP stack, which pop up in other hours in this book.

Figure 7.1. The TCP/IP protocol mapped to the OSI model.

IPv4 Addressing

IP addressing comes in two different formats: IPv4 and IPv6, both of which are supported by Windows Server 2008. Let’s take a look at IPv4 first. With IPv4, each computer (or device, which is referred to as a node) is assigned a 32-bit IP address that resembles the following:

192.168.24.123

The 32-bit address is divided into four groups of eight bits, called octets, with each octet written as a decimal number from 0 to 255, separated from the others by a period (referred to as a dot). Part of the IP address defines the network ID of your network (which is assigned to you when you purchase a range of public IP addresses); the remainder of the address provides the host ID of the individual computer. For instance, the 24.123 in the preceding address might identify a specific computer within the TCP/IP network that has the address 192.168. Note that within TCP/IP networking, the term host is used to refer to a computer on the network.

Three address classes are used for IP addressing

By the Way

IPv4 has been around for nearly 20 years and is actually the fourth version of the IP addressing protocol. IPv4 actually provides a total of 3706.65 million usable IP addresses. Because we will probably run out of IPv4 addresses at some point (there are millions of IPv4 addresses being assigned each year worldwide to end-users and Internet service providers: think about all those new handheld Wi-Fi devices that are coming online), IPv6, which provides a much larger address space than IPv4, is supported by both Windows Server 2008 and Windows Vista. We talk more about IPv6 addressing later in this hour.

Understanding what part of the IP address refers to the network and what part refers to the host is a very important aspect of working with IP addresses. And you can’t really determine either without seeing the subnet mask that goes with the IP address.

Subnet masks are also represented as four dotted-decimal octets. There is a standard subnet mask for each of the IP address classes. For example, the IP address 10.1.1.1 (a Class A address) would have the standard Class A subnet mask of 255.0.0.0.

This combination of the IP address and subnet mask enables you to determine what portion of the address is the network address and which portion provides the host address. Because the 255 (all ones in binary) “ands” out the network portion of the address, only the first octet of the address 10.1.1.1 specifies the network address (10.0.0.0). The second, third, and fourth octets provide the host addressing (0.1.1.1). Table 7.2 provides the default subnet masks for Class A, B, and C networks.

Table 7.2. Typical Subnet Masks
Subnet Mask IP Address Class
255.0.0.0 Class A
255.255.0.0 Class B
255.255.255.0 Class C

Understanding IPv4 Subnetting

IPv4 subnetting is as much art as it is math. When you subnet a range of IP addresses, you are dividing the available addresses into logical subunits. Subnetting enables you to place subnets or logical groupings (in terms of IP addresses) of computers on different router interfaces. This enables you to connect disparate groups of users (at different worksites) into one large IP network.

Subnetting is a two-part process. First, you must determine the subnet mask for the network (it is different from the default subnet masks shown in Table 7.3). Then you must compute the range of IP addresses that will be in each subnet. One way to subnet is to refer to subnetting charts. Tables 7.3, 7.4, and 7.5 show Class A, Class B, and Class C subnetting, respectively.

Table 7.3. Class A Subnetting
Bits Used Subnet Mask # of Subnets Hosts/Subnet
2 255.192.0.0 2 4,194,302
3 255.224.0.0 6 2,097,150
4 255.240.0.0 14 1,048,574
5 255.248.0.0 30 524,286
6 255.252.0.0 62 262,142
7 255.254.0.0 126 131,070
8 255.255.0.0 254 65,534

Table 7.4. Class B Subnetting
Bits Used Subnet Mask # of Subnets Hosts/Subnet
2 255.255.192.0 2 16,382
3 255.255.224.0 6 8,190
4 255.255.240.0 14 4,094
5 255.255.248.0 30 2,046
6 255.255.252.0 62 1,022
7 255.255.254.0 126 510
8 255.255.255.0 254 254

Table 7.5. Class C Subnetting
Bits Used Subnet Mask # of Subnets Hosts/Subnet
2 255.255.255.192 2 62
3 255.255.255.224 6 30
4 255.255.255.240 14 14
5 255.255.255.248 30 6
6 255.255.255.252 62 2

Converting Decimal to Binary

Now the question is, what do these charts mean? IP addresses are actually seen by the computers on the network as a bit stream (a collection of ones and zeros). The address 130.1.16.1 would be represented in binary as this:

10000010 00000001 00010000 00000001

Notice that the bits have been divided into four groups of eight, or octets, just as the dotted-decimal version of the address was (130.1.16.1).

This is how you convert dotted-decimal numbers to binary (bits). Each octet has 8 bits. The decimal value of the bits in an octet, from left to right, is as follows:

128 64 32 16 8 4 2 1

So, the decimal number 130 in the first octet of this address is determined by 128 + 2. This means that the first bit (the 128 bit) and the seventh bit (the 2 bit) are both turned on (they are represented by ones in the binary format). To convert the decimal to the binary, you mark the bits that are turned on with ones and the rest with zeros. You get 10000010 (which is what you saw previously in the binary format of the IP address).

Now about subnetting: Because the network ID portion of IP addresses is fixed (it is provided by your Internet service provider or another provider of IP address ranges), you actually borrow some bits from the leftmost portion of the host ID of the address to create subnets. (Remember, you can’t mess with the network ID portion of the IP address because it is assigned to you.) Let’s walk through an example of subnetting.

Imagine that you want to divide the Class B network of 191.1.0.0 (this is the network address you were assigned by your IP address provider) into 30 subnets.

You can’t touch the first or second octets because they have been assigned. But you can borrow bits starting from the leftmost portion of the third octet. So, you have to determine how may bits you must borrow from the third octet to create 30 subnets. The number of bits that you borrow determines the new subnet mask for your network (which lets all devices on the network know that the network has been divided into 30 logical subnets). The bits you borrow also help you determine the range of IP addresses that will be in each subnet.

Borrowing Bits

First you borrow the bits; you use the decimal values of the bits in the third octet to do this. You want to come up with 30 subnets. The formula that you use to do this is the sum of lower-order bits (required to get as close to 30 as possible) minus 1 (you must subtract 1 because the 0 network address is used for broadcast messages).

Look at the bit values again (shown next). The lower-order bits are the ones on the right (1, 2, 4, and so on). So, you add 1 + 2 + 4 + 8 + 16, which equals 31. Then you subtract 1. You get 30. So, you used the 1, 2, 4, 8, and 16 bits; you borrowed 5 bits.

128 64 32 16 8 4 2 1 < lower-order bits

By the Way

You have to subtract the 1 because you cannot use subnet 0, which is what you derive when you steal only the first lower-order bit (the 1).

The next thing you need to do is determine the subnet mask for the subnetted network. The bits on the left of the decimal values (128, 64, 32, 16, and so on) are referred to as the higher-order bits. You now add the first five higher-order bits:

Higher-order bits> 128 64 32 16 8 4 2 1

128 + 64 + 32 + 16 + 8 = 248

The default subnet mask for a Class B network is 255.255.0.0.

You borrowed 5 bits from the third octet, so your new subnet mask is 255.255.248.0. Check Table 7.4; when you borrow 5 bits from a Class B network, you get the subnet mask that you derived.

Computing the number of host addresses available per subnet is very straightforward. The formula you use is 2X–2, where X is the number of bits left for host addresses after bits have been borrowed for subnetting.

Computing the Host Addresses in a Subnet

You have 30 subnets (remember, that’s what you decided to divide the IP address range into at the outset of this problem). Now you can find out how many addresses you will get for each of the 30 subnets. Normally, on a Class B network, two octets are reserved for host addresses. The network address in this case is 191.1.0.0, so originally two full octets (the third and fourth) were available for node addresses. This was 16 bits total (8 bits from each octet). Then you borrowed 5 bits from the third octet, so 16–5 = 11. You have 11 bits left for node addresses after borrowing 5 bits to create the 30 subnets.

Use the formula 2X–2. You can see that 211–2 is 2,048–2, which equals 2,046 (just as Table 7.4 shows). You get 2,046 addresses per subnet.

Computing Host Ranges

You now have 30 subnets with 2,046 addresses each. Next you need to determine the starting and ending IP addresses for each subnet. This is rather easy, compared to what you’ve done so far. What was the lowest of the higher-order bits used to create the new subnet mask for the subnetted network? You used 128, 64, 32, 16, and 8. The lowest of the high-order bits is 8, which becomes the increment for your subnet address ranges.

The network address is 191.1.0.0, so the first subnet would start with the address 191.1.8.1 (you can’t have a zero in the last position of the address). This subnet would end with 191.1.15.254 (you can’t end an address with 255 in the last octet).

Table 7.6 shows the range of addresses for the first 5 subnets (of 30) using the network address of 191.1.0.0.

Table 7.6. Address Ranges for First Six Subnets
Subnet Address Range
1 191.1.8.1 to 191.1.15.254
2 191.1.16.1 to 191.1.23.254
3 191.1.24.1 to 191.1.31.254
4 191.1.32.1 to 191.1.39.254
5 191.1.40.1 to 191.1.47.254

Notice that you can easily come up with the start of each subnet range by adding 8 to the third octet. The ends of range addresses are just one less (in the third octet) than the start of the next subnet. You could easily continue this table to show all 30 subnets.

Class A and C network addresses can be subnetted in a like manner. Just remember that Class A networks provide you three octets of node address space (the second, third, and fourth), whereas a Class C network address supplies only one octet (the fourth).

Did you Know?

Another way to do subnetting calculations is to download a subnet calculator on the Web. Several free ones can be found by doing a search for subnet calculator in any search engine. You can then tell the calculator how many subnets you want for a specific network address and it gives the subnet mask and the range of addresses for each subnet. It’s easy, but it requires that you at least understand what subnetting is so that you know what the calculator is telling you.

Previous Page Next Page

Leave a Reply


Time limit is exhausted. Please reload the CAPTCHA.

Categories

apply_now Pepperstone Group Limited