Skip to main content

Some Basic Routing Concepts

 Routing Concepts Summary

Classical IOS vs. IOS XE: Classical IOS is monolithic, meaning all features are in one file, and failures in one function can cause the entire system to fail, requiring a reboot for upgrades. IOS XE is used on ASR1K and operates more like Linux with an IOS interface, allowing access to the Linux shell and daemon-based operations.

Prefix Lists: Prefix lists match both the prefix and prefix length for routing decisions. EIGRP can advertise directly connected networks without extra configuration. The "ge" option helps define specific prefix ranges.

IP Routing Overview: Routers forward packets by comparing the destination IP address to the routing table, always choosing the most specific match (longest match rule). Static routes can remain even if the next-hop becomes unreachable using the "permanent" keyword.

IP Packet Fields:

  • Version: Identifies the IP version (e.g., IPv4).
  • Header Length: Defines the length of the IP header.
  • Type of Service (TOS): Sets the handling priority for packets.
  • TTL: Limits packet lifetime to prevent endless wandering in networks, often used as a hop count.
  • Fragmentation: Routers fragment packets if they exceed the MTU of a link. The "More Fragments" bit helps keep track of fragments during reassembly.

Subnetting and VLSM: Subnets divide larger networks into smaller segments. Variable Length Subnet Masks (VLSM) allow the use of different masks in a network, conserving IP addresses.

CIDR (Classless Interdomain Routing): CIDR allows for route summarization, reducing routing table sizes and supporting efficient IP allocation.

Classful vs. Classless Routing: Classful routing protocols like RIP and IGRP assume a default subnet mask, while classless protocols like OSPF, EIGRP, and IS-IS explicitly advertise masks.

Traceroute: Uses the TTL field to trace a route by incrementing TTL for each router along the path, gathering source addresses from routers that decrement TTL to zero.

ARP Concepts:

  • Proxy ARP: Routers respond to ARP requests on behalf of devices when no default gateway is set, mapping multiple IP addresses to the router's MAC address.
  • Gratuitous ARP: Used for duplicate address detection or updating ARP caches with new hardware addresses.
  • Reverse ARP (RARP): Maps an IP address to a known hardware address, used by devices without pre-configured IPs.

Cisco Express Forwarding (CEF):

  • Planes: Divides functions into management (admin tasks), control (packet-forwarding decisions), and data planes (actual traffic forwarding).
  • FIB and Adjacency Table: The FIB (Forwarding Information Base) is used for faster packet forwarding based on routing data. The adjacency table contains Layer 2 header information needed to forward packets to the next hop.

Process Switching vs. Fast Switching vs. CEF:

  • Process Switching: CPU processes every packet, slower.
  • Fast Switching: Caches route info for faster lookups.
  • CEF: Hardware-based forwarding for faster, efficient packet switching.

Distance Vector vs. Link State Routing:

  • Distance Vector: Routers share their routing tables with neighbors, but only know the next-hop and metric to reach destinations.
  • Link State: Routers exchange link states and build a full map of the network, calculating the best path using the Shortest Path First (SPF) algorithm. Link state protocols (OSPF, IS-IS) are faster and less prone to loops.

Path Vector Algorithm: Used by BGP, this protocol selects paths based on attributes like AS-Path, MED, and Local Preference.

Directed Broadcast: Packets sent to a valid broadcast address for a subnet but originating from outside that subnet are forwarded as unicast until they reach the target subnet, where they are broadcast.

Routing Metrics:

  • Delay: Measures the time for a packet to traverse a route, considering factors like queuing and router latency.
  • Reliability: Based on the likelihood of link failure or error rates.

Path Selection: Routers choose paths based on prefix length (longest match), administrative distance (AD), and metrics like hop count or delay.

Administrative Distance (AD): Measures the trustworthiness of routing protocols; lower AD is preferred. AD can be modified to prioritize routes learned via different protocols (e.g., EIGRP vs. OSPF).

TCP Options: Includes Maximum Segment Size (MSS), which specifies the largest segment the sender can accept, padded with zeros for alignment.

Process Switching: Routers that process each packet individually, looking up route and data-link info, useful when packets can't be handled by CEF.

Convergence: Modern protocols like OSPF, EIGRP, and IS-IS converge quickly (under 10 seconds), adjusting routes faster than older protocols like RIP.

Autonomous System (AS): A network under a single administration that runs routing protocols like OSPF or EIGRP. Redistribution is used to route between ASes.

RIP Concepts: Passive-interface prevents broadcast updates, and the offset-list command adjusts route metrics based on access lists.

VRF-lite

Virtual Routing and Forwarding-lite (VRF-lite) enables the creation of multiple routing tables within a single device without using MPLS. It isolates traffic between different networks, similar to how VLANs work at Layer 2 but at Layer 3. VRF-lite does not require MPLS and is useful in small-scale scenarios like enterprises where network segmentation or isolation is needed. Technical Tip: In interviews, be prepared to explain how VRF-lite helps segregate routing domains in an enterprise network to provide multi-tenancy without MPLS. Also, understand the ip vrf command and VRF route leaking methods.

Static Routing

Static Route Types

  1. Directly Attached Static Routes: These routes are configured using the outbound interface and require the interface to be in an "up" state to be installed in the Routing Information Base (RIB). Example: ip route 10.22.22.0 255.255.255.0 Serial 1/0.
  2. Recursive Static Routes: Instead of an interface, the next-hop IP address is specified. The router must perform a recursive lookup to resolve the outbound interface from the routing table. Technical Tip: In recursive routes, ensure that next-hop addresses resolve in the RIB; otherwise, the route will not be installed.
  3. Fully Specified Static Routes: This route includes both the outbound interface and the next-hop IP address, eliminating recursive lookups and ARP overhead. Example: ip route 10.22.22.0 255.255.255.0 GigabitEthernet0/0 10.12.1.2.

Static Null Routes

Static Null Routes drop traffic directed to a null interface, typically used to prevent routing loops or to blackhole certain traffic. Example: ip route 172.16.0.0 255.255.0.0 Null0.

Difference between Interior and Exterior Gateway Protocols

Interior Gateway Protocols (IGP) are used within an Autonomous System (AS). Examples: OSPF, EIGRP, RIP. Exterior Gateway Protocols (EGP), such as BGP, operate between different Autonomous Systems. Technical Tip: When asked about BGP in interviews, highlight that BGP makes path decisions based on policy rather than metrics and is optimized for scalability and policy control between ISPs.

Equal-Cost Multipathing (ECMP)

ECMP allows load sharing across multiple equal-cost paths to a destination, supported by OSPF, EIGRP, RIP, and IS-IS. Technical Tip: Discuss how ECMP increases bandwidth by splitting traffic across multiple paths. Some routing protocols may support unequal-cost load balancing (like EIGRP).

Policy-Based Routing (PBR)

PBR makes routing decisions based on criteria other than the destination IP, such as source IP, application type, or packet size. Example: set ip next-hop 10.2.12.2 in a route-map to direct traffic from VLAN_20 (172.16.20.0/24) to the desired next-hop. Technical Tip: Mention that PBR works outside normal destination-based routing decisions, and be prepared to discuss scenarios where PBR is useful, such as QoS marking, traffic engineering, or forcing traffic over non-default routes.

Applying PBR to Locally Created Packets

By default, PBR only applies to incoming traffic. To route packets generated locally by the router itself, use the command ip local policy route-map.

SDM Templates for PBR on Catalyst Switches

Certain switches (e.g., Catalyst 3550, 3650) need to repartition TCAM to support PBR using SDM templates. The command sdm prefer routing activates a template for PBR, routing, or IPv6 support.

Recursive Static Routes – Key Pitfall

If the recursive lookup resolves to a different outbound interface, it can cause incorrect routing behavior. Use fully specified static routes to avoid this issue.

Comments

Popular posts from this blog

How to import Putty Saved Connections to mRemoteNG

Just started using mRemoteNG and its being very cool to connect to different remote connection with different protocols e.g Window Remote Desktop, VNC to Linux, SSH, HTTP connection etc. from a single application. As new user I configured some remote desktop connection which was quite easy to figure out. But when I wanted to add SSH connections, it came in my mind to import all of the saved connections in the putty. But I couldn't figure it out how can it be done, though it was quite easy and here are the steps. Open your mRemoteNG Create a folder if you want segregation of multiple networks Create a new connection Enter the IP address of remote server under connection in Config pane Under the config pane, select protocol " SSH version 2 ".  Once you select protocol to SSH version 2 you are given option to import putty sessions, as shown in the snap below. In the above snap, I have imported CSR-AWS session from my saved sessions in Putty.

AS Path Prepending: Controlling Inbound Traffic in BGP

AS Path Prepending is a BGP feature used to make a specific path appear less preferred by artificially lengthening the AS path. This is done by adding your AS number multiple times to the AS path. It is a common method to influence inbound traffic from external networks. Longer AS Path = Less preferred route . Example Scenario : You have two ISPs: ISP1 (through CE1) and ISP2 (through CE2). You want inbound traffic from the internet to prefer ISP1 over ISP2. Network Topology : CE1 (connected to ISP1): 10.0.1.1/30 CE2 (connected to ISP2): 10.0.2.1/30 iBGP Router (Internal) connected to both CE1 (10.0.1.2/30) and CE2 (10.0.2.2/30). Configuration on CE2 (AS Path Prepending to Make ISP2 Less Preferred) : Create a route map to prepend your AS path multiple times for CE2: route-map PREPEND_AS permit 10 set as-path prepend 65001 65001 65001 Apply this route map to the neighbor in the BGP configuration for CE2: router bgp 65001 neighbor 10.0.2.1 remote-as 65002 neighbor 10.0.2.1 ro...

Authoritative DNS Servers Delegation and Internal DNS Explained

DNS (Domain Name System) plays a critical role in how users and systems find resources on the internet or within internal networks. Whether it's managing an internal domain in an enterprise or delegating parts of a domain for traffic distribution, DNS setups vary widely depending on needs. In this blog post, we’ll break down the different types of DNS setups, including authoritative DNS servers, DNS delegation, and how internal DNS functions within organizations. 1. Authoritative DNS Server An Authoritative DNS server is the final source of truth for a specific domain. When someone queries a domain (e.g., example.com ), the authoritative DNS server for that domain holds the DNS records (A records, CNAME, MX, etc.) and responds with the corresponding IP address. Key Points: Who can host it? Authoritative DNS servers are often hosted by domain registrars (e.g., GoDaddy, Namecheap) or cloud DNS providers (e.g., AWS Route 53, Cloudflare). However, organizations can also host their ...