0% found this document useful (0 votes)
12 views

Week 4

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Week 4

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Routing and Switching

James Jefferson S. De Vera


Routing and Switching:
Static Route Processing
James Jefferson S. De Vera
Packet Arrival at an Interface
•A packet arrives at one of the router's interfaces.
•The interface could be a physical connection like an
Ethernet port or a logical connection like a VLAN.
What is an Interface?
An interface is a connection point on a router where it communicates
with other networks or devices. Think of it like a doorway to the
router. Interfaces can be:
Physical: Actual ports on the router where you plug in cables (e.g.,
Ethernet, Serial, Fiber Optic).
What is an Interface?

Logical: Virtual
interfaces created
within the router to
divide a single physical
interface into multiple
sub-interfaces (e.g.,
VLANs).
Packet Arrival
When a device (like a computer, server, or another
router) wants to send data across a network, it breaks
the data into smaller chunks called packets. These
packets are then sent to the router's interface.
Examples

•Email: When you send an email, it's broken into packets.


These packets could arrive at your home router's Ethernet
interface from your computer.
•Website Request: When you request a webpage, your request
is divided into packets. These packets could arrive at your ISP's
router through a fiber optic interface.
•File Transfer: A large file being transferred across the network
will be split into many packets. These packets could arrive at a
corporate router through a serial interface.
Key Points

•The packet arrival is the starting point of the routing


process.
•The type of interface can vary depending on the
network technology and the type of connection.
•Each packet carries a destination IP address that tells
the router where the packet needs to go.
Examining the Destination IP Address

•The router examines the


destination IP address in
the packet's header.
•This address tells the
router where the packet is
ultimately headed.
The Packet's Header

Every data packet traveling through a network carries a


header. This header contains essential information,
including the source and destination IP addresses. The
destination IP address is like a postal address for the
packet, indicating where it ultimately needs to go.
The Router's Role

When a router receives a packet, it first extracts the


destination IP address from the packet's header. This
address is then used to look up the appropriate route in
the router's routing table.
Example

If the email packet is destined for a recipient


on a different network, the destination IP
address would be that of the recipient's
device.
Key Points

•The destination IP address is the primary piece of


information used by the router for routing decisions.
•Without the correct destination IP address, the router
won't be able to deliver the packet to its intended
recipient.
•In static routing, the administrator manually configures
the routes in the routing table, telling the router which
path to take for each destination IP address or network.
The Routing Table Lookup

•The router looks up the destination IP address in its


routing table.
•The routing table is like a map that tells the router how
to reach different networks.
•Static routes are manual entries in this table.
What is a Routing Table?
•A Database: The routing table is a database stored within the router's
memory.
•Key Information: It contains critical information for each known network
destination:
•Destination Network: The network address to which packets are
being sent.
•Subnet Mask: Defines the range of IP addresses belonging to that
network.
•Next Hop: The IP address of the next router (or the exit interface) that
the packet should be forwarded to.
•Metric: A value indicating the cost or preference of a particular route
(used in some routing protocols).
What is a Routing Table?
•A Database: The routing table is a database stored within the router's
memory.
•Key Information: It contains critical information for each known network
destination:
•Destination Network: The network address to which packets are
being sent.
•Subnet Mask: Defines the range of IP addresses belonging to that
network.
•Next Hop: The IP address of the next router (or the exit interface) that
the packet should be forwarded to.
•Metric: A value indicating the cost or preference of a particular route
(used in some routing protocols).
What is a Routing Table?
•A Database: The routing table is a database stored within the router's
memory.
•Key Information: It contains critical information for each known network
destination:
•Destination Network: The network address to which packets are
being sent.
•Subnet Mask: Defines the range of IP addresses belonging to that
network.
•Next Hop: The IP address of the next router (or the exit interface) that
the packet should be forwarded to.
•Metric: A value indicating the cost or preference of a particular route
(used in some routing protocols).
Example:
Let's say you want to send a message to a friend whose computer has the
IP address 192.168.2.100. Your router might have a routing table entry that
looks something like this:

○ Destination Network: 192.168.2.0


○ Subnet Mask: 255.255.255.0
○ Next Hop: 192.168.1.254
○ Metric: 10
What is a Routing Table?
•Static vs. Dynamic
Entries: Routing tables
can contain both static
and dynamic routes. In
this lesson, we're
focusing on static routes,
which are manually
configured by the
network administrator.
How the Router Uses the Routing Table:

•Packet Arrival: A packet arrives at the router with a specific destination


IP address.
•Lookup: The router looks up the destination IP address in its routing
table.
•Match: If a matching route is found (either an exact match or a matching
network prefix), the router forwards the packet out the interface associated
with that route.
•No Match: If no match is found, and there's a default route, the packet is
sent to the default gateway. If there's no default route, the packet is
discarded.
How the Router Uses the Routing Table:

•Packet Arrival: A packet arrives at the router with a specific destination


IP address.
•Lookup: The router looks up the destination IP address in its routing
table.
•Match: If a matching route is found (either an exact match or a matching
network prefix), the router forwards the packet out the interface associated
with that route.
•No Match: If no match is found, and there's a default route, the packet is
sent to the default gateway. If there's no default route, the packet is
discarded.
Example

Let's say the routing table has a static route


that says "To reach 192.168.2.0/24, send
packets out interface GigabitEthernet0/1."
If the destination IP address of the email
falls within that range (e.g., 192.168.2.55),
this route would be a match.
Key Points

•Manual Configuration: Static routes are explicitly defined by the


network administrator, providing precise control over traffic flow.
•Static Routes in the Routing Table: These routes are stored as
specific entries in the routing table, indicating the path to take for a
particular destination network.
•Essential for Packet Forwarding: The routing table lookup is a
core step in the routing process, ensuring packets are sent in the
right direction.
Key Points

•Manual Configuration: Static routes are explicitly defined by the


network administrator, providing precise control over traffic flow.
•Static Routes in the Routing Table: These routes are stored as
specific entries in the routing table, indicating the path to take for a
particular destination network.
•Essential for Packet Forwarding: The routing table lookup is a
core step in the routing process, ensuring packets are sent in the
right direction.
Matching a Static Route
•If the destination IP address
matches a static route in the
routing table, the router forwards
the packet out the corresponding
interface.
•The static route will specify the
next-hop IP address, which is the
next router in the path to the
destination.
Matching a Static Route
•If the destination IP address
matches a static route in the
routing table, the router forwards
the packet out the corresponding
interface.
•The static route will specify the
next-hop IP address, which is the
next router in the path to the
destination.
The Decision Point

After examining the packet's destination IP address, the


router consults its routing table, which is essentially a map
of known networks and the paths to reach them. If the
destination IP address matches a static route configured in
the table, the router has found its path forward.
How the Match Works:

•Exact Match: The destination IP address might match exactly a network


and subnet mask in the routing table. For example, if the packet is
destined for 192.168.1.50, and the table has a static route for
192.168.1.0/24, that's a match.
•Longest Prefix Match: If no exact match is found, the router looks for
the longest prefix match. This means the route with the most specific
subnet mask that encompasses the destination address is chosen. For
instance, if the packet's destination is 10.1.2.3 and the routing table has
entries for 10.0.0.0/8 and 10.1.0.0/16, the latter would be chosen as the
longest prefix.
The Next Hop

Once a match is found, the static route specifies the next


hop IP address. This is the IP address of the next router in
the path towards the destination. The packet is then
forwarded out of the corresponding interface of the
current router towards that next hop.
Examples
Consider a network with three routers (R1, R2, and R3).
Examples
Consider a network with three routers (R1, R2, and R3).

● A packet arrives at R1 with a destination IP of 192.168.3.10.


● R1's routing table has a static route: "To reach 192.168.3.0/24,
send packets to 192.168.2.2 (R2).“
● The destination IP address matches this route, so R1 forwards
the packet out the interface connected to R2.
● R2 then repeats the process, checking its routing table and
forwarding the packet further along the path until it reaches R3
(192.168.3.1), which is directly connected to the destination
network.
Examples
Consider a network with three routers (R1, R2, and R3).

● A packet arrives at R1 with a destination IP of 192.168.3.10.


● R1's routing table has a static route: "To reach 192.168.3.0/24,
send packets to 192.168.2.2 (R2).“
● The destination IP address matches this route, so R1 forwards
the packet out the interface connected to R2.
● R2 then repeats the process, checking its routing table and
forwarding the packet further along the path until it reaches R3
(192.168.3.1), which is directly connected to the destination
network.
Example

In our scenario, the router would forward


the email packet out GigabitEthernet0/1
towards the next hop router, which would
then continue the routing process.
No Match and Default Routes

•If no static route matches, the


router checks for a default route.
•If a default route exists, the
packet is forwarded to the default
gateway.
•If there is no default route, the
packet is discarded.
What Happens When There's No Match?

•Destination IP Not Found: The router receives a


packet, examines the destination IP address, but
cannot find a corresponding static route in its routing
table.
•The "Last Resort": The router checks if a default
route is configured. The default route acts like a safety
net or a "last resort" path.
What Happens When There's No Match?

•Destination IP Not Found: The router receives a


packet, examines the destination IP address, but
cannot find a corresponding static route in its routing
table.
•The "Last Resort": The router checks if a default
route is configured. The default route acts like a safety
net or a "last resort" path.
Default Route:
•Catch-All: A default route typically has a destination of
0.0.0.0/0, meaning it will match any destination IP
address that doesn't have a more specific route.
•Gateway: It also specifies a "gateway" or "next hop" IP
address. This is the address of another router (usually
the one connected to the internet or a central hub) that
is expected to know how to reach the destination.
•Forwarding: If a default route exists, the router will
forward the packet to the specified gateway.
Example
Imagine you're trying to visit a website that is not hosted on your company's
internal network.
1. Request: Your computer sends a packet with the website's IP address as
the destination.
2. No Match: Your company's router doesn't have a specific static route for
that website's IP address.
3. Default Route: However, the router does have a default route that points
to your ISP's gateway.
4. Forwarding: The router forwards the packet to the ISP's gateway, which
then routes it through the internet to reach the website's server.
Example
Imagine you're trying to visit a website that is not hosted on your company's
internal network.
1. Request: Your computer sends a packet with the website's IP address as
the destination.
2. No Match: Your company's router doesn't have a specific static route for
that website's IP address.
3. Default Route: However, the router does have a default route that points
to your ISP's gateway.
4. Forwarding: The router forwards the packet to the ISP's gateway, which
then routes it through the internet to reach the website's server.
No Default Route?

If there's no matching static route and no


default route configured, the router has no
option but to discard the packet.

Consequences: This means the


packet won't reach its destination,
potentially causing communication
failures or website loading issues.
Example

If the email was meant for a recipient on a


network not included in any static route,
and there's a default route configured, the
router would forward the packet towards
the default gateway.
Example

If the email was meant for a recipient on a


network not included in any static route,
and there's a default route configured, the
router would forward the packet towards
the default gateway.
How Routers Process Packets with Static Routes

•Packet Arrival: Router receives a packet on an interface.


•Destination Lookup: Router examines the destination IP address in the
packet header.
•Routing Table Lookup: Router searches its routing table for a matching
route.
•Static Route Match: If a static route matches, the router forwards the
packet to the next hop specified in the route.
•No Match: If no static route matches, the router discards the packet or
forwards it to the default route, if configured.
How Routers Process Packets with Static Routes

•Packet Arrival: Router receives a packet on an interface.


•Destination Lookup: Router examines the destination IP address in the
packet header.
•Routing Table Lookup: Router searches its routing table for a matching
route.
•Static Route Match: If a static route matches, the router forwards the
packet to the next hop specified in the route.
•No Match: If no static route matches, the router discards the packet or
forwards it to the default route, if configured.
Key Points

•Default routes are essential for handling traffic that


doesn't have specific routes defined.
•This process happens in milliseconds for each packet.
•They provide flexibility and prevent packets from being
lost when there's no exact match in the routing table.
•However, administrators should be careful when
configuring default routes to avoid potential security
risks or routing loops.
Key Points

•Default routes are essential for handling traffic that


doesn't have specific routes defined.
•This process happens in milliseconds for each packet.
•They provide flexibility and prevent packets from being
lost when there's no exact match in the routing table.
•However, administrators should be careful when
configuring default routes to avoid potential security
risks or routing loops.

You might also like