What is a Router?

Router is a network hardware device that is used to connect two different networks. It works on layer 3 (network layer).

The primary function of a router is- to forward the packets from one network to another by choosing a best path. Routers manage routing table that contains a list of best path.

What is routing?

Routing is the process of selecting a best path. In a network, there are many routes in between source and destination. But we want a best path, where traffic congestion is less and packets are delivered fast.

Router’s internal network layer routing for each packet from beginning to arriving in a router interface:

What is routing?

Steps:

1. Check frame check sequence (FCS), to ensure frame had no error, if error found frame is discarded.

2. If there is no error, then it removes the data link header and trailer, and IP packet remains.

3. Then, first check the destination IP inside the packet, then check the routing table and this tells the outgoing interface of router and next hop address.

4. Encapsulate the IP packet inside a new data-link header and trailer and forward the frame.

Types of routing:

Types of routing

1.Static Routing: In static routing, commands are manually configured by network administrator. The routes, which configured by using static routing are permanent routes. These routes will not changed until changed by manual configuration.

To configure static routing, we require network ID, subnet mask and next-hop address. Static routing is used for small organizations within a network of 10-15 routers. Static routes are fast and secure. AD value of static route is 1.

Configuring Static Route: There are two ways to configure static routing.

  1. Router(config)# ip route <Destination Network ID> <Destination Subnet Mask> <Next-hop IP address >
  1. Router(config)# ip route <Destination Network ID> <Destination Subnet Mask> <Exit interface type><interface number>

Check static routing lab

  1. Default Routing:Default routing is configured only when destination is unknown. It is also configured manually. Default routing path is least preferred path. When there is no entry for the destination network in a routing table, the router will forward the packet to its default route.

Configuring Default Route

  1. Router(config)# ip route <Destination Network ID> <Destination Subnet Mask> <Next-hop IP address >
  1.  Router(config)# ip route <Destination Network ID> <Destination Subnet Mask> <Exit interface type><interface number>
  2. Dynamic Routing: In dynamic routing, we configure a dynamic routing protocol that learns routes automatically and also when changes are happened in network updates the routing table accordingly. For example for internal gateway routing (IGP), we use OSPF, EIGRP and IS-IS and for external gateway protocol (EGP) BGP is used.

Advantages of Dynamic over static routing :

  • There is no need to know the destination networks.
    • Need to advertise the directly connected networks.
    • Updates the topology changes dynamically.
    • Administrative work is reduced
    • Used for large organizations.
    • Neighbor routers exchange routing information and build the routing table automatically.

Dynamic Routing Protocols: divided into two categories-

  1. IGP (Interior Gateway Protocol): IGP are used within an autonomous system.

RIP, IGRP, EIGRP, OSPF, IS-IS come under IGP protocols.

  1.  EGP (Exterior Gateway Protocol): EGP are used between different autonomous system. BGP is the only protocol that lies under EGP.

What is AD value?

AD stands for administrative distance. When router learns two different paths for same destination by using different protocols. In that situation to decide which is best path, router first checks AD value. The path that has lower AD value, is considered as best path. AD values are predefined.

Here are the default AD values for different routing protocols-

Routing Protocol

Administrative Value (AD)

Connected route

0

Static route

1

RIP

120

IS-IS

115

OSPF

110

EIGRP

90

External EIGRP

170

BGP

20

Internal BGP

200

Unknown

255

Now, some of you might have a question? If router learns two routes for same destination by using same protocol, then AD value will be same, in that case how will router select a path?

Here is the answer, to select the best path when both are learned by same protocol, router use metric. Lower metric path is selected. If both have same metric value then both will be added in the routing table and traffic will be load balanced on both routes.

In short, router check metric value when both routes are learned via same protocol. And check AD value when paths are learned by different protocol.

Routing Protocol

Metric

RIP

Hop Count

EIGRP

Metric based on Bandwidth and delay(default)

OSPF

Cost

IS-IS

Cost

What is floating static route?

By default, AD value of static route is 1. But you can configure it manually. By changing the Administrative value, you can make it less preferred than other routes learned by other routing protocols.

So, we can say when static route is manually configured with higher AD value then it is called as floating static route.