Sunday, July 22, 2012

Network mask


IP Addressing


Tuesday, July 17, 2012

Dynamic Routing


Dynamic Routing and different types of Dynamic Routing

Static routing allows routing tables in specific routers to be set up by the network administer. Dynamic routing use routing protocol that dynamically discover network destinations and how to get them to them. Dynamic routing allows routing tables in routers to change if a router on the route goes down. Examples of Routing Protocols are RIP, EIGRP and OSPF. 

There are three basic types of routing protocols.

Distance-vector Routing Protocols: Distance-vector Routing Protocols use simple algorithms that calculate a cumulative distance value between routers based on hop count.

Example: RIP

Link-state Routing Protocols: Link-state Routing Protocols use sophisticated algorithms that maintain a complex database of internetwork topology.

Example: OSPF
Hybrid Routing Protocols: Hybrid Routing Protocols use a combination of distance-vector and link-state methods that tries to incorporated  the advantages of both and minimize their disadvantages.
Example: EIGRP

Default Route


What is a Default Route

A Default Route (also known as the gateway of last resort) is a special type of static route. Where a static route specifies a path a router should use to reach a specific destination, a default route specifies a path the router should use if it doesn’t know how to reach the destination.
Default Route is the network route used by a router when there is no other known route exists for a given IP datagram's destination address. All the IP datagrams with unknown destination address are sent to the default route.

How to configure Default Routes

Default Route can be configured by the following IOS commands.
• Router(config)#ip route 0.0.0.0 0.0.0.0 default_gateway [administrative_distance] [permanent]
OR
• Router(config)# ip route 0.0.0.0 0.0.0.0 interface_to_exit [administrative_distance] [permanent]
 

Static Route


What is a Static Route

A static route is a route that is created manually by a network administrator and he give information to a router about way of other router . Static route are typically used in smaller networks. In static routing , the routing table entries are populated manually by a network administrator.

The opposite of a static route is a dynamic routing. In dynamic routing, the the routing table entries are populated with the help of routing protocol.

The major advantages of static routing are reduced routing protocol router overhead and reduced routing protocol network traffic. The major disadvantages of static routing are network changes require manual reconfiguration in routers and network outages cannot be automatically routed around. Also it is difficult to configure static routing in a complex network.

How to configure Static Routes

Static Route can be configured by the following IOS commands.
• Router(config)#ip route destination_network subnet_mask default_gateway [administrative_distance] [permanent]
OR
• Router(config)# ip route destination_network subnet_mask interface_to_exit [administrative_distance] [permanent]
The permanent keyword will keep the static route in the routing table even when the interface the router uses for the static route fails.

Example


the following IOS commands to open the fast ethernet interface Fa0/0 configuration mode on Router01 and configure IP address as 172.16.0.1/16.

Router01>enable
Router01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router01(config)#interface fa0/0
Router01(config-if)#ip address 172.16.0.1 255.255.0.0
Router01(config-if)#no shutdown

Use the following IOS commands to open the serial interface S0/0 configuration mode on Router01 and configure IP address as 172.17.0.1/16. You have to set a clock rate also using the "clock rate" command on S0/0 interface, since this is the DCE side.

Router01>enable
Router01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router01(config)#interface s0/0
Router01(config-if)#clock rate 64000
Router01(config-if)#ip address 172.17.0.1 255.255.0.0
Router01(config-if)#no shutdown

Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router.

Static Routing configuration in Router

Connect to Router console and use the following IOS commands to configure static routing in Router. The "ip route" commands shown below states that to reach 172.18.0.0/16, 172.19.0.0/16 and 172.20.0.0/16 networks, handover the packets to the gateway ip address 172.17.0.2. The networks 172.16.0.0/16 and 172.17.0.0/16 are conneted directly to Router

Router01>enable
Router01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router01(config)#ip route 172.18.0.0 255.255.0.0 172.17.0.2
Router01(config)#ip route 172.19.0.0 255.255.0.0 172.17.0.2
Router01(config)#ip route 172.20.0.0 255.255.0.0 172.17.0.2

Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router. To view the routing table in Router01, run "show ip route" command in Router01 as shown below.

Router01#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 172.16.0.0/16 is directly connected, FastEthernet0/0
C 172.17.0.0/16 is directly connected, Serial0/0
S 172.18.0.0/16 [1/0] via 172.17.0.2
S 172.19.0.0/16 [1/0] via 172.17.0.2
S 172.20.0.0/16 [1/0] via 172.17.0.2

The "S" character at the beginning of a line in routing table shows that it is a static route and "C" character shows that it is a directly connected network.


Friday, July 13, 2012

Routing Information Protocols


Routing Information Protocol(RIP)


IP RIP (Routing Information Protocol) comes in two different versions: 1 and 2. Version is a distance vector protocol (RFC 1058) and Version 2 is a hybrid protocol (RFCs 1721 and 1722).

Routing Information Protocol Version 1 (RIPv1)

RIPv1 uses local broadcasts to share routing information. These updates are periodic in nature, occurring, by default, every 30 seconds. To prevent packets from circling around a loop forever, both versions of RIP solve counting to infinity by placing a hop count limit of 15 hops on packets. Any packet that reaches the sixteenth hop will be dropped. RIPv1 is a classful protocol. RIP supports up to six equal-cost paths to a single destination. Equal-cost path are the paths where the metric is same (Hop count).

Routing Information Protocol (RIPv2)

RIPv2 is a distance vector protocol with routing enhancements built into it, and it is based on RIPV1. Therefore, it is commonly called a hybrid protocol.
RIPv2 uses multicasts instead of broadcasts. RIPv2 supports triggered updates. when a change occurs, a RIPv2 router will immediately propagate its routing information to its connected neighbours. RIPv2 is a classless protocol and it supports variable-length subnet masking (VLSM).
Both RIPv1 and RIPv2 uses hop count as the metric.

Differences between RIPv1 and RIPv2

RIPv1

• Supports only classful routing (Does not support VLSM).
• No authentication.
• RIPv1 uses Broadcast.

RIPv2

• Supports classless routing (Supports VLSM). RIPv2 incorporates the addition of the network mask in the update to allow classless routing advertisements.
• Authentication is available.
• RIPv2 uses multi-cast instead of broadcast. multicast communication reduces the burden on the network devices that do not need to listen to RIP updates.


      

Routing Information Protocol (RIP) Configuration

Routing Information Protocol (RIP) can be configured in a router using the following IOS commands. The "version 2" IOScommand specifies that we are using RIPv2.
Router>enable
Router#configure terminal
Router(config)# router rip
Router(config-router)# version 2
Router(config-router)# network network_id

Hostname and IP address configuration in Router01

Connect to Router01 console and use the following IOS commands to configure host name as Router01.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router01
Router01(config)#
Use the following IOS commands to open the fast ethernet interface Fa0/0 configuration mode on Router01 and configure IP address as 172.16.0.1/16.
Router01>enable
Router01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router01(config)#interface fa0/0
Router01(config-if)#ip address 172.16.0.1 255.255.0.0
Router01(config-if)#no shoutdown
Use the following IOS commands to open the serial interface S0/0 configuration mode on Router01 and configure IP address as 172.17.0.1/16. You have to set a clock rate also using the "clock rate" command on S0/0 interface, since this is the DCE side.
Router01>enable
Router01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router01(config)#interface s0/0
Router01(config-if)#clock rate 64000
Router01(config-if)#ip address 172.17.0.1 255.255.0.0
Router01(config-if)#no shutdown
Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router.

Hostname and IP address configuration in Router02

Connect to Router02 console and use the following IOS commands to configure host name as Router02.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router02
Router02(config)#
Use the following IOS commands to open the fast ethernet interface Fa0/0 configuration mode on Router02 and configure IP address as 172.18.0.1/16.
Router02>enable
Router02#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router02(config)#interface fa0/0
Router02(config-if)#ip address 172.18.0.1 255.255.0.0
Router02(config-if)#no shutdown
Use the following IOS commands to open the serial interface S0/0 configuration mode on Router02 and configure IP address as 172.17.0.2/16.
Router02>enable
Router02#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router02(config)#interface s0/0
Router02(config-if)#ip address 172.17.0.2 255.255.0.0
Router02(config-if)#no shutdown
Use the following IOS commands to open the serial interface S0/1 configuration mode on Router02 and configure IP address as 172.19.0.1/16. You have to set a clock rate also using the "clock rate" command on S0/1 interface, since this is the DCE side.
Router02>enable
Router02#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router02(config)#interface s0/1
Router02(config-if)#clock rate 64000
Router02(config-if)#ip address 172.19.0.1 255.255.0.0
Router02(config-if)#no shutdown
Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router.

Hostname and IP address configuration in Router03

Connect to Router03 console and use the following IOS commands to configure host name as Router03.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router03
Router03(config)#
Use the following IOS commands to open the fast ethernet interface Fa0/0 configuration mode on Router03 and configure IP address as 172.20.0.1/16.
Router03>enable
Router03#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router03(config)#interface fa0/0
Router03(config-if)#ip address 172.20.0.1 255.255.0.0
Router03(config-if)#no shutdown
Use the following IOS commands to open the serial interface S0/1 configuration mode on Router03 and configure IP address as 172.19.0.2/16.
Router03>enable
Router03#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router03(config)#interface s0/1
Router03(config-if)#ip address 172.19.0.2 255.255.0.0
Router03(config-if)#no shutdown
Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router.

Routing Information Protocol Version 2 (RIPv2) configuration in Router01

Connect to Router01 console and use the following IOS commands to configure Routing Information Protocol Version 2 (RIPv2) in Router01. Please refer the beginning of this lesson to view the Routing Information Protocol Version 2 (RIPv2) configuration IOS commands.
Using the IOS "network" command, as shown below, we specify only the directly connected networks of this router.
Router01>enable
Router01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router01(config)#router rip
Router01(config-router)#version 2
Router01(config-router)#network 172.16.0.0
Router01(config-router)#network 172.17.0.0
Router01(config-router)#exit
Router01(config)#exit
Router01#
Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router.

Routing Information Protocol Version 2 (RIPv2) configuration in Router02

Connect to Router02 console and use the following IOS commands to configure Routing Information Protocol Version 2 (RIPv2) in Router02. Please refer the beginning of this lesson to view the Routing Information Protocol Version 2 (RIPv2) configurationIOS commands.
Using the IOS "network" command, as shown below, we specify only the directly connected networks of this router.
Router02>enable
Router02#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router02(config)#router rip
Router02(config-router)#version 2
Router02(config-router)#network 172.17.0.0
Router02(config-router)#network 172.18.0.0
Router02(config-router)#network 172.19.0.0
Router02(config-router)#exit
Router02(config)#exit
Router02#
Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router.

Routing Information Protocol Version 2 (RIPv2) configuration in Router03

Connect to Router03 console and use the following IOS commands to configure Routing Information Protocol Version 2 (RIPv2) in Router03. Please refer the beginning of this lesson to view the Routing Information Protocol Version 2 (RIPv2) configurationIOS commands.
Using the IOS "network" command, as shown below, we specify only the directly connected networks of this router.
Router03>enable
Router03#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router03(config)#router rip
Router03(config-router)#version 2
Router03(config-router)#network 172.19.0.0
Router03(config-router)#network 172.20.0.0
Router03(config-router)#exit
Router03(config)#exit
Router03#
Do remember to run the "copy running-config startup-config" command from enable mode, if you want to save the changes you have made in the router.

How to view the routing table in Router01

After the network is converged after the initial configuration and Routing Information Protocol Version 2 (RIPv2) configuration, we can use the "show ip route" to view the routing table in Router01, as shown below.
Router01>enable
Router01#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 172.16.0.0/16 is directly connected, FastEthernet0/0
C 172.17.0.0/16 is directly connected, Serial0/0
R 172.18.0.0/16 [120/1] via 172.17.0.2, 00:00:22, Serial0/0
R 172.19.0.0/16 [120/1] via 172.17.0.2, 00:00:22, Serial0/0
R 172.20.0.0/16 [120/2] via 172.17.0.2, 00:00:22, Serial0/0
The "R" character at the beginning of a line in routing table shows that it is a route discovered by Routing Information Protocol Version 2 (RIPv2) and "C" character shows that it is a directly connected network.

How to view the routing table in Router02

When the network is converged after the initial configuration and Routing Information Protocol Version 2 (RIPv2) configuration, we can use the "show ip route" to view the routing table in Router02, as shown below.
Router02>enable
Router02#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
R 172.16.0.0/16 [120/1] via 172.17.0.1, 00:00:07, Serial0/0
C 172.17.0.0/16 is directly connected, Serial0/0
C 172.18.0.0/16 is directly connected, FastEthernet0/0
C 172.19.0.0/16 is directly connected, Serial0/1
R 172.20.0.0/16 [120/1] via 172.19.0.2, 00:00:20, Serial0/1
The "R" character at the beginning of a line in routing table shows that it is a route discovered by Routing Information Protocol Version 2 (RIPv2) and "C" character shows that it is a directly connected network.

How to view the routing table in Router03

When the network is converged after the initial configuration and Routing Information Protocol Version 2 (RIPv2) configuration, we can use the "show ip route" to view the routing table in Router03, as shown below.
Router03>enable
Router03#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
R 172.16.0.0/16 [120/2] via 172.19.0.1, 00:00:02, Serial0/1
R 172.17.0.0/16 [120/1] via 172.19.0.1, 00:00:02, Serial0/1
R 172.18.0.0/16 [120/1] via 172.19.0.1, 00:00:02, Serial0/1
C 172.19.0.0/16 is directly connected, Serial0/1
C 172.20.0.0/16 is directly connected, FastEthernet0/0
The "R" character at the beginning of a line in routing table shows that it is a route discovered by Routing Information Protocol Version 2 (RIPv2) and "C" character shows that it is a directly connected network.

Verify the connectivity between networks using the ping command

To verify the Routing Information Protocol Version 2 (RIPv2) routes and the connectivity between networks, run the ping command from Host01 (IP address: 172.16.0.10/16) to Host03 (IP address: 172.20.0.10/16).
C:\>ping 172.20.0.10
Pinging 172.20.0.10 with 32 bytes of data:
Reply from 172.20.0.10: bytes=32 time=172ms TTL=125
Reply from 172.20.0.10: bytes=32 time=188ms TTL=125
Reply from 172.20.0.10: bytes=32 time=157ms TTL=125
Reply from 172.20.0.10: bytes=32 time=188ms TTL=125
Ping statistics for 172.20.0.10:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 157ms, Maximum = 188ms, Average = 176ms
The ping reply from Host03 (IP address: 172.20.0.10/16) shows that the Routing Information Protocol Version 2 (RIPv2) is configured well in three routers and there is network connectivity between different networks.

Thursday, July 12, 2012

Routing Fundamentals


Routing Fundamentals




When IP packets travel over the Internet, routing information is exchanged between the devices that control the flow of information over the Internet. These devices are known as routers, and they use the IP address as the basis for controlling the traffic. These devices need to talk the same language to function properly, though they belong to different administrative domains. For example, one router may be in Newyork(US), and the receiving router may be in London (UK). It is necessary that a routing protocol is followed for smooth flow of traffic. Given below are the widely used routing protocols for routing Internet traffic:
  • RIP v1
  • RIP v2
  • OSPF
  • IGRP
  • EIGRP
  • BGP
Notations used: Routing Information Protocol (RIP), Open Shortest Path First (OSPF), Interior Gateway Routing Protocol (IGRP), Enhanced Interior Gateway Routing Protocol (EIGRP), and Border Gateway Protocol (BGP).
One often get confused between a routing protocol and a routed protocol. A routing protocol such as RIP is used to route information packets over the Internet, where as a routed protocol such as IP (or IPX) is the payload (contains data) that get routed from source to the destination.
Routing protocols are primarily distinguished into three types:
  • Distance Vector Protocols
  • Link State Protocols
  • Hybrid Protocols
RIP is an example of distance vector protocol. IS-IS is an example of Hybrid protocol, and OSPF is an example of Link State Protocol.



Link State vs. Distance Vector

Distance Vector routing protocols usually send their entire routing table to their nearest neighbors at regular intervals. A router that receives several such routing tables filter the routes and arrive at its own and retransmits it to its neighbouring routers. There will some period of time where different routers hold non-optimized routes initially. After some time, known as convergence time, a final routing table is arrived at by all the routers. A faster convergence time results in a stable network.
RIP, as mentioned earlier uses hop count as the metric for computing a route to a given destination. Other Distance Vector routing protocols, such as IGRP, improve on this by using hop count, bandwidth, current load, cost, and reliability to determine the best path.
Link State routing protocols usually send only the routing changes to every other router within their area. Unlike Distance Vector, routers using Link State routing protocols maintain a picture of the entire network. A router can use this network wide information to determine the best route for traffic.


Example Question:
What is true about IP routing?
A. The frame changes at each hop
B. The source IP address changes at each hop
C. The destination IP address changes at each hop
D. The hardware interface addresses remain constant

Correct answer: A

Explanation:
IP Packets are transported from source network to the destination network by what is known as routing. Hop-by-hop routing model is used by the Internet for delivery of packets. At each hop, the destination IP address is examined, the best next hop is determined by the routing protocol (such as RIP, OSPF or BGP) and the packet is forwarded by one more hop through this route. The same process takes place at the next hop. During this process, the logical addresses remain same. In an IP network, the logical addresses are IP addresses. The hardware interface addresses, such as MAC address change with each hop.