Basic Routing

Categories

Study

Routing is a process which is used to send packets from one network (Source) to another network (Destination) based on routing table. Routing table is used to find best path to destination.

Whenever a router receives a packet, router checks for the destination address means basically checks destination route is available in the routing table or not.
A. If router doesn’t have any route to the destination, it will drop the packet.
B. If it have some entry in routing table, it will forward the packet as per routing table.

Routing Table: Routing table stores the route information means routing table have information about all the networks (directly connected / dynamically learnt / statically configured). A routing table is act like a map for the router. Each router’s routing table is stored in the RAM of the device.
Each entry in the routing table consists of the following entries:
1. Source of route: identified how the route is learned
2. Network and Subnet Mask: Specifies a range of IP address.
3. Outgoing Interface and Next Hop Address: Identifies the exit interface to use when forwarding packets to the network Next Hop Address identifies the IP address of next router to forward packet.

Routing table entries come from the following sources:
1. Directly connected networks
2. Static routes
3. Dynamic routing protocols

Let’s have a look for below routes.

Static Routing:

1. Static routing is the process of manually entering routes into routing table.
2. Less overhead on CPU and less Bandwidth utilization.
3. AD=1 default

Syntax:
ip route <destination_Network> <dest-mask> <next-hop-ip-addr | Exit Interface> {DHCP}[tag num ] [ distance num ] [ name string ]

We can understand static routing config using below diagram:

*** IP routing must be enabled and if we are using next Hop address than must be reachable. If we are using exit interface then exit interface must have ip address and interface must be UP.

Remember one thing multipoint interface require layer3 to layer 2 resolution so next hop address is better choice while configuring static routing.
In point to point interface we should use exit-interface because there is no need of recursion process and layer 2 resolutions.
***A floating static route is a static route with higher administrative distance used as backup of another route. In this way, the floating static route will only appear in the routing table if the dynamically learned route is lost.

Dynamic Routing:
Dynamic routing is a the process of adding route information to routing table using dynamic routing Protocol like RIP, EIGRP, OSPF, BGP. we will discuss these protocols separately.

Routing lookup Process (Router check below things before installing route in routing table and route the traffic)

  1. Longest Prefix Match
  2. Lower Administrative Distance**
  3. Metric
  4. Load Balancing (Per Packet or Per Destination)

Let’s assume that a router has multiple routing processes running on it, and each process has received below routes:

10.0.0.0/24 OSPF
10.0.0.0/26 EIGRP
10.0.0.0/27 RIP
20.0.0.0/24 RIP/EIGRP
Which of these routes will be installed in the routing table?

As each of these routes has a different prefix length (subnet mask), they’re considered as different destinations, and they will all be installed in the routing table. But we are receiving 20.0.0.0/24 from RIP and EIGRP, Route from EIGRP will be installed in routing table as 20.0.0.0/24 from EIGRP has Lower AD.

Please see the below output.

But see how packet forwarding happens in this case. When router receive packet destined to 10.0.0.1 which route would be chosen by router??

It depends on the prefix length. Longer prefixes are always preferred over shorter ones. so packet destined to 10.0.0.1 will be forwarded to 1.1.1.4 because 10.0.0.1 falls within the 10.0.0.0/27 network. It also falls within the other routes available, but the 10.0.0.0/27 has the longest prefix within the routing table. we can see same in traceroute output is going to 1.1.1.4.

IP Routing Process:

Router always go through three generic steps internally when router moves a packet between the interfaces.
1. Routing (Find outgoing interface)
2. Switching (Accept a packet on one interface and forward it to second interface on the same router.)
3. Encapsulation (Builds Layer 2 header.)

Phase1: Routing: find outgoing interface

When router receive an layer 3 packet than check destination address means find longest prefix match . After finding the longest prefix match, next job is to figure-out outgoing interface that router needs to send this packet towards. This is done by recursion process (recurse of lookup process). At this point routing is done.

Remember that the route lookup process will need to do a recursive lookup on any route that references only a next-hop IP address and not an exit interface.

Phase2: Switching:
switching function is the internal process used by router to accept a packet on one interface and forward it to second interface on the same router.

If there are multiple paths to reach a destination doesn’t mean both of them are used for Traffic sharing. Traffic sharing is control by Switching Method.

A. Process Switching:
Process switching requires the CPU to personally involve with every forwarding decision.

Load balancing is on a per-packet basis and the asterisk (*) points to the interface over which the next packet is sent.

B. Fast switching
Fast switching use the CPU but after a packet has been forwarded, information about how to reach destination is stored in fast switching Cache. When another packet going to same destination is seen the Next-Hop information can be re-used from the cache so the processor doesn’t have to look-up and assemble all the information again.

Load balancing is on a per-destination basis and the asterisk (*) points to the interface over which the next destination-based flow is sent.

C. CEF (Cisco Express forwarding)
CEF doesn’t require the first packet of a data flow to be process switched. Rather an entire data flow can forwarded at data plane.

Inbound Interface Outbound interface Switching Method is used
CEF process CEF
CEF Fast CEF
Process CEF Fast [process if IPv6]
Fast CEF Fast [process if IPv6]
Process Fast Fast
Fast process Process

If CEF is configured on inbound interface packet will be CEF switched regardless of configuration on  outbound interface but CEF is not configured on Inbound interface than switching method is used based on  Outbound interface switching Method. By default CEF performs “Per Destination” Load-Sharing.
Commands

no ip route-cache Disables fast switching and enable load balancing on a per-packet basis
ip route-cache Enables fast switching
ip cef Enables standard CEF operation.
ip cef distributed Enables dCEF operation.
R(config-if)#ip load-sharing per-destination
R(config-if)#ip load-sharing Per-packet

Phase3: Encapsulation:-Builds Layer 2 header as per media.

Protocol: – Protocol is pre-defined set of rules and regulation.

There are two type of protocol:-
Routed Protocol:- Set of rules and regulation that are used to carry user traffic.
Routing Protocol:-Routing protocol is set of rules and regulation that is used to exchange routing table between routers. There are two type of routing protocol IGP and EGP.

IGP(Interior Gateway Protocol):

IGP protocols are used two exchange routing information within same AS. There are mainly two type of IGP as below:

1. Distance Vector routing Protocol:-Routers using distance vector protocol do not have knowledge of the entire path to a destination. Distance Vector uses two methods:-
A. Direction in which (or interface to which) a packet should be forwarded.
B. Distance(Metric) from its destination.

2. Link State Routing Protocol: – Routers using link state protocol do have knowledge of the entire path to a destination means all routers know about the paths reachable by all other routers in the network. Link-state information is flooded throughout the link-state domain to ensure all routers possess a synchronized copy of the area’s link-state database.

EGP(Exterior Gateway Protocol ):

EGP protocols are used two exchange routing information b/w different AS.

Autonomous System: – An AS is a group of routers that share similar routing policies and operate within a single administrative domain.

IANA (Internet Assigned Numbers Authority) control the ASN numbering space. There are Two type of autonomous system: –
1. Public ASN
2. Private ASN
0 and 65535 is reserved AS. 64496 through 65511 are reserved for use in documentation 1to 64495 are reserved for public use and 64512 to 65534 are reserved for private use.

Classful Routing Protocol:-

1. Support auto-summarization and we can’t disable it.

2. Doesn’t support Discontigiuous N/W (subnets of major Network address is

separated by a different major Network.)

3. Doesn’t advertise Subnet-mask

4. Doesn’t support VLSM, CIDR and manual summarization.

5. Support FSLM

Classless Routing Protocol:-

1. If support summarization than we can disable it.

2. Support discontigiuous N/W ;VLSM ; manual summarization, CIDR

 

 

 

 

 

 

RIP (Routing information Protocol)

1. RIP is “distance vector” routing protocol.
Distance vector protocol means it has two things: – Distance + Vector
Distance vector routing protocol does not have the knowledge of the entire path to a destination network. Distance vector means a router knows from which neighbor a route was learned, but it does not know where that neighbor learned the route; a router can’t see beyond its own neighbors.

2. By default RIP can send version 1 updates only but can listen version 1 & 2 updates.
3. AD=120
4. Metric=Hop-count(max=15)

5. Update Time=update time is amount of time at which router send rip update(30 sec).
6. Invalid Time=180=the invalid time specifies the amount of time that router should wait before consider a route as invalid. The router marks the route invalid by setting the metric to 16. The route is retained in routing table.
7. Flush Time=Amount of time that router will wait before removing “invalid route” from routing table (240) .
8. Hold-down Time=180

9. In RIP network statement support only classful Network.
10. Best route Calculations are based on the Bellman-Ford algorithm.
11. RIP process is operate at UDP port 520.
12. 25 routes per RIP message (24 if authentication is enabled) means multiple RIP message will be produced if we have more than 24 route or 25route.
13. RIP defines two message types :-
A. Request Message: Used to ask neighboring routers to send an Update.
B. Response Message: Used to carries the Update.

14. There two version of RIP as below:

RIPv1 RIPv2
Classful Routing Protocol:-

  1. Support auto-summarization and we can’t disable it
  2. Doesn’t support Discontigiuous N/W (subnets of major Network address is separated by a different major Network.)
  3. Doesn’t advertise Subnet-mask
  4. Doesn’t support VLSM, CIDR and manual summarization.
  5. Support FSLM
Classless Routing Protocol:-

  1. If support summarization than we can disable it
  2. Support discontigiuous N/W ;VLSM ; manual summarization, CIDR

 

 

 

 

Doesn’t Support Authentication Support Authentication

1.       Clear Text authentication   :-create key and implement at interface level.Key number don’t need to match   

2.       MD5:-  create key and implement at interface level

Key number must be match if key number don’t match the router with a higher key number will receive all the routes and it  will  receive all the routes and store in its routing table whereas the router that has a lower key number will totally ignore all routes.

Updates sent as broadcasts unless the neighbor command is uses which send them as unicast. Updates sent as multicasts (224.0.0.9) unless the neighbor command is uses which send them as unicast.

15. RIP performs a source-validation checks where the source IP address of routing update must be on the same IP Network as one of the addresses defined for the receiving interface. Let’s have a look in below topology where source ip address of routing update is not in same network but still we are receiving route after “no validate-update-source” Command why? because we are disabling sanity checks against source address of routing updates.

Split Horizon: Split horizon is a loop avoidance technique that prevents route from being advertised out the interface through which it was learned.
Route poisoning is used to mark the route as unreachable route .when a router detects that one of its connected routes has failed then it advertise route with infinite metric to neighbors. (What is Poison reverse?)
Triggered update: – If a metric changes for better or for worse, a router will immediately send out an update without waiting for its update timer to expire. Regular updates may still occur along with triggered updates.
Hold-down Time: – Prevents incorrect route information from entering routing tables. Rule: After a route is advertised as down, do not listen to routing updates on that route for a specific period of time! Or A Hold-down prevents regular update messages from reinstating a route that is going up and down (called flapping).

 

Route Filtering:

RIP can use distribute-lists, offset-lists and distance command to filter traffic.

1. Filter route 10.0.10./24 from advertising to eva-wr02 using distribute list.
A. created ACL using below command:
access-list 1 deny 10.0.10.0 0.0.0.255
access-list 1 permit any
B. Apply distribute list using below command:
router rip
distribute-list 1 out Serial1/0 —> means check ACL 1 before advertising update on serail0/0 interface.

 

2. Filter route 20.0.10./24 from receiving at eva-wr01 using offset-list.
Offset-List: Offset-list is a mechanism which is used to increase incoming and outgoing metric of route learns via routing protocol .
Command: offset-list (ACL_Number) {in/out} {offset_value} interface
A. created ACL using below command:
access-list 11 permit 20.0.10.0 0.0.0.255
B. Apply offset-list using below command:
router rip
offset-list 11 in 16 Serial1/0 –> set metric as 16 when route recevied at searil1/0 and match with ACL 11. when route comes as metric 16 in RIP then routes not being install in routing Table.

 

 

1 Comment

Leave a Reply to ปั้มไลค์ Cancel reply

  • Like!! I blog quite often and I genuinely thank you for your information. The article has truly peaked my interest.

    ปั้มไลค์ Reply

Leave a Reply to ปั้มไลค์ Cancel reply

Your email address will not be published. Required fields are marked *

TOP
error: