Figure 1.12 32-Bit IPv4 Addresses Are Written in Dotted-Decimal Notation
IP Address Classes
IPv4 addresses are categorized into five classes: A, B, C, D, and E. Only Class A, B, and C
addresses are used for addressing devices; Class D is used for multicast groups, and Class E is reserved for experimental use. The first octet of an IPv4 address defines which class it is in, as illustrated in Table 1-1 for Class A, B, and C addresses. The address class determines which part of the address represents the network bits (N) and which part represents the host bits (H), as shown in this table. The number of networks available in each class and the number of hosts per network are also shown.
Table 1-1 IP Address Classes A, B, and C Are Available for Addressing Devices
|
NOTE Class A addresses are any addresses that have the higher-order bit set to 0; this would include 0 through 127 in the first octet. However, network 0.0.0.0 is reserved, and network 127.0.0.0 (any address starting with decimal 127) is reserved for loopback functionality. Therefore, the first octet of Class A addresses ranges from 1 to 126.
NOTE Class D addresses have higher-order bits 1110 and are in the range of 224.0.0.0 to
239.255.255.255. Class E addresses have higher-order bits 1111 and are in the range of
240.0.0.0 to 255.255.255.255. For example, 192.168.5.1 is a Class C address. Therefore, it is in the format N.N.N.H—the network part is 192.168.5 and the host part is 1.
Private and Public IP Addresses
The IPv4 address space is divided into public and private sections. Private addresses are reserved addresses to be used only internally within a company’s network, not on the Internet. When you want to send anything on the Internet, private addresses must be mapped to a company’s external registered address. Public IPv4 addresses are provided for external communication.
|
RFC 1918, Address Allocation for Private Internets, defines the private IPv4 addresses as follows:
■ 10.0.0.0 to 10.255.255.255
■ 172.16.0.0 to 172.31.255.255
■ 192.168.0.0 to 192.168.255.255
The remaining addresses are public addresses.
NOTE Internet RFC documents are written definitions of the Internet’s protocols and policies. A complete list and the documents themselves can be found at http://www.rfc-editor.org/ rfc.html.
In binary format, a subnet mask bit of 1 indicates that the corresponding bit in the IP
address is a network or subnet bit, and a subnet mask bit of 0 indicates that the corresponding bit in the IP address is a host bit. Subnet bits come from the higher-order (leftmost) bits of the host field; therefore, the 1s in the subnet mask are contiguous
In binary format, a subnet mask bit of 1 indicates that the corresponding bit in the IP address is a network or subnet bit, and a subnet mask bit of 0 indicates that the corresponding bit in the IP address is a host bit. Subnet bits come from the higher-order (leftmost) bits of the host field; therefore, the 1s in the subnet mask are contiguous
Table 1.2 IP Address Default Subnet Masks
|
When all of an address’s host bits are 0, the address is for the subnet itself (sometimes called the wire). When all of an address’s host bits are 1, the address is the directed broadcast address for that subnet (in other words, for all the devices on that subnet).
The formula 2s calculates the number of subnets created, where s is the number of subnet bits (the number of bits borrowed from the host field). The formula 2h – 2 calculates the number of host addresses available on each subnet, where h is the number of host bits. For example, 10.0.0.0 is a Class A address with a default subnet mask of 255.0.0.0, indicating 8 network bits and 24 host bits. If you want to use 8 of the host bits as subnet bits instead, you would use a subnet mask of 11111111.11111111.00000000.00000000, which is 255.255.0.0 in decimal format. You could then use the 8 subnet bits to address 256 subnets.
|
. Each of these subnets could support up to 65,534 hosts. The address of one of the subnets is 10.1.0.0; the broadcast address on this subnet is 10.1.255.255. Another way of indicating the subnet mask is to use a prefix. A prefix is a slash (/) followed by a numeral that is the number of bits in the network and subnet portion of the address—in other words, the number of contiguous 1s that would be in the subnet mask. For example, the subnet mask of 255.255.240.0 is 11111111.11111111.11110000.00000000 in binary format, which is 20 1s followed by 12 0s. Therefore, the prefix would be /20 for the 20 bits of network and subnet
information, the number of 1s in the mask.
|
There are three types of subnetting examples I will show in this chapter:
1) Subnetting when given a required number of networks
2) Subnetting when given a required number of clients
3) Given an IP address & Subnet Mask, finding original network range (reverse engineering a subnet problem)
Style 1:-Example 1: A service provider has given you the Class C network range 209.50.1.0. Your company must break the network into 20 separate subnets.
Step 1) Determine the number of subnets and convert to binary
- In this example, the binary representation of 20 = 00010100.
|
Step 2) Reserve required bits in subnet mask and find incremental value
- The binary value of 20 subnets tells us that we need at least 5 network bits to satisfy this requirement (since you cannot get the number 20 with any less than 5 bits – 10100)
- Our original subnet mask is 255.255.255.0 (Class C subnet)
- The full binary representation of the subnet mask is as follows:
255.255.255.0 = 11111111.11111111.11111111.00000000
- We must “convert” 5 of the client bits (0) to network bits (1) in order to satisfy the requirements:
New Mask = 11111111.11111111.11111111.11111000
- If we convert the mask back to decimal, we now have the subnet mask that will be used on all the new networks – 255.255.255.248
- Our increment bit is the last possible network bit, converted back to a binary number:
New Mask = 11111111.11111111.11111111.1111(1)000 – bit with the parenthesis is your increment bit. If you convert this bit to a decimal number, it becomes the number „8‟
Step 3) Use increment to find network ranges
- Start with your given network address and add your increment to the subnetted octet:
209.50.1.0
209.50.1.8
209.50.1.16 …etc - You can now fill in your end ranges, which is the last possible IP address before you start the next range
209.50.1.0 – 209.50.1.7
209.50.1.8 – 209.50.1.15
209.50.1.16 – 209.50.1.23 …etc
You can then assign these ranges to your networks! Remember the first and last address from each range (network / broadcast IP) are unusable
|
Example 2: 172.16.0.0 into 60 subnets
Step 1) Determine the number of subnets and convert to binary
- In this example, the binary representation of 60 = 00111100
Step 2) Reserve required bits in subnet mask and find incremental value
- The binary value of 60 subnets tells us that we need at least 6 network bits to satisfy this requirement (since you cannot get the number 60 with any less than 6 bits – 111100)
- Our original subnet mask is 255.255.0.0 (Class B subnet)
- The full binary representation of the subnet mask is as follows:
255.255.0.0 = 11111111.11111111.00000000.00000000
We must “convert” 6 of the client bits (0) to network bits (1) in order to satisfy the requirements:
New Mask = 11111111.11111111.11111100.00000000
- If we convert the mask back to decimal, we now have the subnet mask that will be used on all the new networks – 255.255.252.0
- Our increment bit is the last possible network bit, converted back to a binary number:
|
New Mask = 11111111.11111111.11111(1)00.00000000 – bit with the parenthesis is your increment bit. If you convert this bit to a decimal number, it becomes the number 4.
Step 3) Use increment to find network ranges
- Start with your given network address and add your increment to the subnetted octet:
172.16.0.0
172.16.4.0
172.16.8.0 …etc
- You can now fill in your end ranges, which is the last possible IP address before you start the next range
172.16.0.0 – 172.16.3.255
172.16.4.0 – 172.16.7.255
172.16.8.0 – 172.16.11.255 …etc
- You can then assign these ranges to your networks! Remember the first and last address from each range (network / broadcast IP) are unusable
Style 2: to find number of clients
Example 1: A service provider has given you the Class C network range 209.50.1.0. Your company must break the network into as many subnets as possible as long as there are at least 50 clients per network.
Step 1) Determine the number of clients and convert to binary
- In this example, the binary representation of 50 = 00110010
Step 2) Reserve required bits in subnet mask and find incremental value
- The binary value of 50 clients tells us that we need at least 6 client bits to satisfy this requirement (since you cannot get the number 50 with any less than 6 bits – 110010)
- Our original subnet mask is 255.255.255.0 (Class C subnet)
- The full binary representation of the subnet mask is as follows:
255.255.255.0 = 11111111.11111111.11111111.00000000
- We must ensure 6 of the client bits (0) remain client bits (save the clients!) in order to satisfy the requirements. All other bits can become network bits:
New Mask = 11111111.11111111.11111111.11 000000 note the 6 client bits that we have saved
- If we convert the mask back to decimal, we now have the subnet mask that will be used on all the new networks – 255.255.255.192
- Our increment bit is the last possible network bit, converted back to a binary number:
New Mask = 11111111.11111111.11111111.1(1)000000 – bit with the parenthesis is your increment bit. If you convert this bit to a decimal number, it becomes the number 64 .
Step 3) Use increment to find network ranges
- Start with your given network address and add your increment to the subnetted octet:
209.50.1.0
209.50.1.64
209.50.1.128
209.50.1.192
|
- You can now fill in your end ranges, which is the last possible IP address before you start the next range
209.50.1.0 – 209.50.1.63
209.50.1.64 – 209.50.1.127
209.50.1.128 – 209.50.1.191
209.50.1.192 – 209.50.1.255
- You can then assign these ranges to your networks! Remember the first and last address from each range (network / broadcast IP) are unusable
Styel3:given ip address and subnet mask to find the actual nos of subnet and clients.
You are given the following IP address and subnet mask:
192.168.1.58
255.255.255.240
- When reverse engineering a problem, all you need to do is break the subnet mask back into binary and find the increment that was used
255.255.255.240 = 11111111.11111111.11111111.11110000
- As before, the last possible network bit is your increment. In this case, the increment is 16
- Use this increment to find the network ranges until you pass the given IP address:
192.168.1.0
192.168.1.16
192.168.1.32
192.168.1.48
192.168.1.64 (passed given IP address 192.168.1.58)
- Now, fill in the end ranges to find the answer to the scenario:
192.168.1.0 – 192.168.1.15
192.168.1.16 – 192.168.1.31
192.168.1.32 – 192.168.1.47
192.168.1.48 – 192.168.1.63 (IP address 192.168.1.58 belongs to this range)
The great exception rule:
- because binary begins counting from zero, these network values may throw off calculations
- 2,4,8,16,32,64,128…….
- These host values may throw off calculations
- 3, 7, 15, 31, 63, 127…….
When subnetting based on the number of networks, SUBTRACT 1 from the number
When subnetting based on the number of hosts per network, ADD 1 to the number
-Follow these rules and you will always be safe
|
Ok !!!!!!!!!! may be you understand the above theory lets ease them with help of some real life problems:
TYPE 1: find number of hosts.(FLSM)
Class C example
Our solution steps are very simple
1) Find number of bits for the host
2) Find the block size
3) What is the increment
|
TYPE 1: find number of hosts.(FLSM)
Class B example
Our solution steps are very simple
1) Find number of bits for the host
2) Find the block size
3) What is the increment
|
|
No comments:
Post a Comment