0% found this document useful (0 votes)
8 views37 pages

Understanding Router Functions and Tables

The document provides an overview of routers, their functions, and the structure of routing tables, including static and default routes. It explains how routers forward packets based on destination IP addresses and the importance of routing protocols in determining the best path. Additionally, it discusses the advantages and disadvantages of static routing, as well as how to configure static and default routes in a network.

Uploaded by

acelko77
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views37 pages

Understanding Router Functions and Tables

The document provides an overview of routers, their functions, and the structure of routing tables, including static and default routes. It explains how routers forward packets based on destination IP addresses and the importance of routing protocols in determining the best path. Additionally, it discusses the advantages and disadvantages of static routing, as well as how to configure static and default routes in a network.

Uploaded by

acelko77
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NET 365

IP Routers

Anthony Lombardo
DePaul University
Topics
◼ Router forwarding
◼ Cisco route table structure
◼ Static routes
◼ Default routes
◼ Floating static routes

NET 365 DePaul University 2


What’s a Router?
◼ A router has multiple network interfaces.
◼ Each interface connects router to a subnet of devices
◼ Each interface has its own IP address
◼ Interface IP must be assignable IP from the attached subnet

◼ Router forwards packets:


◼ It receives packets on one interface, removes MAC header
◼ It looks up packet’s IP destination address in Routing Table
◼ It retransmits the packet out another interface to get it closer
to its destination.
◼ Creates a new MAC header for outgoing packet with next hop dest.

NET 365 DePaul University 3


What do routers do?
◼ Store and Forward packets based on their
destination IP address
◼ Provide a gateway between different physical
networks.
◼ Provide a boundary for network security,
management and auditing
◼ Packet filtering and security services
◼ Special routing services (MPLS, virtual private
networks, etc.)

NET 365 DePaul University 4


Example
Internet
PC in room 301
PC in room 201
IP [Link]
IP [Link] ISP Router
IP [Link]
PC in room 204 PC in room 304
IP [Link] Interface S0 IP [Link]
IP [Link]

Ethernet PC in room 311


Corporate
PC in room 208 Ethernet Switch
Interface E0 Router Interface E1 IP [Link]
IP [Link] Switch IP [Link] IP [Link]
MAC 00:10:22:01:02:33 MAC 00:10:22:01:4a:de

3rd Floor Subnet [Link]/24


2nd Floor Subnet [Link]/24 Default Gateway = [Link]
Default Gateway = [Link]

• This Corporate Router has 3 interfaces – 2 Ethernet and 1 point-to-point.


• Each router interface has its own IP address
• Devices in each subnet keep track of the IP address of the router
interface in their subnet, called the default gateway address.
NET 365 DePaul University 5
What’s in a Routing Table?
◼ Important entries in a routing table :
◼ Destination Subnet ID – this is an identifier that
represents a group (subnet) of IP addresses
◼ Outgoing Interface – the router interface the packet
should be sent out to deliver it to the particular IP subnet.
◼ Next Hop – the IP address of the incoming interface of the
next router this packet needs to go through, if it has to go
through another router.

◼ Plus some other stuff we will examine later.

NET 365 DePaul University 6


Routing Table for Corporate
Router in Example

IP Subnet Interface Next Hop

[Link] / 24 E0 --
[Link] / 24 E1 --

[Link] / 0 S0 [Link]

Note: “[Link]/0” is the notation for the default route. If the IP


destination address in an arriving packet does not match any
other entries in the routing table, then this route will be taken.

NET 365 DePaul University 7


Cisco Routing Table
◼ IOS Command: show ip route

Code IP Subnet [ Admin Next Hop Time since Outgoing


(how Distance / last route Interface
route Metric ] update
was received
learned)NET 365 DePaul University 8
Router Forwarding
◼ For each arriving packet, the router will:
◼ Remove the MAC header from arriving packet
◼ Look up the Destination IP address from the packet
in the Routing Table to determine (a) Outgoing
Interface (b) Next Hop IP address (if present)
◼ Create a new MAC header of the appropriate type
for the outgoing Interface.
◼ If there is a Next Hop IP address then
◼ If Ethernet interface, look in ARP table to find MAC address
corresponding to Next Hop IP address and put that into
Destination field of the new MAC header.
◼ If there is no Next Hop value (directly connected)
◼ Look in ARP table to find MAC address corresponding to Dest IP
in packet and put that into Destination field of the new MAC
header.
Path Determination
Routing Decisions

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 10
Example: different subnet

• For packet going from Room 201 PC to Room 301 PC,


• Room 201 PC sends packet with Ethernet header:
• Source = 00:10:33:56:02:b3:33, Dest = 00:10:22:01:02:33 (router)
• Ethernet switch in left subnet delivers to router interface E0
• Router removes MAC header, sends new packet out E1 with Eth MAC header:
• Source = 00:10:22:01:4a:de, Dest = Room 301 PC MAC address
• Ethernet switch in right subnet delivers to PC in room 301.
Example: to Google

• For packet going from Room 201 PC to [Link] ([Link])


• Room 201 PC sends packet with
• IP Header: Source = [Link], Dest = [Link]
• Eth Header: Source = 00:10:33:56:02:b3:33, Dest = 00:10:22:01:02:33 (router)
• Corp. Router receives packet, resends packet out S0 with PPP header:
• PPP Header has no MAC source or destination addresses in it
• ISP Router receives pkt, looks up [Link] in its Routing Table,
and forwards packet onto the next link towards this destination.
Routing Table Structure
▪ Routing Table is stored in ram and contains information
about:
▪Directly connected networks - this occurs when a device is
connected to another router interface
▪Remotely connected networks - this is a network that is not
directly connected to a particular router
▪Detailed information about the networks include source of
information, network address & subnet mask, and Ip address of
next-hop router

▪ Show ip route command is used to view a routing table

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 13
Path Determination of the route
Administrative Distance
If multiple paths to a destination are configured on a router, the path
installed in the routing table is the one with the lowest Administrative
Distance (AD):
• A static route with an AD of 1 is more reliable than an EIGRP-
discovered route with an AD of 90.
• A directly connected route with an AD of 0 is more reliable than a
static route with an AD of 1.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 14
Path Determination
Best Path
Best path is selected by a routing protocol based on
the value or metric it uses to determine the distance
to reach a network:
▪ A metric is the value used to measure the distance to a given
network.
▪ Best path to a network is the path with the lowest metric.

Dynamic IGP routing protocols use their own rules


and metrics to build and update routing tables:
▪ Routing Information Protocol (RIP) - Metric is Hop Count
▪ Open Shortest Path First (OSPF) - Metric is sum of Link Costs
along the path. By default, Link Cost is based on link bandwidth.
▪ Enhanced Interior Gateway Routing Protocol (EIGRP) - Many
options, by default Metric determined by Bandwidths and Delays.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 15
Path Determination
Load Balancing
When a router has two or more paths to a destination with
equal cost metrics, then the router forwards the packets
using both paths equally:
• Equal cost load balancing can improve network
performance.
• Equal cost load balancing can be configured to use
both dynamic routing protocols and static routes.
• RIP, OSPF and EIGRP support equal cost load
balancing.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 16
Routing Table Structure
▪ Adding a connected network to the routing table
-Router interfaces
▪Each router interface is a member of a different network
▪Activated using the no shutdown command
▪In order for static and dynamic routes to exist in routing table you
must have directly connected networks

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 17
Routing Table Structure
▪ Static routes in the routing table
-Includes: network address and subnet mask and IP address of
next hop router or exit interface
-Denoted with the code S in the routing table
-Routing tables must contain directly connected networks used
to connect remote networks before static or dynamic routing
can be used

▪ When to use static routes


-When network only consists of a few routers
-Network is connected to internet only through one ISP
-Hub & spoke topology is used on a large network

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 18
Static Routing
Why Use Static Routing?
Static routing provides some advantages over dynamic
routing, including:
▪ Static routes are not advertised over the network,
resulting in better security.
▪ Static routes use less bandwidth than dynamic routing
protocols, no CPU cycles are used to calculate and
communicate routes.
▪ The path a static route uses to send data is known.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 19
Static Routing
Why Use Static Routing? (cont.)
Static routing has the following disadvantages:
▪ Initial configuration and maintenance is time-
consuming.
▪ Configuration is error-prone, especially in large
networks.
▪ Administrator intervention is required to maintain
changing route information.
▪ Does not scale well with growing networks;
maintenance becomes cumbersome.
▪ Requires complete knowledge of the whole network for
proper implementation.
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 20
Adding a Static Route
• To add a static route to your routing table,
• Use the ip route IOS command
• You must specify the destination Subnet ID – both
network address and subnet mask.
• You must specify the next-hop address or exit
interface
• Example: to add a route to destination subnet
[Link]/24 where the IP address of the next-hop
router is [Link]:
• ip route [Link] [Link] [Link]
• To delete a static route, repeat command with no in front:
• no ip route [Link] [Link] [Link]
NET 365 DePaul University
21
Routing Table Structure
▪ Connected and Static routes

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 22
Static Route command – 2 options
▪ Router(config)# ip route network-address subnet-mask
{ip-address | exit-interface } {admin-dist}
• After subnet-mask can be either
• Next-Hop ip-address - the IP address of next-hop router
interface that is on the same subnet as this router.
• Exit Interface – interface identifier (like “Se0/0”) to send
packet out.
• Note: the “Exit Interface” option can only be used if the
outgoing interface is a Serial Interface (point-to-point). If the
outgoing interface is Ethernet, then you must use Next-Hop IP
address option.
• Optionally, an Administrative Distance can be specified at the
end of the static route command. If this is not specified, the
default administrative distance for static routes is 1.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 23
Static Routes with Exit Interfaces
▪ Configuring routes
▪ The following two commands are identical for R1:
-R1(config)#ip route [Link] [Link] [Link]
-R1(config)#ip route [Link] [Link] S0/0/0

ITE PC v4.0
R1
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 24
Static Routes
▪ Resolving to an Exit Interface
-Recursive route lookup - Occurs when the router has to perform
multiple lookups in the routing table before forwarding a packet. Static
routes with Next-Hop IPs are one example of this:
▪The router first does routing table lookup for the static route
(based on destination address) and determines Next hop address
▪The router then does a second routing table lookup for Next hop
address to determine the exit interface

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 25
Static Routes
▪ Efficiency - Static route with an Exit Interface
-Static routes configured with an exit interface are
traditionally more efficient because the routing table
can resolve the exit interface in a single search
instead of 2 searches.

- However, for modern routers using a feature called


Cisco Express Forwarding (CEF), there is no
efficiency difference, because CEF pre-computes the
exit interface and layer 2 next-hop address for all
routes in the routing table and stores this into a CEF
Table.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 26
Default Static Routes
▪ Default Route
▪This is a route that will match all packets. Stub routers that
have a number of static routes all exiting the same interface are
good candidates for a default route.
-Like route summarization this will help reduce the size of the
routing table

▪ Configuring a default static route


▪Similar to configuring a static route. Except that destination IP
address and subnet mask are all zeros
▪Example:
-Router(config)#ip route [Link] [Link] [exit-interface | ip-
address ]

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 27
Default Route

▪ Default static routes and subnet masks


Since the subnet mask used on a default static route is [Link]
(least specific mask – no bits must match any specific value) all
packets will match.
The routing table lookup process will always use the most
specific match (also called longest prefix matching) when
comparing destination IP address and subnet mask.
Any other route that matches will be preferred over a default
static route. It is only used if no other routes in the routing table
match the destination IP address of a packet.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 28
Packet Forwarding Example
▪ Packet forwarding
with static routes.
(recall Zinin’s 3
routing principles)
▪ Router 1
Packet arrives on R1’s
Fastethernet 0/0
interface
R1 does not have a
route to the
destination
network,
[Link]/24
R1 uses the default
static route.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 29
Packet Forwarding Example
▪ Packet forwarding with static routes. (recall Zinin’s 3
routing principles)
▪ Router 2
The packet arrives on the Serial 0/0/0 interface on R2.
R2 has a static route to [Link]/24 out Serial0/0/1.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 30
Packet Forwarding Example
▪ Packet forwarding with static routes. (recall Zinin’s 3
routing principles)
▪ Router 3
The packet arrives on the Serial0/0/1 interface to R3.
R3 has a connected route to [Link]/24 out Fastethernet
0/0.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 31
More Default Route Commands
◼ Can one router advertise its default route to
other routers?
◼ Yes! In routing protocol config mode:
◼ Rtr (config-rtr)# default-information originate
◼ This will cause this routing protocol to advertise the
[Link]/0 route to other routers in the routing domain.
◼ Can you have a default route that is not a static
route?
◼ Yes! Any destination network can be the default route
(also called the “gateway of last resort”):
◼ Rtr (config)# ip default-network <network>
Static Route Example
Connecting Customer Site to ISP
Configure Floating Static Routes
Floating Static Routes
Floating static routes are static routes that have an
administrative distance greater than the administrative
distance of another static route or dynamic routes:
▪ The administrative distance of a static route can be increased to
make the route less desirable than that of another static route or a
route learned through a dynamic routing protocol.
▪ In this way, the static route “floats” and is not used when the route
with the better administrative distance is active.
▪ However, if the preferred route is lost, the floating static route can
take over, and traffic can be sent through this alternate route.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 34
Configure Floating Static Routes
Configure a Floating Static Route

Additional value “5” at end of 2nd command sets the Administrative


Distance to 5 for that static route. The default Administrative Distance
for the first static route is 1. The 2nd static route is a “floating” route.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 35
Host Routing Tables
◼ Typically, there is only 1 router connected to a
Host’s subnet, which is its default gateway.
◼ But, sometimes, there may be multiple routers
on the Host subnet. Which one is used?
◼ Each Host (Windows, Mac, Linux, etc) keeps a
Host Routing Table that it uses to store these
values for each Destination Subnet:
◼ Outgoing Interface (if Host has multiple interfaces)
◼ Next-Hop Router (gateway) IP address
◼ To view Host Routing Table:
◼ netstat –r
◼ route print

NET 365 36
Host Routing Tables
IPv4 Host Routing Table

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 37

You might also like