Mel's Cheat Sheet
Conversion Tables
Converting IP addresses from binary to decimal 8 bits
7 6 5 4 3 2 1 0
2 1 ? 128
2 1 ? 64
2
2
2
2
2 1 ? 2
2 1 ? 1
1 1 1 1 ? ? ? ? 32 16 8 4 255 Decimal Value
Powers of 2 0 1 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256 9 512 10 1024
11-19 add 3-0's 20-29 add 6-0's 30-39 add 9-0's
Class A # of Subnets 0 2 6 14 30 62 126 254
1 1 1 1 1 1 1
Required # of bits 9 1 0 2 1 3 2 4 3 5 4 6 5 7 6 8
Subnet Mask Invalid 255.192.0.0 255.224.0.0 255.240.0.0 255.248.0.0 255.252.0.0 255.254.0.0 255.255.0.0
Number of Hosts per subnet Invalid 4,194,302 2,097,150 1,048,574 524,286 262,142 131,070 65,534
Address Class Summary RFC 1918 Bits Class 10 0 A
172.16-31 192.168.0-255
# of networks
# of Hosts per network
Range of network IDs (1st octet)
126 16 , 384 2 , 097 , 152
16 , 777 , 214 65 , 534 254
1 - 126 128 - 191 192 - 223
10 110
B C
Guidelines to follow when assigning Network and Host Ids · The network ID cannot be 127. This ID is reserved for loopback and diagnostic functions. · The network ID and the host ID bits cannot all be 1's. If all bits are set to 1, the addresss is interpreted as a broadcast rather than a host ID. · The network ID and the host ID bits canot all be 0's. If all bits are set to 0, the address is interpreted to mean "this network only." Subnet Tips 1. Write down the powers of 2 table 2. Work out the maximum number of hosts on any subnet. Remember to include routers, managed hubs, printers, etc. 3. Work out the maximum number of networks. 4. Using the chart in step 1, find out how many bits are required for your maximum number of hosts (x).** 5. Using the chart in step 1, find out how many bits are required for your number of networks (y).** 6. Add x+y to find out the class of the address you need. (8bits=c, 16bits=b, over 16bits=a) 7. Find out in which octet the subnet boundary is going to fall. 8. Find out the host block size (z) within that octet, consult powers of 2 table. 9. Subtract the block size from 256 for your subnet mask. (remember that 0 counts, 0-255=256) or (256-mask=block size) 10. Write up the valid ranges of ip addresses for your network in blocks of (z), remember to start from 0. 11. Cross out the first and last network. 12. For each of the remaining blocks, add 1 to the first address and subtrack 1 from the last address. 13 . You now have valid ranges of addresses. **Remember that 2 of the number will be invalid.
Class B # of Subnets 0 2 6 14 30 62 126 254
1 1 1 2 2 2 2 2
Required # of bits 7 1 8 2 9 3 0 4 1 5 2 6 3 7 4 8
Subnet Mask Invalid 255.255.192.0 255.255.224.0 255.255.240.0 255.255.248.0 255.255.252.0 255.255.254.0 255.255.255.0
Number of Hosts per subnet Invalid 16,382 8,190 4,094 2,046 1,022 510 254
Class C legal # of Subnets Invalid 1? 2 3? 6 7? 14 15? 30 31? 62 Invalid Invalid 2 2 2 2 2 3 3 3
Required # of bits 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8
Subnet Mask Invalid 255.255.255.192 255.255.255.224 255.255.255.240 255.255.255.248 255.255.255.252 Invalid Invalid
Number of legal Hosts per subnet Invalid 62 30 14 6 2 Invalid Invalid
Total number of bits
Scenario 1 This large company has already been alocated a class B address (150.150.0.0). They have their own managed WAN covering just over 100 locations world-wide. Some of these sites have up to 400 hosts. What Class of address will you need? What is the Subnet Mask? Valid range of addresses. Step 2 Hosts = 400 3 Nets = 100 Line 4 Hosts x=9 bits, 9bits=512, see chart (510 valid hosts) 1 7 6 5 4 5 Nets y=7 bits, 7bits=128, see chart 2 128 64 32 16 6 9+7=16bits, therefore the class would be B 3 128 192 224 240 24 7 The subnet boundary would fall in the 3rd octet Mask Network # Subnet # Host # Line 1 = number of 0's in mask Line 3 = mask Hosts 7bits (nets) 9bits (hosts) Line 1 = # bits (0's) that gime me 8 Host address block size z=2 Line 2 = # hosts (-2) = valid hosts One host bit in 3rd octet, so 1 converts to 2 possible combinations, either 0 or 1 Subnets 9 256-2=254 Line 1 = # of bits (1's) that give me The subnet mask would be 255.255.254.0 Line 2 = # of subnets(-2) = valid subnets 10 Ranges for network (valid & invalid) 1111111000000000 1111111000000 1111111000000000 0000000111111 150.150. 0 . 0 ? 1 . 2 5 5 2 . 0 ? 3 . 255 0000001000000000 0000001111111 4 . 0 ? 5 . 255 0000010000000000 0000010111111 6 . 0 ? 7 . 255 0000011000000000 0000011111111 8 . 0 ? 9 . 255 0000100000000000 0000100111111 ? ?
1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1
Bits 000 000 100 110 111 111 111 111
0 0 0 0 0 1 1 1
0 0 0 0 0 0 1 1 3 8 8
0 0 0 0 0 0 0 1
Mask 128 192 224 240 248 252 254 255 2 4 252
#1's 25 26 27 28 29 30 31 32 1 2 254 0 1 255
11111110 254 11111000 8-2=6 248=3-0's
11000000 192 4-2=2 valid 0 1 1 1 1 1 0 1 1 1 1 1
252 . 0 254 . 0 11&12
253 . 255 255 . 255
1111110000000000 1111111000000000
111111011111111 111111111111111
Figure valid network addresses 1st legal address last legal address 150.150. 0 . 0 ? 1 . 2 5 5 Invalid
1 2 5 4
1111111000000000 1111111000000000 0000001000000001 0000010000000001 0000011000000001 0000100000000001
111111100000000 000000011111110 000000111111110 000001011111110 000001111111110 000010011111110
2 . 0
1
? ? ? ? ? ?
3 . 255
2 5 4
4 . 0
1
5 . 255
2 5 4
6 . 0
1
7 . 255
2 5 4
8 . 0
9 . 255
252 . 0 254 . 0
253 . 255 255 . 255
Invalid
1111110000000001 1111111000000001
111111011111110 111111111111111