0% found this document useful (0 votes)
10 views48 pages

Data Networking: Routing Basics Guide

Uploaded by

kajal michael
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)
10 views48 pages

Data Networking: Routing Basics Guide

Uploaded by

kajal michael
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

WLS 5004: Data Networking

Routing and Packet Flow

Baha Uddin Kazi


Professor
Faculty of Applied Science and Technology
Humber College Institute of Technology and Advanced Learning
[Link]@[Link]
Outline

• Routing Concept
• Default Gateway
• Static Route
• Default Route
• Basic Router Configurations
Routing Concept
Host Packet Forwarding Decision
Host Packet Forwarding Decision
A host can send packets to:
• Loopback routing test: [Link]. All IP addresses within the [Link]/8 network are local
hosts.
• Local host: A host within the same LAN having similar network address.
• Remote host: A host in a remote network having different network address.

Host local routing table:


• Direct connection: route to the loopback interface.
• Local network route: The LAN network is populated in the host routing table.
• Local default route: The default gateway is either configured manually or assigned dynamically.
IPv4 Host Routing Entries
“netstat –r”, or “rout print”

“On-link” is shown if the


destination is directly reachable.

The metric lists the cost of each


route to determine the best route
to a destination.

Network Destination: lists the


reachable networks.

The Interface lists the physical


address used to send packets to
the gateway.
A Router Is a Computer
• Routers Interconnect Networks
• The router is responsible for the routing of traffic between
networks.
• Routers are specialized computers containing the following
required components to operate:
• Central processing unit (CPU)
• Operating system (OS) - Routers use IOS
• Memory and storage (RAM, ROM, NVRAM, Flash, hard drive)

Memor Volatile /
Stores
y Non-Volatile
• Running IOS
• Running configuration file
RAM Volatile
• IP routing and ARP tables
• Packet buffer
• Bootup instructions
• Basic diagnostic software (performs Power-
ROM Non-Volatile
On Self Test POST for all components)
• Limited IOS
NVRAM Non-Volatile • Startup configuration file
• IOS
Flash Non-Volatile
• Other system files
Router Backplane
Cisco 1941 Router.
EHWIC: Enhanced High-speed WAN Interface Card.
EHWIC support modularity and flexibility for different interfaces. EX: serial, digital subscriber line (DSL), switch port and wireless.
AUX port: RJ-45 for remote management.

Double-Wide EHWIC slots EHWIC 0 AUX LAN


Port Interfaces

Console
RJ-45 USB
Ports
Two 4 GB Flash Card Slots Console
USB Type B
Inside a Router
1. Power
Supply
1 2 2
2. Shield for WIC

3. Fan

4. SDRAM

5. NVRAM
5
6. CPU
4 6

7. Advanced 7
Integration 3
Module (AIM)
Routing Basics
Important list of the minimum factors a router must know to be able to effectively route packets:

• Destination address
• Neighbor routers from which it can learn about remote networks
• Possible routes to all remote networks
• The best route to each remote network
• How to maintain and verify routing information

• The router learns about remote networks from neighboring routers or from an administrator.
• The router then builds a routing table, which is basically a map of the internetwork, and it describes how to
find remote networks.
• If a network is directly connected, then the router already knows how to get to it.
IP Routing
R1 R2

Step 1 (Same Network): If the destination IP address is in the same IP subnet as sender, send the packet directly
to the destination host. Use the Address Resolution Protocol (ARP) table entry or use ARP messages to learn the
destination host’s MAC Address.

Step 2 (Different Network): Find the default gateway’s MAC address and send the packet to the default gateway,
also known as a default router.
Default Gateways
To enable network access devices must be
configured with the following IP address
information
▪ IP address - Identifies a unique host on a
local network.
▪ Subnet mask - Identifies the host’s
network subnet.
▪ Default gateway - Identifies the router a
packet is sent to when the destination is
not on the same local network subnet.
Default Gateway on a Host

Default Gateway
not needed
.10
PC1
[Link]/24
.1
PC2
.10 G0/0 Default Gateway
needed
R1
G0/1 .10
PC1 [Link]/24
.1
.1
.11 G0/0
.10 PC2
PC3
R1
.10 [Link]/24 G0/1
PC4 .1

.10
PC3

.11 [Link]/24
PC4
IP Routing
R1 R2

Router Forwarding Logic:


1. Check the Frame Check Sequence (FCS) field to ensure that the frame has no errors; if errors, discard the frame.
2. If frame has no error, discard the old data-link header and trailer (de-encapsulate), leaving the IP packet.
3. Find the network address
• Compare the network address of the destination IP address to the routing table
• Find the best route that matches the destination address.
• This route identifies the outgoing interface of the router, and possibly the next-hop router IP address.
4. Encapsulate the IP packet inside a new data-link header and trailer, appropriate for the outgoing interface, and
forward the frame.

How a router learn or populate routing table?


How a Router Learn about the Networks and Route a Packet
Extract IP Packet and Encapsulate in frame Extract IP Packet and Encapsulate in
HDLC IP Packet HDLC
frame
Eth-H IP Packet Eth-T

Eth-H IP Packet Eth-T


150.9.1
F0/1
.0 F0/1
R1 S0/0 R2
S0/0
150.9.4.
11
150.9.
4.0
Network Interface Network Interface
[Link]/24 F0/1 [Link]/24 F0/1
[Link]/24 S0/0 [Link]/24 S0/0
Step 1. Subnet [Link]/24 connected to Router R2. R2 adds a connected route for [Link]/24 to its IP routing table. This
happens without help from the routing protocol.
Step 2. R2 sends a routing protocol message, called a routing update, to R1, causing R1 to learn about subnet [Link]/24.
Step 3. R1 adds a route for subnet [Link]/24 to its routing table and the outgoing interface.
Step 4. R1 sends a similar routing update to R2, causing R2 to learn about subnet [Link]/24
Step 5. R2 adds a route for subnet [Link]/24 to its routing table and the outgoing interface.
How a Router Learn about the Networks

Step 1. Subnet [Link]/24 connected to Router R2. R2 adds a connected route for [Link]/24 to its IP
routing table. This happens without help from the routing protocol.
Step 2. R2 sends a routing protocol message, called a routing update, to R1, causing R1 to learn about subnet
[Link]/24.
Step 3. R1 adds a route for subnet [Link]/24 to its routing table and the outgoing interface.
Step 4. R1 sends a similar routing update to R2, causing R2 to learn about subnet [Link]/24
Step 5. R2 adds a route for subnet [Link]/24 to its routing table and the outgoing interface.
Methods a Router use to add Routes to Their Routing Table
▪ Connected routes:
▪ Router automatically adds a route to its routing table for the subnet connected to each interface.
▪ ip address interface subcommand.
• Static routes:
▪ Routes added to a routing table through direct configuration
▪ ip route global configuration Command
• Default route:
▪ If a packet does not match any other more specific route in the routing table, the router can at least
forward the packet to the default route.
▪ ip route global configuration Command
• Routing protocols:
▪ Routers dynamically tell each other about the network so that they all learn routes
Send a Packet (Example)
Forward to the Next Hop
R1 forwards packet to
R2
Packet Routing
Reach the Destination
A simple routing example

Fa0/3
[Link]/8
Fa0/1
Fa0/0
Lab_A [Link]/24

Fa0/2
[Link]/16

Router Lab A has four interfaces.


Which interface will be used to forward an IP datagram to a host with a destination IP address of [Link]?
Show ip route
show ip route  we can see the routing table (map of the internetwork) that Lab A has used to make its
forwarding decisions:

Lab_A#sh ip route
Codes: L - local, C - connected, S - static, Fa0/3
[output cut] [Link]/8
Fa0/1
[Link]/8 is variably subnetted, 6 subnets, 4 masks Fa0/0
Lab_A [Link]/24
C [Link]/8 is directly connected, FastEthernet0/3
Fa0/2
L [Link]/32 I s directly connected, FastEthernet0/3 [Link]/16
C [Link]/16 is directly connected, FastEthernet0/2
L [Link]/32 is directly connected, FastEthernet0/2
C [Link]/24 is directly connected, FastEthernet0/1
L [Link]/32 is directly connected, FastEthernet0/1
• C in the routing table output means that the networks listed are “directly connected,”
• L in the routing table, called a local route. Each has a /32 prefix defining a route just for the one address.
• Until we add a routing protocol like RIPv2, OSPF, etc., to the routers in our internetwork, or enter static
routes, only directly connected networks will show up in our routing table.
• Longest match
IP Routing Example 1
• A LAN connected to RouterA
• RouterA connected via a WAN link to RouterB.
• RouterB has a LAN connected with an HTTP server attached.

IP RouterB
RouterA
S0/0

S0/0
Fa0/0 Fa0/0

HostA
TCP Dest Port 80 HTTP Server

What is the destination MAC address, IP address and port number from HostA?
1. The destination address of a frame from HostA would be the MAC address of Router A’s Fa0/0 interface.
2. The destination address of a packet would be the IP address of the HTTP server’s network interface card (NIC).
3. The destination port number in the segment header would be 80.
IP Routing Example 2
Following Figure shows a network with only one router but two switches.

RouterA
Fa0/1 Fa1/1
S2 Fa2/1
Fa0/0

Fa0/1
S1

HTTPS Server
HostA

What is the destination MAC address, IP address and port number from HostA?
1. The destination address of a frame from Host A would be the MAC address of Router A’s Fa0/0 interface.
2. The destination address of a packet is the IP address of the HTTPS server’s network interface card (NIC).
3. The destination port number in the segment header will have a value of 443.
Basic IP routing using MAC and IP addresses
S0/0
Lab_A Lab_B
Fa0/0 S0/0 Fa0/0

Sales 1 2 3 4
Server

1. In order to begin communicating with the Sales server, Host 4 sends out an ARP request. How will the devices exhibited in
the topology respond to this request?
2. Host 4 has received an ARP reply. Host 4 will now build a packet, then place this packet in the frame. What information
will be placed in the header of the packet and frame that leaves Host 4 if Host 4 is going to communicate to the Sales server?
3. The Lab A router has received the packet and will send it out Fa0/0 onto the LAN toward the server. What will the frame
have in the header as the source and destination addresses?
4. Host 4 is displaying two web documents from the Sales server in two browser windows at the same time. How did the
data find its way to the correct browser windows?
Router Switching Functions
Routing Decisions
Best Path
▪ Best path is selected by a routing protocol based on the 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 routing protocols use their own rules and metrics to build and update routing tables for
example:
▪ Routing Information Protocol (RIP) - Hop count
▪ Open Shortest Path First (OSPF) - Cost based on cumulative bandwidth from source to
destination
▪ Enhanced Interior Gateway Routing Protocol (EIGRP) - Bandwidth, delay, load, reliability

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.
The Routing Table
▪ Routing Table is a file stored in RAM that contains information about

▪ Directly Connected Routes


▪ Remote Routes
▪ Network or Next hop Associations

Routing Table Sources:


• Link local Interfaces –Added to the routing table when an interface is configured. (displayed in IOS 15 or newer)
• Directly connected interfaces -Added to the routing table when an interface is configured and active.
• Static routes - Added when a route is manually configured and the exit interface is active.
• Dynamic routing protocol - Added when EIGRP or OSPF are implemented and networks are identified.
Directly Connected Interfaces
• A newly deployed router, without any configured interfaces, has an empty routing table.
• An active, configured directly connected interface creates two routing table entries Link Local (L)
and Directly Connected (C)
Remote Network Routing Entries
• Interpreting the entries in the routing table.
Basic Router Configurations
Basic Router Configurations
Basics tasks that should be first configured on a Cisco Router and Cisco Switch:
• Name the device – Distinguishes it from other routers
• Secure management access – Secures privileged EXEC, user EXEC, and Telnet access, and encrypts passwords to their
highest level
• Configure a banner – Provides legal notification of unauthorized access
Configuring Router Interfaces
To be available a router interface must be:
• Configured with an address and subnet
mask .
• Activated – by default LAN and WAN
interfaces are not activated. Must be
activated using no shutdown command.
• Other parameters - serial cable end
labeled DCE must be configured with
the clock rate command.
• Optional description can be included.
Configuring a Loopback Interface
• Loopback interface is a logical
interface internal to the router.
• It is not assigned to a physical
port, it is considered a software
interface that is automatically in
an UP state.
• Useful for testing and important
in the OSPF routing process.
Verify/Trouble Shoot Interface Settings
Show commands to verify
operation and configuration
of interface.
• show ip interfaces brief
• show ip route
• show running-config
Show commands to gather
more detailed interface
information.
• show interfaces
• show ip interfaces
Filter Show Command Output
• Use the terminal length number command to specify the number of lines to be displayed. where number in between 0
and 512. The default is 24.
• To filter specific output of commands use the (|) pipe character after show command. Parameters that can be used after
pipe include:
• section, include, exclude, begin
Static and Default Routing
Static Routing
• Manually configured
• Define an explicit path between two networking devices.
• Must be manually updated if the topology changes.
• Benefits include improved security and control of resources.
Command syntax you use to add a static route to a routing table from global config:
ip route [destination_network] [mask] [next-hop_address or exitinterface] [administrative_distance] [permanent]

ip route  The command used to create the static route


destination_network  The network you’re placing in the routing table
Mask The subnet mask being used on the network
next-hop_address  This is the IP address of the next-hop router that will receive packets and forward them to the remote
network, which is a router interface in the directly connected network.
Exitinterface  Used in place of the next-hop address if you want, and shows up as a directly connected route
administrative_distance  By default, static routes have an administrative distance of 1. You can change the default value
by adding an administrative weight at the end of the command.
Permanent  If the interface is shut down or the router can’t communicate to the next-hop router, the route will
automatically be discarded from the routing table by default. Choosing the permanent option keeps the entry in the routing
table no matter what happens.
Static Route Configuration Example

R1:
ip route [Link] [Link] [Link]
OR
ip route [Link] [Link] S0/0/0
Static Route Examples
Router(config)#ip route [Link] [Link] [Link]

The ip route command tells us simply that it’s a static route.


[Link] is the remote network we want to send packets to.
[Link] is the mask of the remote network.
[Link] is the next hop ip that packets will be sent to.

Router(config)#ip route [Link] [Link] [Link] 150

That 150 at the end changes the default administrative distance (AD) of 1 to 150.

Router(config)#ip route [Link] [Link] s0/0/0

Instead of using a next-hop address, we can use an exit interface that will make the route show up as a
directly connected network. Functionally, the next hop and exit interface work exactly the same.
Default Routing
A stub network indicates that the networks in this design have only one way out to reach all other networks,
which means that instead of creating multiple static routes, we can just use a single default route.
This default route is used by IP to forward any packet with a destination not found in the routing table, which
is why it is also called a gateway of last resort.
The default route matches all packets

LA#config t
LA(config)#ip route [Link] [Link] [Link]
LA(config)#do sho ip route

Gateway of last resort is [Link] to network [Link]


[Link]/30 is subnetted, 1 subnets
C [Link] is directly connected, Serial0/0/1
L [Link]/32 is directly connected, Serial0/0/1
C [Link]/24 is directly connected, FastEthernet0/0
L [Link]/32 is directly connected, FastEthernet0/0
S* [Link]/0 [1/0] via [Link]
Static Default Route Configuration Example
Troubleshooting

R1# show running-config

Line Status Protocol Status Basic Reason


(Layer 1 Status) (Layer 2 Status)
Administratively Down The interface has a shutdown command configured on it.
down
Down Down The interface is not shutdown, but the physical layer has a problem. For example, no
cable has been attached to the interface, or with Ethernet, the switch interface on the
other end of the cable is shut down or the switch is powered off.
UP Down Almost always refers to data link layer problems, most often configuration problems. For
example, serial links have this combination when one router was configured to use PPP
and the other defaults to use HDLC.
UP UP Layer 1 and Layer 2 of this interface are functioning.
Verification
R1# show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
[Link]/24 is variably subnetted, 2 subnets, 2 masks
C [Link]/24 is directly connected, GigabitEthernet0/1
L [Link]/32 is directly connected, GigabitEthernet0/1
R [Link]/24 [120/1] via [Link], 00:00:21, Serial0/0/0
R [Link]/24 [120/1] via [Link], 00:00:05, Serial0/0/1
[Link]/24 is variably subnetted, 2 subnets, 2 masks
C [Link]/24 is directly connected, Serial0/0/1
L [Link]/32 is directly connected, Serial0/0/1
[Link]/24 is variably subnetted, 2 subnets, 2 masks
C [Link]/24 is directly connected, Serial0/0/0
L [Link]/32 is directly connected, Serial0/0/0
R [Link]/24 [120/1] via [Link], 00:00:21, Serial0/0/0
[120/1] via [Link], 00:00:05, Serial0/0/1
References

1. Network Basics Companion Guide, Cisco Press, 2014.


2. Odom, Wendell. “CCNA Routing and Switching 200-125 Official Cert Guide”. Cisco
Press
Thank you

"Having gratitude unlocks the fullness of life” – Melody Beattie

You might also like