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

9.Layer 3 Routing Basic and Static Route

Chapter 9 of CCNA++ covers the basics of routing, including static and dynamic routing protocols, the structure of routing tables, and the IP routing process for both same and different subnets. It explains how to configure static routes, the routing lookup process, default routes, hop count, and the use of traceroute for path tracing. The chapter emphasizes the importance of understanding these concepts for effective network management and communication.

Uploaded by

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

9.Layer 3 Routing Basic and Static Route

Chapter 9 of CCNA++ covers the basics of routing, including static and dynamic routing protocols, the structure of routing tables, and the IP routing process for both same and different subnets. It explains how to configure static routes, the routing lookup process, default routes, hop count, and the use of traceroute for path tracing. The chapter emphasizes the importance of understanding these concepts for effective network management and communication.

Uploaded by

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

CCNA++

Chapter 9 - Routing Basic & Static Route

By Sean Ning
Routing Basics
“Routing is the process of selecting a path for traffic in a network or between or across multiple networks”
- Wikipedia

Routing table = Map

Two types of routing protocol:


1. Static (paper map - fixed)
2. Dynamic (google map – dynamic update)
The Routing Table
A routing table consists:
• Directly connected networks
• Routes learned statically
• Routes learned dynamically

You can use show ip route to check the routing table of a Router or Layer 3 switch.

Can PC_A ping PC_B without configuring any static or dynamic routing on the Router?
Connected Route & Local Route

‘C’ identifies a directly connected network. Directly connected networks are automatically created when an interface is
configured with an IP address and activated.

‘L’ identifies the address configured on the local interface.


Ping or Internet Control Message Protocol (ICMP)
Type Description ICMP Message Types
0 Echo Reply (Ping Reply, used with Type 8, Ping Request)
3 Destination Unreachable
4 Source Quench
5 Redirect
8 Echo Request (Ping Request, used with Type 0, Ping Reply)
9 Router Advertisement (Used with Type 9)
10 Router Solicitation (Used with Type 10)
11 Time Exceeded
12 Parameter Problem
13 Timestamp Request (Used with Type 14)
14 Timestamp Reply (Used with Type 13)
15 Information Request (obsolete) (Used with Type 16)
16 Information Reply (obsolete) (Used with Type 15)
17 Address Mask Request (Used with Type 17)
18 Address Mask Reply (Used with Type 18)
IP Routing Process (Same Subnet)
AND Gate

AND Gate Truth Table

Host A and Host C are in same network:


1. If Host A pings Host C’s address, ICMP creates a packet that contains source IP (host A’s IP) address and
destination IP (host C’s IP) address. Host A performs Binary AND Operation to identify if destination address is in
the same subnet AND
Host A’s IP (10.10.10.2) in binary = 00001010.00001010.00001010.00000010
Host C’s IP (10.10.10.3) in binary = 00001010.00001010.00001010.00000011
AND Operation Result = 00001010.00001010.00001010.00000010
Host A’s subnet(10.10.10.0/24) = 00001010.00001010.00001010.00000000
Only the first 24 bits will be compared
Compare the obtained result and Host A’s subnet, Host A and C are in same subnet if the result is the same
2. Host A broadcasts ARP request to query MAC address of 10.10.10.3
• Same subnet, broadcast ARP to get destination MAC address
IP Routing Process (Different Subnet)

Host A and Host B are in different networks:


1. ICMP creates a packet that contains source IP (host A’s IP) address and destination IP (host B’s IP) address. Host A
performs Binary AND Operation to identify if destination address is in the same subnet

Host A’s IP (10.10.10.2) in binary = 00001010.00001010.00001010.00000010


Host B’s IP (20.20.20.2) in binary = 00010100.00010100.00010100.00000010
AND Operation Result = 00000000.00000000.00000000.00000000
Host A’s subnet(10.10.10.0/24) = 00001010.00001010.00001010.00000000

Compare the obtained result and Host A’s subnet, Host A and B are in different subnet if the result is different
IP Routing Process (Different Subnet)

2. If destination address is in different subnet, the packet must forward to gateway


3. The default gateway of host A is configured to 10.10.10.1. Therefore, host A sends an ARP request into local LAN
and search for MAC address of 10.10.10.1.
• Different subnet, broadcast ARP to get gateway MAC address
4. The router responds to the request and provide MAC address of g0/0 to host A
5. Now the packets is forwarding to router via g0/0. Once router received the packet, it looks up the destination IP
address in its routing table.
6. The router does find an entry for network 20.20.20.0/24 in its routing table and it is “directly connected” with
interface g0/1.
7. The router sends an ARP request out g0/1 looking for the MAC address of 20.20.20.2. Host B responds with its MAC
address.
8. The packet sends out from g0/1 to Host B. Host B immediately check destination MAC address and IP address once
it receives the packet. If all pass, an echo reply will be generated.
IP Routing Process (Different Subnet)

9. A packet is then created including the source address (host B’s IP) and destination address (host A’s IP).
10. Similarly, Host B finds destination IP is in remote network, host B sends an ARP request to look for the MAC address of its default
gateway.
11. Router responds the request and provide MAC address of g0/1 to host B,
12. Host B sends the ICMP packet to router interface g0/1.
13. Router looks up the destination address in its routing table and finds 10.10.10.0/24 network is directly connected to g0/0.
(Router discard packet if it cannot find destination address - When Ping fails most people think the packet never reach the
destination, but as we see here, that is not always the case)
14. Since MAC address of 10.10.10.2 is already cached from the original trip to Host B, the packet is forwarding to Host A via g0/0
without doing ARP query again
Configure Static Routes
Configure R1 and R2 so that Host A can ping Host B.

Only “C” & “L” route are installed into routing table after we configuring IP address of the router interfaces
Configure Static Routes

To add a static route to the routing table, type a command using the following syntax in global configuration mode:
ip route [destination_network] [mask] [ next_hop_address] [AD]

Enter the following command to add a static route on R1: Enter the following command to add a static route on R2:
ip route 20.20.20.0 255.255.255.0 100.100.100.2 ip route 10.10.10.0 255.255.255.0 100.100.100.1
Routing Lookup Process
When a packet arrives on a router interface, the router examines the IPv4 header, identifies the destination IPv4
address, and proceeds through the router lookup process.

1. The router reads IP addresses in binary, it takes destination IP address from the packet then perform logic AND
with all prefixes in its routing table.

2. If the result is exactly matching the prefix, the router forwards the packet to the next-hop router. If there are
multiply possible prefixes can be used, the longest-match prefix will be selected.

3. The next-hop router repeats the same process – take out destination IP address and perform IP lookup in its
routing table.

4. Sooner or later, there would be one router finds the destination IP address “matches” one of its prefixes and
this prefix is directly connected to it. Now the packet would be handled by Data Link Layer, an ARP request will
be sent out to discovery the final destination host.

5. Router drops the packet if can’t match anything in routing table.


Example: Routing Lookup Process

20.20.20.0/24 via 100.100.100.2 20.20.20.0/24 Directly Connected


100.100.100.0/30 Directly Connected 100.100.100.0/30 Directly Connected
10.10.10.0/24 Directly Connected 10.10.10.0/24 via 100.100.100.1

The following processes showing Router1 and Router2 perform routing lookup and make routing decision after received
packet destined to 20.20.20.2(Host B):
Convert to binary
1. Destination IP address: 20.20.20.2 00010100.00010100.00010100 .00000010
Convert to binary
Prefix in routing table: 20.20.20.0/24 00010100.00010100.00010100 .00000000 COMPARE THEM
Result = 00010100.00010100.00010100 .00000000 MATCHED!

Since 100.100.100.2 is the next-hop address associated with prefix 20.20.20.0/24, therefore, Router 1 knows Host B can be reached by
forwarding packet to it.
Example: Routing Lookup Process

20.20.20.0/24 via 100.100.100.2 20.20.20.0/24 Directly Connected


100.100.100.0/30 Directly Connected 100.100.100.0/30 Directly Connected
10.10.10.0/24 Directly Connected 10.10.10.0/24 via 100.100.100.1

20.20.20.0/24 via x.x.x.x


2. Router 1 will continue examinant the rest prefixes (longest-match rule) 20.20.20.0/28 via y.y.y.y
(In this example only 20.20.20.0/24 matches destination IP address) 20.20.0.0/16 via z.z.z.z

3. Router 1 sends packets to next-hop address – 100.100.100.2 – Router 2 Fa0/0 interface

4. Router 2 receives packets and uses same method to examinant the destination IP address

5. Router 2 finds 20.20.20.0/24 is the matched prefix, and it is directly connected to itself.
Default Route
“In computer networking, the default route is a setting on a computer that defines the packet forwarding rule to use
when no specific route can be determined for a given Internet Protocol (IP) destination address. All packets for
destinations not established in the routing table are sent via the default route.” - Wikipedia

ip route 0.0.0.0 0.0.0.0


Hop Count
Hop Count is the number of routers a packet passes through a route to a remote network.

• Some Routing Protocols (namely RIP) use Hop Count to compute distance.

• Less Hop Count path is preferred over more Hop Count Path.
(Not always be, because there are some other criteria can affect path selection – Hop Count is one of them)

1st Hop 2nd Hop 3rd Hop

In this example, the amount of hops to send packets from Host A to Host B is 3
Traceroute
Traceroute is used to trace back along a path to a target in order to learn the routers that in between the originator
and target. Microsoft traceroute command uses ICMP and the Cisco/Linux traceroute command uses UDP

ICMP Traceroute
UDP Traceroute
Join Us

You might also like