Subnetting: Subnetting is nothing but creating networks within a network. Subnetting allows an organization with a single IP address (Class A /ClassB /ClassC) to have multiple subnetworks, thus allowing several physical networks with in the organization.
IP addresses are written using decimal numbers separated by decimal points. This is called dotted decimal notation of expressing IP addresses.
The different classes of IP addresses is as below:
|Class||Format||Leading Bit Pattern||Network address Range||Maximum networks||Maximum host/nodes|
|A||N.H.H.H||0||0 - 126||127||16,777,214|
|B||N.N.H.H||10||128 - 191||16,384||65,534|
|C||N.N.N.H||110||192 - 223||20,971,52||254|
|D||Not defined||1110||224 -255||Not defined||Not defined|
|E||Not defined||1111||240-255||Not defined||Not defined|
Network address of all zeros means "This network or segment.
Network address of all 1s means "all networks", same as hexadecimal of all Fs.
Network number 127 is reserved for loopback tests.
Host(Node) address of all zeros mean "This Host (Node)".
Host (Node) address of all 1s mean "all Hosts (Nodes) " on the specified network.
The subnet mask is computed as below:
I. Find the Class of the IP address, in this case it is a class B network. Class B network has the form N.N.H.H. Therefore, we have a total of 16 bits (two octets) for assigning to internal networks and hosts. The minimum number of host addresses required is 500 (see the question). The last octet corresponds to 2^8 = 256 hosts which is still less than 500 Hosts.. Therefore, you have to borrow one more bit from the third octet to make it 256*2 = 512 Hosts. This leaves 7 bits in the third octet for assigning subnet addresses. This is equal to 2^7=128 subnets.
II. Write the 7 bits available for subnetting in third octet in the form 11111110 (last bit being the Host bit). The decimal equivalent of the first seven bits is 2^7+2^6+2^5+2^4+2^3+2^2+2^1= 128 + 64 +32 + 16 + 8 + 4 + 2 = 254.
III. Now the subnet mask required is 255.255.254.0.
Examples on Subnetting
Example1: The following are true about the IP address 192.168.12.5/25
The following are true about the IP address 192.168.12.5/25
Subnet mask: 255.255.255.128
Subnet address: 192.168.12.0
Broadcast address: 192.168.12.127
Lowest valid host address in the given subnet: 192.168.12.1 (A host address of all zeros cannot be used)
Highest valid host address in the given subnet: 192.168.12.126 (A host address of all ones cannot be used)
Valid host address range: 192.168.12.1- 192.168.12.126
Example2: What is the directed broadcast address for an IP network 22.214.171.124 with default subnet mask?
This is a Class C network with default Subnet mask, which is 255.255.255.0. The directed broadcast should reach all hosts on the intended network (or subnet, if subnetted). Therefore, by putting all 1s for the host portion of the IP address, we get 126.96.36.199
Example3: You have a network address of 188.8.131.52 with four subnets. You want to allow for maximum number of Hosts. What is the subnet mask you need to apply?
We want to implement maximum possible Hosts. Therefore, we need to minimize the number of subnets. This minimum number is 4 here. If we reserve 2 bits, it results in 2^2=4 subnets. This is now optimized for maximum number of Hosts (as we have optimized for minimum number of subnets).
Write the 2 bits available for subnetting in fourth octet in the form 11000000 (Six 0s being Host bits). The decimal equivalent is 2^7+2^6= 128 + 64 = 192.
Now the subnet mask required is 255.255.255.192
Example4: You have an IP address of 184.108.40.206 with an 11 bit subnet mask. What are your valid hosts?
220.127.116.11 is a class B IP address and is normally used with a subnet mask of type 255.255.x.x
11 bit subnet mask is equivalent to 255.224.0.0=11111111.11100000.00000000.00000000
Wild card mask-0.31.255.255
Host Min: 18.104.22.168
Host max: 22.214.171.124
Example5: You have a network address of 126.96.36.199 with five hosts on each subnet. You want to allow maximum number of subnets. What is the subnet mask you need to apply?
I. The number of Hosts required are five. We need to add Hosts of all ones and all zeros to this. This is because all zeros and all ones subnets belong to "this Host" and "all Hosts" broadcasts and can not be used. Therefore, the total number of Hosts addresses to be reserved is 5+2 = 7.
II. We want to implement maximum possible subnets. Therefore, we need to minimize the number of Hosts. This minimum number is 7 here. If we reserve 2 bits, it results in only 2^2=4 Hosts which is less than 7. Therefore, we have to reserve 3 bits for implementing Hosts, resulting in 2^3=8 Host addresses. This is now optimized for maximum number of Subnets (as we have optimized for minimum number of Hosts). This also leaves us with 5 bits in the fourth Octet for implementing subnets.
III. Write the 5 bits available for subnetting in fourth octet in the form 11111000 (Five 1s being subnet bits). The decimal equivalent is 2^7+2^6+2^5+2^4+2^3
= 128 + 64 +32 + 16 + 8 = 248.
IV. Now the subnet mask required is 255.255.255.248.
Example6: Which of the following best summarizes the routes 172.24.54.0/24 and 172.24.53.0/24?
1. Take the first IP: 172.24.54.0/24 : 172.24. 0 0 1 1 0 1 1 0.0
2. Take the second IP: 172.24.53.0/24 : 172.24. 0 0 1 1 0 1 0 1.0
Note that we are not really concerned about the octets that have equal decimal values. This is because they donÃ¢â‚¬â„¢t come into play while calculating summarization route, in this case.
Step 2: Count the number of bits in the third octet that are aligned (or lined up) with same values. In this case 6 bits are lined up in the third octet. The summarization route is calculated by adding this number (6) to the octets preceding the third (first and second octets).
Therefore, the number of bits in the summarized route is 8+8+6 = 22
Step 3: Calculate the decimal equivalent for third octet with 6 bits as given in the matching binary. That is 0 0 1 1 0 1 x x. Note x is because it corresponds to non matching binary number. It is equal to 128*0 + 64*0 + 32*1 + 16*1 + 8*0 + 4*1 or 32+16+4 or 52.
Therefore, the summarized route is: 172.24.52.0/22
Example7: Consider the IP address 188.8.131.52. What is the range of binary digits of the first octet in the specified IP address class ?
The address range and the corresponding binary values for the first octet of Ip classes are as given below:
Class A: 0-127 binary: 00000000-01111111
Class B: 128-191 binary: 10000000 - 10111111
Class C: 192-223 binary: 11000000 - 11011111
Class D: 224-239 binary: 11100000 - 11101111
Note that the IP address 184.108.40.206 belongs to class B, and hence the applicable binary address range is 10000000 - 10111111.
Example8: What is the subnet id of the IP address 220.127.116.11/20 ?
The subnet Id of the IP address 18.104.22.168/20 is 22.214.171.124
The available host address range is 126.96.36.199 - 188.8.131.52
Broadcast address: 184.108.40.206
Example9: You have an IP address 220.127.116.11 with a subnet mask of 7 bits. How many hosts and subnets are possible?
Class B network has the form N.N.H.H, the default subnet mask is 16 bits long. There is additional subnet mask of 7 bits long.
7 bits of subnet mask corresponds to (2^7)=128 subnets.
Some times, the subnet mask is specified with the bits available in the default subnet mask. In this case the bits available in default subnet mask is 16. Therefore, total number of bits available in the subnet mask are 16+7=23. If you are given a subnet mask of 23 bits long for a class B address, it is understood that it contains the bits from the default subnet mask as well.
9 bits (16-7) of host addresses corresponds to (2^9-2)=512-2 = 510 hosts.
Note that host IPs corresponding to all zeros and all ones cannot be used.
Example10: You have a class C network with 4 bit subnet mask. How many subnets and Hosts are available to you ?
Class C IP address has the form N.N.N.H. You have 8 bits available for host portion, of which 4 bits are used for subnetting. This means, you have 2^4 = 16 subnets. Similarly, you have 4 bit available for host Ids. This equals 2^4 = 16 host Ids. Out of this, host Ids of all 1s' and all 0s' are reserved. This leaves us with 14 host Ids per subnet.
Example11: You have an IP address of 18.104.22.168 with a 12 bit subnet mask. What are your valid hosts ?
The following IP addresses are recommended by Cisco
1. E-commerce module - Public
2. Intranet website - Public
3. External DNS server - Public
4. Remote-access/VPN module - Public
5. IP address of a webserver located in internal network - Private
Administrative distance: The default administrative distances are as shown in below table
EIGRP - has a default administrative distance of 90 , uses proprietary protocol and uses DUAL algorithm
OSPF - Uses cost as its metric ,elects a DR on each multi-access network
RIPv2 - It uses hop count as metric
eBGP -It is widely used for interconnecting ISPs
The IS-IS protocol is an interior gateway protocol (IGP) that uses link-state information to make routing decisions.
IS-IS is a link-state IGP that uses the shortest-path-first (SPF) algorithm to determine routes. IS-IS evaluates the topology changes and determines whether to perform a full SPF recalculation or a partial route calculation (PRC). This protocol originally was developed for routing International Organization for Standardization (ISO) Connectionless Network Protocol (CLNP) packets.
Like OSPF routing, IS-IS uses hello packets that allow network convergence to occur quickly when network changes are detected. IS-IS uses the SPF algorithm to determine routes. Using SPF, IS-IS evaluates network topology changes and determines if a full or partial route calculation is required.
An IS-IS network is a single autonomous system (AS), also called a routing domain, that consists of end systems and intermediate systems. Intermediate system is the Open System Interconnection [OSI] term for a router.
Given below are the important features of IS-IS routing protocol.
1. IS-IS uses OSI CNLP to communicate with routers
2. Supports VLSM and CIDR.
3. Sends partial route updates only when there are changes
4. Authentication is done in cleartext passwords
5. Administrative distance is 115
6. Suitable alternative for OSPF and EIGRP in large networks.
The following are some of the important characteristics of an autonomous system:
1. An autonomous system consist of routers, that present a consistent view of the routing to the external world.
2. Exterior routing protocols are used for communication between autonomous systems
3. Interior routing protocols are used within a single autonomous system
4. An autonomous system can run both interior and exterior protocol simultaneously.
However, Interior protocols such as RIP, IGRP are used for communication within the autonomous system, and exterior routing protocols such as BGP are used for communication between autonomous systems.