# Subnetting via TCP/IP

Δίκτυα και Επικοινωνίες

23 Οκτ 2013 (πριν από 4 χρόνια και 8 μήνες)

82 εμφανίσεις

Table 7-2 Subnet Size, Binary Bit Values, Decimal Values
Subnet Size Measured in Bits Binary Bit Values Value in Decimal
1 10000000 128
2 11000000 192
3 11100000 224
4 11110000 240
5 11111000 248
6 11111100 252
7 11111110 254
Let’s quickly revisit how binary bit values are converted to decimal.
Remember that with binary, we use a base two counting system (versus a
base 10 counting system used in the “real world”). You may recall with the
binary system, any value up to 255 can be represented as either a one (“1”)
or zero (“0”) within a byte or eight-bit positions. This phenomenon can be
displayed two ways: as a “Power of 2” table (see Table 7-3) or as a simple
chart showing the value of each bit position in a byte (see Table 7-4).
Table 7-3 Powers of 2
Bit Position Within Byte Power of 2 Decimal Notation Value
00000001 2
0
1
00000010 2
1
2
00000100 2
2
4
00001000 2
3
8
00010000 2
4
16
00100000 2
5
32
01000000 2
6
64
10000000 2
7
128
270
Part II: TCP/IP
 
4620-1 ch07.f.qc 10/28/99 12:02 PM Page 270
Table 7-4 Value of Each Bit Position in a Byte
Bit Position 1 2 3 4 5 6 7 8
Decimal Value 128 64 32 16 8 4 2 1
Any questions? Great! Let’s move on. Referring back to Table 7-2, notice
that you can place the decimal value (found in the far-right column) in the
fourth octet position of the Class C subnet mask value to further subnet
my network. Here is what I mean. Remember that the subnet mask
communicates to the network which portion of the IP address to mask as the
subnet number, and thus be default; the host number value is the balance. So
if I present the following subnet mask to the network, the network knows that
the first four bits of the fourth octet are “masked” to communicate subnet
number information. This is perhaps better explained in the following table,
wherein we show the details for the subnet mask 255.255.255.240. Note the
table only shows the details for the fourth octet position. Octet positions
one, two, and three would be populated fully with ones (“1s”) to achieve the
value 255.
Table 7-5 communicates that the first four bit positions are masked out as
part of the subnet number, as these bit positions are occupied with a binary
one value and, most importantly, this information is conveyed in the context
of the subnet mask value (where it is meaningful).
Table 7-5 Subnetting Via “240” in the Fourth Octet Position of Subnet
Bit Position 1 2 3 4 5 6 7 8
Decimal Value 128 64 32 16 8 4 2 1
Actual Bit Flags 1 1 1 1 0 0 0 0
Which leads us to an exercise based on the information presented thus far in
the chapter: With the following information, please determine what the
subnet number and the host number are:
Subnet number: _________
Host number: __________
Chapter 7: Subnetting via TCP/IP
271
 
4620-1 ch07.f.qc 10/28/99 12:02 PM Page 271
Table 7-8 Calculating the Host Number (First Four Bit Positions) of the
Fourth Octet Position of IP Address 204.131.7.109
Bit Position 5 6 7 8 Host Number
Decimal Value 8 4 2 1
Actual Bit Flags 1 1 0 1 13
The solution set is:

Subnet number = 96

Host number = 13
You can depict this network graphically, as shown in Figure 7-3:
Figure 7-3: A network with a subnet mask of 255.255.255.240
So if we have a basic understanding of the preceding example, we easily can
interpret the next table, Table 7-9, where the actual bit flags are displayed
for each of the possible subnetting bit values available for a Class C
(255.255.255.x) network. Again, referring to Table 7-2 assists our efforts to
better understand subnetting. The bit portion of the fourth octet position
that relates to the subnet number is in boldface to help in our
comprehension.
255.255.255.240
Network ID: 204.131.7.X
Subnet number -06
IP: 204.131.7.109
Subnet number=96
Host number=13
Chapter 7: Subnetting via TCP/IP
273
 
4620-1 ch07.f.qc 10/28/99 12:02 PM Page 273
Table 7-9Possible Class C Subnetting Values and Impact on
Sample IP Address 204.131.7.109
DescriptionBit1Bit 2Bit 3Bit 4Bit 5Bit 6Bit 7Bit 8Evaluation of sample IP
for each subnetting
example
Subnet mask: 255.255.255.12810000000Subnet number = 0
(INVALID! We can’t have
zero subnets or a subnet
with a value of zero.
Host number = 109
Subnet mask: 255.255.255.19211000000Subnet number = 64
Host number = 45
Subnet mask: 255.255.255.22411100000Subnet number = 96
Host number = 13
Subnet mask: 255.255.255.24011110000Subnet number = 96
Host number = 13
Subnet mask: 255.255.255.24811111000Subnet number = 104
Host number = 5
Subnet mask: 255.255.255.25211111100Subnet number = 108
Host number = 1
Subnet mask: 255.255.255.25411111110Subnet number = INVALID
Host number = INVALID
Decimal values by bit position1286432168421This row is presented to
assist in interpreting this
table.
Binary bit representation of 10901101101This row is presented to
assist in interpreting this
table.
274
Part II: TCP/IP
 
4620-1 ch07.f.qc 10/28/99 12:02 PM Page 274
STEPS:
To convert a decimal value to its binary bit cousin
(continued)
Step 6.Divide 3 by 2.
3/2 = 1 with a remainder of 1.
The bit value is 1.
The cumulative bit order is 101101.
Step 7.Divide 1 by 2.
1/2 = 0 with a remainder of 1.
The bit value is 1.
The cumulative bit order is 1101101.
Step 8.As the division is complete, we add a zero to the final bit position to
“close” the exercise. The resulting bit order is: 01101101.
Congratulations! You just successfully used another tool for converting a
base 10 number to a base 2 number.
You also may use the built-in calculator in Windows 2000 Server for decimal
and binary bit conversions (and as a tool for subnetting).
The built-in calculator is found under the Accessories area from the Start
button (via Programs). After starting the Calculator, perform the following
steps.
STEPS:
Using the built-in calculator for decimal and binary bit
conversions
Step 1.Launch the Calculator applet. Convert the calculator from
Standard view to Scientific view (see Figure 7-4). You accomplish
this via the View menu on the Calculator menu bar.
276
Part II: TCP/IP
 
4620-1 ch07.f.qc 10/28/99 12:02 PM Page 276
STEPS:
Using the built-in calculator for decimal and binary bit
conversions
(continued)
Figure 7-6: The Bin radio button
The Calculator contained within the confines of Windows 2000 Server is truly
a time-saving tool as you implement TCP/IP subnetting on your networks.
And one more take on subnetting so that you are armed completely for your
Windows 2000 Server TCP/IP-related battles. A different tack on subnetting is
to view it from the MCSE perspective. That is, exam cram! A peer from the
industry, John Lambert, shared with readers in Microsoft Certified Professional
Magazine the following points about mastering subnetting from the practical
perspective of just passing the darn TCP/IP certification exam.
Arguably, the TCP/IP elective exam in the MCSE track is the most difficult of
all. This is the exam wherein certification candidates emerge from the testing
room looking like ghosts (or at least with a catatonic gaze). Likewise, I can
say with some degree of certainty that you will encounter the advanced areas
of TCP/IP during your tenure as a Windows 2000 Server professional.
But fear not. It’s really as simple as 1-2-3. That is, the following two charts
serve as your guide to quickly assessing

What class a TCP/IP address falls into (refer to Table 7-10)

The possible number of subnet numbers and host numbers per
subnetting scenario (see Table 7-11)
278
Part II: TCP/IP
 
4620-1 ch07.f.qc 10/28/99 12:02 PM Page 278
Table 7-10 IP Class Chart
Class 1
st
Binary Digits Decimal Range of 1
st
Octet
A 0 1–126
B 10 128–191
C 110 192–223
Two quick questions to test your understanding of advanced TCP/IP
concepts. The answers follow.
Questions:
1.Why is the decimal value 127 not included in the third column of the
preceding table (Table 7-10)?
2.For the Class C row, why are the first binary digits 110 instead of 11?
1.The decimal value 127 can’t be used for network/host IDs, as it is the IP
address area used for loopback testing.
2.IT makes the Class C range end at 223. Remember that initial octet values
ranging between 224–255 are reserved for multicasting, research, and so
on, and may not be used for network/host IDs.
The next table (Table 7-11) is perhaps the most useful of all. At its core, the
table displays the number of subnets and hosts for each subnetting scenario
and IP address. More importantly, it draws out specific relationships that
make you a crack codebreaker... er... subnetter in no time.
Table 7-11 Subnet Mask Chart
Bit Split Subnet Mask Max. Usable # C IPs/# B IPs/#A IPs/
Subnets Subnet Subnet Subnet
2/6 192 2 62 16382 4096K
3/5 224 6 30 8190 2048K
4/4 240 14 14 4094 1024K
5/3 248 30 6 2046 512K
6/2 252 62 2 1022 256K
7/1 254 126 0 510 128K
8 / 0 255 254 0 254 64K
Chapter 7: Subnetting via TCP/IP
279
 
4620-1 ch07.f.qc 10/28/99 12:02 PM Page 279