SlideShare uma empresa Scribd logo
1 de 8
To Route or Not to Route: A Day in the Life of a Router
“To route or not to route, that is the question.” ---Signed, the Router

How many decisions must a router make each day? The answer: millions! A lot goes
into the decision process regarding routing, and it happens long before a packet,
being sent by a customer, arrives at the router for its turn to be forwarded. Join me
as we take a close look at a day in the life of the router.

Planning Ahead
A common theme in success strategies is to plan ahead and be prepared, so that
when a circumstance presents itself, we already know what we should do. The same
is true for an IP router. Consider the router below, with 4 interfaces.




Figure 1

When a packet arrives at Ethernet interface 1/0, the router has a decision to make.
Options for the router seem fairly simple; discard the packet or route it out of one of
its interfaces. Long before a packet shows up to be routed, the router should be
trained on what to do and which interfaces to use. This training process is called the
“control plane” of the router, and is how the router learns where networks are
(similar to us knowing where various cities are), and the best path to reach those
networks (similar to us knowing which onramps or surface streets to use to reach
those cities).

The Learning Process
The control plane for the router only has four ways of learning about networks, that’s
it! They are:

http://blog.router-switch.com/
1.   Directly connected networks
   2.   Statically learned networks
   3.   Dynamically learned networks
   4.   Default routes

Let’s look at each of these options, and learn what impact they have on the router’s
decision process.

Directly Connected Networks
On a brand new router right out of the shipping box and plugged in, it doesn’t know
about any IP networks, because it has no IP addresses configured. The first time we
add an IP address with an associated mask to an interface, and bring that interface
out of shutdown state, “POOF!” the router now knows about its first network, which
is the directly connected network we just configured. Even if this interface is
connected to a switch with no other devices on it, the router still believes it can
reach this local network, due to the IP address configured on the local interface.

In the example below, the new router has no IP addresses configured, and therefore
nothing in his routing table.




Figure 2

After configuring an IP address on an interface and bring up the interface, the single
directly connected network is now in the routing table. The new network in the
routing table below is 10.0.0.0/24.




http://blog.router-switch.com/
Figure 3

Statically Configured Networks
As long as the router is directly connected to at least one IP network, we can train
the router about using that connection to reach other networks as well (via other
routers who are also on that same connected network). Manually telling the router
about a non-local network is what the static route is all about. It is also an issue of
faith for the router. For example, if we tell the router that to reach the network of
23.1.2.0/24, it should send those packets to R2 at 10.0.0.2, and our router would
now believe it knows how to forward packets to the 23.1.2.0/24 network. In reality,
the router would hope (if routers had feelings) that the device at 10.0.0.2 knows how
to reach the remote network of 23.1.2.0/24. R1 would not really know, for sure, if R2
could reach it or not. In the example below, a static route has been added to R1
informing R1 that to reach 23.1.2.0/24 it should pass the packets to the router at the
IP address of 10.0.0.2




Figure 4

Dynamically Learned Networks
Manually configuring individual static routes can be tedious, especially in larger
organizations with many routers and many networks. A solution to avoid having to
use static routes everywhere is dynamic routing. It really should be called dynamic
learning, because that is what is going on. Using a set of rules called a Routing
Protocol, each of the routers dynamically shares the routes is knows or has learned
with other routers. This way, when a new network is added directly to R2, or when

http://blog.router-switch.com/
R2 learns about a new network, this information can be shared with R1 so that R1
will have dynamically learned the route. The routing protocols inside of an
organization fall into a category called Interior Gateway Protocols (IGPs); examples
include RIP, EIGRP, OSPF, and IS-IS. In the example below, R1 and R2 are running the
OSPF routing protocol, and exchanging routing information.




Figure 5

R1 has learned routing information from R2, and the network 23.0.0.0/24 shows up
in R1’s routing table. In the example below, we are confirming that R1 knows about
R2 via the OSPF routing protocol, and verifying that R1 has learned a route, via OSPF,
for the network 23.0.0.0/24




Figure 6

The Default Route
The last method is also a sort of last resort when it comes to routing: the default
route. It is what the router should do when it needs to forward a packet and doesn’t
have an entry in its routing table for any part of the destination address in the IP
header of the packet. For example, we could have a route that says forward packets
(when you don’t know what else to do with them) to the router at 10.0.0.2; this
would be an example of a default route. Routers may learn a default route from a
neighbor using a routing protocol, or a default route may be statically configured. In
the example below, R1 is using a manually configured static route that instructs it to
use R2’s (the IP address of R2 is 10.0.0.2) as the next hop (router) for any packets
that don’t match a more specific route in R1’s routing table.

http://blog.router-switch.com/
Figure 7

Putting Useful Knowledge to Work
As the router is being trained about reaching networks, which is the control plane we
talked about earlier, it places the information about how to reach those networks
(such as the next router’s IP address, and which exit interface to use) in the routing
table. There are a few extra processes going on in the background, but by and large,
the routing table is the winning route’s #1 podium position at the Olympics. Only the
best routes (best path, in the router’s mind, regarding how to reach the remote
networks) go into the routing table. If there are two equal cost (in the router’s mind)
paths to the same remote network, then the router can place both of those routes in
the routing table and use them both to forward packets to the remote network. It is
the metric (sometimes referred to as cost) that the router considers to determine
which of several routes it knows about (for the same remote network) would be the
“best” route to use. Using the metric, lower is considered better.

What about conflicting information?
In a situation where the same network is being learned via two different methods,
for example a static route for the 3.3.3.0/24 network and a dynamically learned route
for the 3.3.3.0/24 network (learned from a neighbor), the router will consider a
special value called AD (Administrative Distance) that is associated with each method
of learning it does, and if there are two exact routes from different sources, the
router will choose a single winner (for that route) based on the method that has the
lowest AD (lower is better). AD has defaults on a Cisco Router, which can be changed.

http://blog.router-switch.com/
Some of the defaults are listed in Table 1.
Table 1
How the Route was Learned            AD (default Administrative Distance)
Directly Connected Interface         0
Static Route                         1
Internal EIGRP (Dynamic IGP)         70
OSPF (Dynamic IGP)                   110
ISIS (Dynamic IGP)                   115
RIP (Dynamic IGP)                    120

Here we can see the route for network 3.3.3.0/24 in the routing table of R1. The
numbers in brackets show the [AD/METRIC]. In this example, the route was learned
via OSPF, which has an AD of 110, and the OSPF metric for that route is 145.




Figure 8

So if the router learned about the network 3.3.3.0/24 via OSPF and had that route in
the routing table, and later we added a static route for the same network, the new
static route with an AD of 1, would be better (in the mind of the router) than the
route from OSPF with a metric of 110, and the static route would replace the OSPF
learned route on the winner’s podium in the routing table. We can see this with the
debug running for IP routing. In the example below, we add the static route, which
due to a better AD than OSPF is now placed in the routing table.




Figure 9

Forwarding Customer Packets
The learning of routes is called the control plane, and is the process where the router
learns and decides the best routes to use. This control plane is like going to class,
where the router does the learning of routes and how to forward packets. The
application of this learning, where the router actually forwards real packets (using
the information it previously learned about routes) is called the Data Plane, and
often referred to as the transit path or packet switching.

http://blog.router-switch.com/
When a router receives a frame of data from a switch, the router looks at the Layer 2
destination address (in the frame of data) and asks itself, “Do I care about this frame
of data? Is it relevant to me? What is my motivation to continue working with this
frame?” Regarding IP version 4, if the L2 destination MAC address is the MAC address
on the router, or the L2 address is a broadcast address, or the L2 address is the
address of a multicast group that this router has joined, then YES, this frame of data
is interesting or possibly relevant to the router. As a result, the router will look
further into the packet to see what else is inside. In an Ethernet L2 header, it
specifies what the payload is (the protocol being carried), which could be dot1q,
MPLS or even IP. For this example of IP routers, let’s say the L3 information was IP
version 4. In the packet analysis below, it shows a L2 frame with a destination MAC
address of R2, and a destination L3 address of 3.3.3.3 which is not local to R1 or R2.




Figure 10

When receiving this frame and because the L2 destination address was relevant to R2
(00:64:40:22:22:22 is R2’s MAC address), R2 continues to dive into the packet and
then looks at the L3 destination address, and asks, “Do I care about this packet (at L3)
of data? Is it relevant to me?” If the destination IP address in the L3 header matches
an IP address of the router, the router would realize this packet was specifically for
him, and would continue to look deeper into the packet to see what the packet was
all about. An example of traffic destined to R2 could be a packet carrying part of a
TCP based SSH session between the router R2 and the administrator.

What if the L3 Destination Address doesn’t belong to the Router?
If the L3 destination IP address is NOT one of the router’s IP addresses, the router
realizes the packet is not for the router personally, but the router is willing to forward

http://blog.router-switch.com/
(or route) this IP packet (it is a router, after all). The router consults the routing table
to determine if any of its routes/networks in the routing table match the destination
IP address in the packet. If a packet has the destination IP address of 3.3.3.3, the
router would look for the longest match (if there were multiple different length
entries in the routing table), and use that route to forward the packet. In the output
below, the routing table lists that it knows one subnet from the Class A network of
3.0.0.0, that it is subnetted down to a /24, and that 24 bit network is 3.3.3.0.




Figure 11

Because the first 24 bits of this route/network in our routing are an exact match of
the first 24 bits of the packet we need to forward, this is our longest match. R2 will
forward the packet on the L2 address of 23.0.0.3 (based on the routing table above)
and will use Ethernet 1/0 to forward the packet. The device at 23.0.0.3 will then go
through the similar process of opening up the packet, and making a routing decision
about that packet. This is a story that happens millions of times per day, in networks
all around the world.

If a router doesn’t have an exact match based on its routing table, it will then use its
default route for forwarding, and if there isn’t a default route either learned or
configured on the router (with no other more specific routes in the routing table),
the router will drop the packet, and send a message to the source IP from the packet,
letting that device know that the packet was dropped. (This isn’t really an apology for
dropping the packet, but more for just notification that it happened).

There is an entire fascinating world happening within our networks, and I hope you
have enjoyed looking into the concept of routing from the router’s perspective.

More Networking Tips:
‘What Happens in the VLAN Stays in the VLAN?
Understanding Static Multicast Routes




http://blog.router-switch.com/

Mais conteúdo relacionado

Mais de IT Tech

Cisco catalyst 9200 series platform spec, licenses, transition guide
Cisco catalyst 9200 series platform spec, licenses, transition guideCisco catalyst 9200 series platform spec, licenses, transition guide
Cisco catalyst 9200 series platform spec, licenses, transition guideIT Tech
 
Cisco isr 900 series highlights, platform specs, licenses, transition guide
Cisco isr 900 series highlights, platform specs, licenses, transition guideCisco isr 900 series highlights, platform specs, licenses, transition guide
Cisco isr 900 series highlights, platform specs, licenses, transition guideIT Tech
 
Hpe pro liant gen9 to gen10 server transition guide
Hpe pro liant gen9 to gen10 server transition guideHpe pro liant gen9 to gen10 server transition guide
Hpe pro liant gen9 to gen10 server transition guideIT Tech
 
The new cisco isr 4461 faq
The new cisco isr 4461 faqThe new cisco isr 4461 faq
The new cisco isr 4461 faqIT Tech
 
New nexus 400 gigabit ethernet (400 g) switches
New nexus 400 gigabit ethernet (400 g) switchesNew nexus 400 gigabit ethernet (400 g) switches
New nexus 400 gigabit ethernet (400 g) switchesIT Tech
 
Tested cisco isr 1100 delivers the richest set of wi-fi features
Tested cisco isr 1100 delivers the richest set of wi-fi featuresTested cisco isr 1100 delivers the richest set of wi-fi features
Tested cisco isr 1100 delivers the richest set of wi-fi featuresIT Tech
 
Aruba campus and branch switching solution
Aruba campus and branch switching solutionAruba campus and branch switching solution
Aruba campus and branch switching solutionIT Tech
 
Cisco transceiver module for compatible catalyst switches
Cisco transceiver module for compatible catalyst switchesCisco transceiver module for compatible catalyst switches
Cisco transceiver module for compatible catalyst switchesIT Tech
 
Cisco ios on cisco catalyst switches
Cisco ios on cisco catalyst switchesCisco ios on cisco catalyst switches
Cisco ios on cisco catalyst switchesIT Tech
 
Cisco's wireless solutions deployment modes
Cisco's wireless solutions deployment modesCisco's wireless solutions deployment modes
Cisco's wireless solutions deployment modesIT Tech
 
Competitive switching comparison cisco vs. hpe aruba vs. huawei vs. dell
Competitive switching comparison cisco vs. hpe aruba vs. huawei vs. dellCompetitive switching comparison cisco vs. hpe aruba vs. huawei vs. dell
Competitive switching comparison cisco vs. hpe aruba vs. huawei vs. dellIT Tech
 
Four reasons to consider the all in-one isr 1000
Four reasons to consider the all in-one isr 1000Four reasons to consider the all in-one isr 1000
Four reasons to consider the all in-one isr 1000IT Tech
 
The difference between yellow and white labeled ports on a nexus 2300 series fex
The difference between yellow and white labeled ports on a nexus 2300 series fexThe difference between yellow and white labeled ports on a nexus 2300 series fex
The difference between yellow and white labeled ports on a nexus 2300 series fexIT Tech
 
Cisco transceiver modules for compatible cisco switches series
Cisco transceiver modules for compatible cisco switches seriesCisco transceiver modules for compatible cisco switches series
Cisco transceiver modules for compatible cisco switches seriesIT Tech
 
Guide to the new cisco firepower 2100 series
Guide to the new cisco firepower 2100 seriesGuide to the new cisco firepower 2100 series
Guide to the new cisco firepower 2100 seriesIT Tech
 
892 f sfp configuration example
892 f sfp configuration example892 f sfp configuration example
892 f sfp configuration exampleIT Tech
 
Cisco nexus 7000 and nexus 7700
Cisco nexus 7000 and nexus 7700Cisco nexus 7000 and nexus 7700
Cisco nexus 7000 and nexus 7700IT Tech
 
Cisco firepower ngips series migration options
Cisco firepower ngips series migration optionsCisco firepower ngips series migration options
Cisco firepower ngips series migration optionsIT Tech
 
Eol transceiver to replacement model
Eol transceiver to replacement modelEol transceiver to replacement model
Eol transceiver to replacement modelIT Tech
 
Cisco firepower 2100 series, as a ngfw or a ngips
Cisco firepower 2100 series, as a ngfw or a ngipsCisco firepower 2100 series, as a ngfw or a ngips
Cisco firepower 2100 series, as a ngfw or a ngipsIT Tech
 

Mais de IT Tech (20)

Cisco catalyst 9200 series platform spec, licenses, transition guide
Cisco catalyst 9200 series platform spec, licenses, transition guideCisco catalyst 9200 series platform spec, licenses, transition guide
Cisco catalyst 9200 series platform spec, licenses, transition guide
 
Cisco isr 900 series highlights, platform specs, licenses, transition guide
Cisco isr 900 series highlights, platform specs, licenses, transition guideCisco isr 900 series highlights, platform specs, licenses, transition guide
Cisco isr 900 series highlights, platform specs, licenses, transition guide
 
Hpe pro liant gen9 to gen10 server transition guide
Hpe pro liant gen9 to gen10 server transition guideHpe pro liant gen9 to gen10 server transition guide
Hpe pro liant gen9 to gen10 server transition guide
 
The new cisco isr 4461 faq
The new cisco isr 4461 faqThe new cisco isr 4461 faq
The new cisco isr 4461 faq
 
New nexus 400 gigabit ethernet (400 g) switches
New nexus 400 gigabit ethernet (400 g) switchesNew nexus 400 gigabit ethernet (400 g) switches
New nexus 400 gigabit ethernet (400 g) switches
 
Tested cisco isr 1100 delivers the richest set of wi-fi features
Tested cisco isr 1100 delivers the richest set of wi-fi featuresTested cisco isr 1100 delivers the richest set of wi-fi features
Tested cisco isr 1100 delivers the richest set of wi-fi features
 
Aruba campus and branch switching solution
Aruba campus and branch switching solutionAruba campus and branch switching solution
Aruba campus and branch switching solution
 
Cisco transceiver module for compatible catalyst switches
Cisco transceiver module for compatible catalyst switchesCisco transceiver module for compatible catalyst switches
Cisco transceiver module for compatible catalyst switches
 
Cisco ios on cisco catalyst switches
Cisco ios on cisco catalyst switchesCisco ios on cisco catalyst switches
Cisco ios on cisco catalyst switches
 
Cisco's wireless solutions deployment modes
Cisco's wireless solutions deployment modesCisco's wireless solutions deployment modes
Cisco's wireless solutions deployment modes
 
Competitive switching comparison cisco vs. hpe aruba vs. huawei vs. dell
Competitive switching comparison cisco vs. hpe aruba vs. huawei vs. dellCompetitive switching comparison cisco vs. hpe aruba vs. huawei vs. dell
Competitive switching comparison cisco vs. hpe aruba vs. huawei vs. dell
 
Four reasons to consider the all in-one isr 1000
Four reasons to consider the all in-one isr 1000Four reasons to consider the all in-one isr 1000
Four reasons to consider the all in-one isr 1000
 
The difference between yellow and white labeled ports on a nexus 2300 series fex
The difference between yellow and white labeled ports on a nexus 2300 series fexThe difference between yellow and white labeled ports on a nexus 2300 series fex
The difference between yellow and white labeled ports on a nexus 2300 series fex
 
Cisco transceiver modules for compatible cisco switches series
Cisco transceiver modules for compatible cisco switches seriesCisco transceiver modules for compatible cisco switches series
Cisco transceiver modules for compatible cisco switches series
 
Guide to the new cisco firepower 2100 series
Guide to the new cisco firepower 2100 seriesGuide to the new cisco firepower 2100 series
Guide to the new cisco firepower 2100 series
 
892 f sfp configuration example
892 f sfp configuration example892 f sfp configuration example
892 f sfp configuration example
 
Cisco nexus 7000 and nexus 7700
Cisco nexus 7000 and nexus 7700Cisco nexus 7000 and nexus 7700
Cisco nexus 7000 and nexus 7700
 
Cisco firepower ngips series migration options
Cisco firepower ngips series migration optionsCisco firepower ngips series migration options
Cisco firepower ngips series migration options
 
Eol transceiver to replacement model
Eol transceiver to replacement modelEol transceiver to replacement model
Eol transceiver to replacement model
 
Cisco firepower 2100 series, as a ngfw or a ngips
Cisco firepower 2100 series, as a ngfw or a ngipsCisco firepower 2100 series, as a ngfw or a ngips
Cisco firepower 2100 series, as a ngfw or a ngips
 

Último

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Último (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

To route or not to route a day in the life of a router

  • 1. To Route or Not to Route: A Day in the Life of a Router “To route or not to route, that is the question.” ---Signed, the Router How many decisions must a router make each day? The answer: millions! A lot goes into the decision process regarding routing, and it happens long before a packet, being sent by a customer, arrives at the router for its turn to be forwarded. Join me as we take a close look at a day in the life of the router. Planning Ahead A common theme in success strategies is to plan ahead and be prepared, so that when a circumstance presents itself, we already know what we should do. The same is true for an IP router. Consider the router below, with 4 interfaces. Figure 1 When a packet arrives at Ethernet interface 1/0, the router has a decision to make. Options for the router seem fairly simple; discard the packet or route it out of one of its interfaces. Long before a packet shows up to be routed, the router should be trained on what to do and which interfaces to use. This training process is called the “control plane” of the router, and is how the router learns where networks are (similar to us knowing where various cities are), and the best path to reach those networks (similar to us knowing which onramps or surface streets to use to reach those cities). The Learning Process The control plane for the router only has four ways of learning about networks, that’s it! They are: http://blog.router-switch.com/
  • 2. 1. Directly connected networks 2. Statically learned networks 3. Dynamically learned networks 4. Default routes Let’s look at each of these options, and learn what impact they have on the router’s decision process. Directly Connected Networks On a brand new router right out of the shipping box and plugged in, it doesn’t know about any IP networks, because it has no IP addresses configured. The first time we add an IP address with an associated mask to an interface, and bring that interface out of shutdown state, “POOF!” the router now knows about its first network, which is the directly connected network we just configured. Even if this interface is connected to a switch with no other devices on it, the router still believes it can reach this local network, due to the IP address configured on the local interface. In the example below, the new router has no IP addresses configured, and therefore nothing in his routing table. Figure 2 After configuring an IP address on an interface and bring up the interface, the single directly connected network is now in the routing table. The new network in the routing table below is 10.0.0.0/24. http://blog.router-switch.com/
  • 3. Figure 3 Statically Configured Networks As long as the router is directly connected to at least one IP network, we can train the router about using that connection to reach other networks as well (via other routers who are also on that same connected network). Manually telling the router about a non-local network is what the static route is all about. It is also an issue of faith for the router. For example, if we tell the router that to reach the network of 23.1.2.0/24, it should send those packets to R2 at 10.0.0.2, and our router would now believe it knows how to forward packets to the 23.1.2.0/24 network. In reality, the router would hope (if routers had feelings) that the device at 10.0.0.2 knows how to reach the remote network of 23.1.2.0/24. R1 would not really know, for sure, if R2 could reach it or not. In the example below, a static route has been added to R1 informing R1 that to reach 23.1.2.0/24 it should pass the packets to the router at the IP address of 10.0.0.2 Figure 4 Dynamically Learned Networks Manually configuring individual static routes can be tedious, especially in larger organizations with many routers and many networks. A solution to avoid having to use static routes everywhere is dynamic routing. It really should be called dynamic learning, because that is what is going on. Using a set of rules called a Routing Protocol, each of the routers dynamically shares the routes is knows or has learned with other routers. This way, when a new network is added directly to R2, or when http://blog.router-switch.com/
  • 4. R2 learns about a new network, this information can be shared with R1 so that R1 will have dynamically learned the route. The routing protocols inside of an organization fall into a category called Interior Gateway Protocols (IGPs); examples include RIP, EIGRP, OSPF, and IS-IS. In the example below, R1 and R2 are running the OSPF routing protocol, and exchanging routing information. Figure 5 R1 has learned routing information from R2, and the network 23.0.0.0/24 shows up in R1’s routing table. In the example below, we are confirming that R1 knows about R2 via the OSPF routing protocol, and verifying that R1 has learned a route, via OSPF, for the network 23.0.0.0/24 Figure 6 The Default Route The last method is also a sort of last resort when it comes to routing: the default route. It is what the router should do when it needs to forward a packet and doesn’t have an entry in its routing table for any part of the destination address in the IP header of the packet. For example, we could have a route that says forward packets (when you don’t know what else to do with them) to the router at 10.0.0.2; this would be an example of a default route. Routers may learn a default route from a neighbor using a routing protocol, or a default route may be statically configured. In the example below, R1 is using a manually configured static route that instructs it to use R2’s (the IP address of R2 is 10.0.0.2) as the next hop (router) for any packets that don’t match a more specific route in R1’s routing table. http://blog.router-switch.com/
  • 5. Figure 7 Putting Useful Knowledge to Work As the router is being trained about reaching networks, which is the control plane we talked about earlier, it places the information about how to reach those networks (such as the next router’s IP address, and which exit interface to use) in the routing table. There are a few extra processes going on in the background, but by and large, the routing table is the winning route’s #1 podium position at the Olympics. Only the best routes (best path, in the router’s mind, regarding how to reach the remote networks) go into the routing table. If there are two equal cost (in the router’s mind) paths to the same remote network, then the router can place both of those routes in the routing table and use them both to forward packets to the remote network. It is the metric (sometimes referred to as cost) that the router considers to determine which of several routes it knows about (for the same remote network) would be the “best” route to use. Using the metric, lower is considered better. What about conflicting information? In a situation where the same network is being learned via two different methods, for example a static route for the 3.3.3.0/24 network and a dynamically learned route for the 3.3.3.0/24 network (learned from a neighbor), the router will consider a special value called AD (Administrative Distance) that is associated with each method of learning it does, and if there are two exact routes from different sources, the router will choose a single winner (for that route) based on the method that has the lowest AD (lower is better). AD has defaults on a Cisco Router, which can be changed. http://blog.router-switch.com/
  • 6. Some of the defaults are listed in Table 1. Table 1 How the Route was Learned AD (default Administrative Distance) Directly Connected Interface 0 Static Route 1 Internal EIGRP (Dynamic IGP) 70 OSPF (Dynamic IGP) 110 ISIS (Dynamic IGP) 115 RIP (Dynamic IGP) 120 Here we can see the route for network 3.3.3.0/24 in the routing table of R1. The numbers in brackets show the [AD/METRIC]. In this example, the route was learned via OSPF, which has an AD of 110, and the OSPF metric for that route is 145. Figure 8 So if the router learned about the network 3.3.3.0/24 via OSPF and had that route in the routing table, and later we added a static route for the same network, the new static route with an AD of 1, would be better (in the mind of the router) than the route from OSPF with a metric of 110, and the static route would replace the OSPF learned route on the winner’s podium in the routing table. We can see this with the debug running for IP routing. In the example below, we add the static route, which due to a better AD than OSPF is now placed in the routing table. Figure 9 Forwarding Customer Packets The learning of routes is called the control plane, and is the process where the router learns and decides the best routes to use. This control plane is like going to class, where the router does the learning of routes and how to forward packets. The application of this learning, where the router actually forwards real packets (using the information it previously learned about routes) is called the Data Plane, and often referred to as the transit path or packet switching. http://blog.router-switch.com/
  • 7. When a router receives a frame of data from a switch, the router looks at the Layer 2 destination address (in the frame of data) and asks itself, “Do I care about this frame of data? Is it relevant to me? What is my motivation to continue working with this frame?” Regarding IP version 4, if the L2 destination MAC address is the MAC address on the router, or the L2 address is a broadcast address, or the L2 address is the address of a multicast group that this router has joined, then YES, this frame of data is interesting or possibly relevant to the router. As a result, the router will look further into the packet to see what else is inside. In an Ethernet L2 header, it specifies what the payload is (the protocol being carried), which could be dot1q, MPLS or even IP. For this example of IP routers, let’s say the L3 information was IP version 4. In the packet analysis below, it shows a L2 frame with a destination MAC address of R2, and a destination L3 address of 3.3.3.3 which is not local to R1 or R2. Figure 10 When receiving this frame and because the L2 destination address was relevant to R2 (00:64:40:22:22:22 is R2’s MAC address), R2 continues to dive into the packet and then looks at the L3 destination address, and asks, “Do I care about this packet (at L3) of data? Is it relevant to me?” If the destination IP address in the L3 header matches an IP address of the router, the router would realize this packet was specifically for him, and would continue to look deeper into the packet to see what the packet was all about. An example of traffic destined to R2 could be a packet carrying part of a TCP based SSH session between the router R2 and the administrator. What if the L3 Destination Address doesn’t belong to the Router? If the L3 destination IP address is NOT one of the router’s IP addresses, the router realizes the packet is not for the router personally, but the router is willing to forward http://blog.router-switch.com/
  • 8. (or route) this IP packet (it is a router, after all). The router consults the routing table to determine if any of its routes/networks in the routing table match the destination IP address in the packet. If a packet has the destination IP address of 3.3.3.3, the router would look for the longest match (if there were multiple different length entries in the routing table), and use that route to forward the packet. In the output below, the routing table lists that it knows one subnet from the Class A network of 3.0.0.0, that it is subnetted down to a /24, and that 24 bit network is 3.3.3.0. Figure 11 Because the first 24 bits of this route/network in our routing are an exact match of the first 24 bits of the packet we need to forward, this is our longest match. R2 will forward the packet on the L2 address of 23.0.0.3 (based on the routing table above) and will use Ethernet 1/0 to forward the packet. The device at 23.0.0.3 will then go through the similar process of opening up the packet, and making a routing decision about that packet. This is a story that happens millions of times per day, in networks all around the world. If a router doesn’t have an exact match based on its routing table, it will then use its default route for forwarding, and if there isn’t a default route either learned or configured on the router (with no other more specific routes in the routing table), the router will drop the packet, and send a message to the source IP from the packet, letting that device know that the packet was dropped. (This isn’t really an apology for dropping the packet, but more for just notification that it happened). There is an entire fascinating world happening within our networks, and I hope you have enjoyed looking into the concept of routing from the router’s perspective. More Networking Tips: ‘What Happens in the VLAN Stays in the VLAN? Understanding Static Multicast Routes http://blog.router-switch.com/