Friday, 1 April 2016

Subnetting

Note:

Step 1: 1st we represent the / value in binary notation. calculate the CIDR value for New Subnet Mask (N.S.M).

Step 2: 1st we check how many on-bit in your IP-Address for example 195.168.10.1 this IP belongs to Class C and there is total 3-network and one host (N=24 bits, H=8 bits). 1st we check how many on-bit in your Host part not in network part. if there is any on-bits in your Host part then you put in formula
i.e. (2^on-bits)

Step 3: In this step we check how many off-bits in your IP address. for example: Total 8 off-bits & put these number of bits in formula
i.e. (2^off-bits-2)

Step 4: In Block Size we directly subtract your N.S.M with 256.
i.e. (256 - N.S.M)

Step 5: Range always start from 0. i.e. (0-255)

How to calculate Subnetting?

Q.1 Subnet the IP Address 195.168.10.0/24?a) How many subnet?b) How many host per subnet?c) What is block size?d) What is the range?e) What is the broadcast address?

Solution:

IP Address     =    195.168.10.0/24
Subnet mask  =    255.255.255.0 (class c)

In binary notation
11111111.11111111.11111111.00000000
New Subnet Mask  = 255.255.255.0

Number of Subnet = (2^on-bits)
                               = 20
                               = 1

Number of host/subnet = (2^off-bits-2)
                       = 28
                       = 256

Block Size = (256 – New Subnet Mask)
          = 256 – 0
          = 256

Range        (0-255)

1st Subnet:
IP Address          = 195.168.10.0
1st Valid Host     = 195.168.10.1
2nd Valid Host    = 195.168.10.2
                                                   -
                                                   -
                                                   -
Last Valid Host   = 195.168.10.254
Broadcast      = 195.168.10.255


a) Number of Subnet = 1
b) Host/subnet           = 256
c) Block Size             = 256
d) Range                    = (0-255)
e) Broadcast address = 195.168.10.255




Default Routing


Default Route is also known as gateway of last resort which is a special type of static route. Static route allows traffic to be forwarded even without a specific route to a particular network.In default route all network and subnet mask is identified by all zeros (0.0.0.0 0.0.0.0).
• It is used when the destination is unknown, for example internet.
• It can also be used at the end location where there is only one exit path for any destination.
• Default routes help in reducing the size of your routing table.
• If the routers do not find an entry for the destination network in a routing table the router will forward the packet to its default route.
• It’s also known as default gateway.



Router 0:
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface FastEthernet0/1
Router(config-if)#ip address 192.168.10.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#exit
Router(config)#interface Serial 0/1/0
Router(config-if)#ip address 192.168.30.1 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to up
Router(config-if)#exit
Router(config)#do write
Building configuration...
[OK]

• Configure a Default Routing Protocol:
Router(config)#ip route [destination network] [subnet mask] [next hop/exit interface]
Router(config)#ip route 0.0.0.00.0.0.0 192.168.30.2

Router 1:
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 192.168.20.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#interface Serial 0/1/0
Router(config-if)#ip address 192.168.30.2 255.255.255.0
Router(config-if)#no clock rate
This command applies only to DCE interfaces
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to up
Router(config-if)#exit
Router(config)#do write
Building configuration...
[OK]

 Configure a Default Routing Protocol:
Router(config)#ip route [destination network] [subnet mask] [next hop/exit interface]
Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.30.1





Static Routing Protocol


  • Static routing is not really a type of routing protocol, but it is a network routing technique because it usually managed by the network administrator for configuration as well as a selection of a network route. 
  • Static routing can be used if there is the smallest network for route configuration and there is no need to exchange any change in route in the future.
  • It is easy to configure, but it is done manually.
  • It used for small organizations because the administrator needs to learn all the routes.
  • It doesn’t handle failures outside the networks well because it reconfigured or any update done manually to fix the network problem.
  • In static routing administrator constructs the routing table for every router by inserting all the entries of network (destination).
  • Static routes have an Administrative Distance (AD) of 1.
  • It is very secure because it can’t send any advertisement, like other routing protocols.
  • In static routing protocol there is no routing algorithm or update mechanism are required (no need extra CPU and memory).
  • If there is any link fails, then static route can’t reroute traffic automatically. It needs to reroute traffic manually.



Static Routing

 Configuration  a static routing:


Router 1:
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 192.165.10.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface Serial0/1/0
Router(config-if)#ip address 20.1.1.1 255.0.0.0
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
Router(config-if)#exit

 Configure a static route:
Router(config)# ip route [destination network] [subnet mask] [next hope IP]
Router(config)#ip route 172.16.0.0 255.255.0.0 20.1.1.2

Router 2:
Router>enable
Router#configure terminal
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 172.16.1.1 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface Serial0/1/0
Router(config-if)#ip address 20.1.1.2 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit

 Configure a static route:
Router(config)# ip route [destination network] [subnet mask] [next hope IP / exitinterface ]
Router(config)#ip route 192.165.10.0 255.255.255.0 20.1.1.1

NOTE :
• Next hope IP is the IP address of the directly connected router which the packet will
be send, after it leaves the Router1.
• Exit interface is the interface of Router1 which the packet leaving




OSPF Routing Protocols


• OSPF is an open standard routing protocol, it means it is implemented for large scale that are not used by other routing protocols either it is a distance vector(RIP) or hybrid protocol (EIGRP), and it works on a variety of network vendor including Cisco. It uses Dijkstra algorithm, i.e. best for implementing in a hierarchical design. 
• OSPF introduce the concept of areas for managing and controlling the network traffic. It creates a neighbor relationship with adjacent routers in the same area.
• OSPF provides hierarchical network design with multiple different areas and all other areas must be connected to the area 0. 
• OSPF uses a multicast address (224.0.0.5) for routing updates (all OSPF routers), but all designated routers use the different multicast address (224.0.0.6) for routing updates.
• OSPF is a link-state routing protocol which is also known as “shortest path first” protocol.
• It creates three separate tables for understanding the inter-network.
• First table gets all the information about directly connected neighbor. 
• Second table determines the topology of the entire inter-network. 
• Third tables used as routing table.
• OSPF consists of the areas and autonomous systems. 
• It have unlimited hop count.
• On OSPF routing overhead is decreased and convergence is faster. 
• It sends the packets after every 5 seconds. 
• It also supports authentication. 


• It only supports equal cost load balancing. Metric is cost (cost= 10^8/b.w).