CCNA2 - Module 14 - 16 Flashcards
(75 cards)
When a router gets an IP packet through one of its ports
(called interfaces), it decides where to send it next. This process is called _. The router chooses another interface to send the packet toward its destination. Sometimes, the destination is directly connected to the router. Other times, the router sends the packet to another router that will continue moving it closer to the final destination.
Most of the time, each network a router connects to needs its own interface, but there are exceptions.
routing
The two main jobs of a router are:
- Find the
best path
for a packet using its routing table. -
Send
the packet on its wayto the destination
.
he router uses its _ to determine which path (route) to use to forward a packet.
R1 and R2 will use their respective IP routing tables to first determine the best path, and then forward the packet.
IP routing table
- The best path in the routing table is also known as the .
longest match
the route in the routing table that has the greatest number of far-left matching bits with the destination IP address of the packet. The longest match is always the preferred route.
longest match
: Added to the routing table when a local interface is configured
with an IP address and subnet mask (prefix length) and is active (up and up).
Directly Connected Networks
: Networks that are not directly connected to the router.
Routers learn about remote networks in two ways:
Remote Networks
- Added to the routing table when a route is manually configured.
Static routes
- Added to the routing table when
routing protocols dynamically learn about the remote network.
- Added to the routing table when
Dynamic routing protocols
: Specifies a next-hop router to use when the routing table does not contain a specific route that matches the destination IP address
. The default route can be entered manually
as a static route, or learned automatically
from a dynamic routing protocol.
Default Route
This means that no bits need to match the destination IP address for this route entry to be used
. If there are no routes with a match longer than 0 bits, the default route is used to forward the packet. The default route is sometimes referred to as a gateway of last resort.
default route
Packet Forwarding Decision Process
- The data link frame with an encapsulated IP packet arrives on the ingress interface.
- The router examines the destination IP address in the packet header and consults its IP routing table.
- The router finds the longest matching prefix in the routing table.
- The router encapsulates the packet in a data link frame and forwards it out the egress interface. The destination could be a device connected to the network or a next-hop router.
- However, if there is no matching route entry the packet is dropped.
What a Router Does After Choosing the Best Path
- Forwarding to a Device on a Directly Connected Network
- If the router sees that the destination is on a network it’s directly connected to (like a local Ethernet LAN), it sends the packet straight to that device.
- To do this, it wraps the packet in a special frame (like an envelope) and needs to know the device’s MAC address.
- The way it finds the MAC address depends on whether the packet uses IPv4 or IPv6.
- Forwarding to a Next-Hop Router
- If the destination is not directly connected, the packet has to go through another router (called the next-hop).
- The router uses its routing table to find the next-hop router’s IP address.
- Then, just like before, it finds the MAC address—but this time it looks up the next-hop router’s MAC address (not the final destination’s).
- This process may differ depending on the type of network being used (like Ethernet vs others).
- Dropping the Packet
- If the router can’t find a match for the destination in its routing table and there’s no default route, it drops the packet (meaning it doesn’t forward it anywhere).
How Routers Actually Send Packets Out (Encapsulation)
- Routers send packets out using a
data link frame
—basically, a format that matches the type of connection being used (like Ethernet, PPP, or HDLC). - The faster the router can wrap and send packets in the right format, the better its performance.
Three Ways Routers Forward Packets
- Process Switching (Oldest & Slowest)
* Every packet is handled by the CPU one by one.
* Even if many packets go to the same place, the router repeats the whole process for each one. - Fast Switching (Better)
* The router uses a cache to remember past forwarding decisions.
* The first packet is handled like process switching, but the next ones going to the same place are sent much faster using the cached info. - Cisco Express Forwarding (CEF) – Fastest and Default Today
* Instead of reacting to each packet, the router prepares ahead of time using special tables (FIB and adjacency table).
* These tables are kept up to date when the network changes, so the router always knows the best and fastest way to forward packets.
Verification Commands
Common verification commands include the following:
- show ip interface brief
- show running-config interface interface-type number
- show interfaces
- show ip interface
- show ip route
- ping
Filter Command Output
Filtering commands can be used to display specific sections of output. To enable the filtering command, enter a pipe (|) character after the show command and then enter a filtering parameter and a filtering expression.
The filtering parameters that can be configured after the pipe include:
- section - This displays the entire section that starts with the filtering expression.
- include - This includes all output lines that match the filtering expression.
- exclude - This excludes all output lines that match the filtering expression.
- begin - This displays all the output lines from a certain point, starting with the line that matches the filtering expression.
A routing table contains a list of routes to known networks (prefixes and prefix lengths). The source of this information is derived from the following:
- Directly connected networks
- Static routes
- Dynamic routing protocols
The source for each route in the routing table is identified by a code. Common codes include the following:
- L - Identifies the address assigned to a router interface.
- C - Identifies a directly connected network.
- S - Identifies a static route created to reach a specific network.
- O - Identifies a dynamically learned network from another router using the OSPF routing protocol.
- *- This route is a candidate for a default route.
Routing Table Entries
In the figure, the numbers identify the following information:
- Route source - This identifies how the route was learned.
- Destination network (prefix and prefix length) - This identifies the address of the remote network.
- Administrative distance - This identifies the trustworthiness of the route source. Lower values indicate preferred route source.
- Metric - This identifies the value assigned to reach the remote network. Lower values indicate preferred routes.
- Next-hop - This identifies the IP address of the next router to which the packet would be forwarded.
- Route timestamp - This identifies how much time has passed since the route was learned.
- Exit interface - This identifies the egress interface to use for outgoing packets to reach their final destination.
- This identifies how the route was learned.
- Route source
- This identifies the address of the remote network.
- Destination network (prefix and prefix length)
- This identifies the trustworthiness of the route source. Lower values indicate preferred route source.
- Administrative distance