Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 1 Routing Concepts (Routing Decisions (Switching Packets Between…
Chapter 1 Routing Concepts
Router Functions
Router Functions
Characteristics of a Network
While the term “speed” is commonly used when referring to the network bandwidth, it is not technically accurate. The actual speed that the bits are transmitted does not vary over the same medium.
The difference in bandwidth is due to the number of bits transmitted per second, not how fast they travel over wire or wireless medium.
there are many key structures and performance-related characteristics referred to when discussing networks:
Reliability
- Reliability indicates the dependability of the components that make up the network, such as the routers, switches, PCs, and servers. Reliability is often measured as a probability of failure or as the mean time between failures (MTBF).
Scalability
- Scalability indicates how easily the network can accommodate more users and data transmission requirements. If a network design is optimized to only meet current requirements, it can be very difficult and expensive to meet new needs when the network grows.
Availability
- Availability is the likelihood that the network is available for use when it is required.
Security
- Security indicates how protected the network is, including the information that is transmitted over the network. The subject of security is important, and techniques and practices are constantly evolving. Consider security whenever actions are taken that affect the network.
Cost
- Cost indicates the general expense for purchasing of network components, and installation and maintenance of the network.
Speed
- is a measure of the
data rate
in bits per second (b/s) of a given link in the network.
Topology
- There are physical and logical topologies.
The
logical
topology is
the path over which the data is transferred in a network
. It describes how the network devices appear connected to network users.
The
physical
topology is the arrangement of the cables, network devices, and end systems. It describes how the network devices are actually interconnected with wires and cables.
Why Routing?
Stated simply, a router connects one network to another network.
A router determines the best path to the destination and forwarding traffic to the next router along that path.
The router uses its
routing table
to determine how to reach the destination network.
Routers Are Computers
A router is essentially a specialized computer. It requires a CPU and memory to temporarily and permanently store data to execute operating system instructions, such as system initialization, routing functions, and switching functions.
Router memory is classified as volatile or non-volatile. Volatile memory loses its content when the power is turned off, while non-volatile memory does not lose its content when the power is turned off.
Routers have specialized ports and network interface cards to interconnect devices to other networks
Routers Choose Best Paths
The router uses its routing table to determine the best path to use to forward a packet. When the router receives a packet, it examines the destination address of the packet and uses the routing table to search for the best path to that network.
The routing table also includes the interface to be used to forward packets for each known network.
When a match is found, the router encapsulates the packet into the data link frame of the outgoing or exit interface, and the packet is forwarded toward its destination.
Routers use static routes and dynamic routing protocols to learn about remote networks and build their routing tables.
Routers Interconnect Networks
A router connects multiple networks, which means that it has multiple interfaces that each belong to a different IP network. When a router receives an IP packet on one interface, it determines which interface to use to forward the packet to the destination.
The interface that the router uses to forward the packet may be the final destination, or it may be a network connected to another router that is used to reach the destination network.
Packet Forwarding Mechanisms
Routers support three packet-forwarding mechanisms:
Process switching
- An
older
packet forwarding mechanism still available for Cisco routers. This process-switching mechanism is very
slow
and rarely implemented in modern networks.
When a packet arrives on an interface, it is forwarded to the
control plane
where the
CPU matches the destination address with an entry in its routing table
and then
determines the exit interface and forwards the packet
. It is important to understand that the
router does this for every packet
, even if the destination is the same for a stream of packets.
Fast switching
- This is a common packet forwarding mechanism which uses a
fast-switching cache to store next-hop information
.
When a packet arrives on an interface, it is forwarded to the control plane where the
CPU searches for a match in the fast-switching cache
. If it is not there, it is process-switched and forwarded to the exit interface.
The flow information for the packet is also stored in the fast-switching cache. If another packet going to the same destination arrives on an interface, the next-hop information in the cache is re-used without CPU intervention.
Cisco Express Forwarding
(CEF) is the most recent and preferred Cisco IOS packet-forwarding mechanism.
Like fast switching,
CEF builds a Forwarding Information Base (FIB), and an adjacency table
.
However, the table entries are not packet-triggered like fast switching but change-triggered such as when something changes in the network topology. Therefore, when a network has converged, the FIB and adjacency tables contain all the information a router would have to consider when forwarding a packet. The FIB contains pre-computed reverse lookups, next hop information for routes including the interface and Layer 2 information. Cisco Express Forwarding is the
fastest forwarding mechanism
and the preferred choice on Cisco routers.
Connect Devices
Connect to a Network
Home Office devices can connect as follows:
A network printer connects using an Ethernet cable to the switch port on the home router.
The home router connects to the service provider cable modem using an Ethernet cable.
The cable modem connects to the Internet service provider (ISP) network.
Laptops and tablets connect wirelessly to a home router.
The Branch site devices connect as follows:
Corporate resources (i.e., file servers and printers) connect to Layer 2 switches using Ethernet cables.
Desktop PCs and voice over IP (VoIP) phones connect to Layer 2 switches using Ethernet cables.
Laptops and smartphones connect wirelessly to wireless access points (WAPs).
The WAPs connect to switches using Ethernet cables.
Layer 2 switches connect to an Ethernet interface on the edge router using Ethernet cables. An edge router is a device that sits at the edge or boundary of a network and routes between that network and another, such as between a LAN and a WAN.
The edge router connects to a WAN service provider (SP).
The edge router also connects to an ISP for backup purposes.
The Central site devices connect as follows:
Desktop PCs and VoIP phones connect to Layer 2 switches using Ethernet cables.
Layer 2 switches connect redundantly to multilayer Layer 3 switches using Ethernet fiber-optic cables (orange connections).
Layer 3 multilayer switches connect to an Ethernet interface on the edge router using Ethernet cables.
The corporate website server is connected using an Ethernet cable to the edge router interface.
The edge router connects to a WAN SP.
The edge router also connects to an ISP for backup purposes.
Default Gateways
When a host sends a packet to a device that is on the same IP network, the packet is simply forwarded out of the host interface to the destination device.
When a host sends a packet to a device on a different IP network, then the packet is forwarded to the default gateway, and must send the packet to the Media Access Control (MAC) address of its default gateway.
The default gateway is the destination that routes traffic from the local network to devices on remote networks. It is often used to connect a local network to the Internet.
The default gateway is usually the address of the interface on the router connected to the local networ
A router is also usually configured with its own default gateway. This is known as the Gateway of Last Resort.
Document Network Addressing
Topology diagram
- Provides a visual reference that indicates the physical connectivity and logical Layer 3 addressing. Often created using software, such as Microsoft Visio.
An addressing table
- A table that captures device names, interfaces, IPv4 addresses, subnet masks, and default gateway addresses.
Enable IP on a Host
Statically
- The host is manually assigned the correct IP address, subnet mask, and default gateway. The DNS server IP address can also be configured.
Statically assigned addresses are commonly used to identify specific network resources, such as network servers and printers
Dynamically - IP address information is provided by a server using the Dynamic Host Configuration Protocol (DHCP). The DHCP server provides a valid IP address, subnet mask, and default gateway for end devices. Other information may be provided by the server.
Device LEDs
Green = OK
Blink green = activity / initializing
OFF or ambar = a problem
Console Access
Console access is really only required when initially configuring a device, or if remote access fails.
Console access requires:
Console cable - RJ-45-to-DB-9 serial cable or a USB serial cable. OR USB Type-A to USB Type-B cable
Terminal emulation software - Tera Term, PuTTY, HyperTerminal
Enable IP on a Switch
A switch does not have a dedicated interface to which an IP address can be assigned.
Instead, the IP address information is configured on a virtual interface called a switched virtual interface (SVI)
vlan #
int vlan #
ip address
ip
mask
no shutdown
ip default-gateway
ip
Router Basic Settings
Configure Basic Router Settings
Configure a banner
– Provides legal notification of unauthorized access:
R1(config)#banner motd #my message goes her#
Name the device
– Distinguishes it from other router:
Router(config)#hostname RouterName
Secure management access
– Secures privileged EXEC, user EXEC, and remote access:
R1(config)# enable secret
mysecret
R1(config)# line console 0
R1(config-line)# password
mypassword
R1(config-line)# login
R1(config)# line vty 0 15
R1(config-line)# password
mypassword
R1(config-line)# login
R1(config)# service password-encryption
Save configuration
: R1#copy running-config startup-config
Configure an IPv4 Router Interface
A serial interface connecting to the serial cable end labeled DCE must be configured with the
clock rate
command.
Accidentally using the clock rate command on a DTE interface generates a “%Error: This command applies only to DCE interface” informational message
Configure an IPv6 Router Interface
An interface can generate its own IPv6 link-local address without having a global unicast address by using the
ipv6 enable
interface configuration command.
ipv6 address ipv6-address/prefix-length
- Creates a
global unicast
IPv6 address as specified.
ipv6 address ipv6-address/prefix-length eui-64
- Configures a global unicast IPv6 address with an interface identifier (ID) in the low-order 64 bits of the IPv6 address using the EUI-64 process.
ipv6 address ipv6-address/prefix-length link-local
- Configures a static link-local address on the interface that is used instead of the link-local address that is automatically configured when the global unicast IPv6 address is assigned to the interface or enabled using the
ipv6 enable
interface command. Recall, the ipv6 enable interface command is used to automatically create an IPv6 link-local address whether or not an IPv6 global unicast address has been assigned.
Configure an IPv4 Loopback Interface
The loopback interface is a logical interface internal to the router. It is not assigned to a physical port and can therefore never be connected to any other device. It is considered a software interface that is automatically placed in an “up” state, as long as the router is functioning.
The loopback interface is useful in testing and managing a Cisco IOS device because it ensures that at least one interface will always be available. For example, it can be used for testing purposes, such as testing internal routing processes, by emulating networks behind the router.
Additionally, the IPv4 address assigned to the loopback interface can be significant to processes on the router that use an interface IPv4 address for identification purposes, such as the Open Shortest Path First (OSPF) routing process. By enabling a loopback interface, the router will use the always available loopback interface address for identification, rather than an IP address assigned to a physical port that may go down.
Verify Connectivity of Directly Connected Networks
Verify Interface Settings
show ip interface brief
- Displays a summary for all interfaces including the IPv4 address of the interface and current operational status.
show ip route
- Displays the contents of the IPv4 routing table stored in RAM. In Cisco IOS 15, active interfaces should appear in the routing table with two related entries identified by the code ‘C’ (Connected) or ‘L’ (Local). In previous IOS versions, only a single entry with the code ‘C’ will appear.
A local host route has an administrative distance of 0. It also has a /32 mask for IPv4, and a /128 mask for IPv6
show running-config interface interface-id
- Displays the commands configured on the specified interface.
The following two commands are used to gather more detailed interface information:
show interfaces
- Displays interface information and packet flow count for all interfaces on the device.
show ip interface
- Displays the IPv4 related information for all interfaces on a router.
Verify IPv6 Interface Settings
The
show ipv6 interface brief
command displays a summary for each of the interfaces.
The “up/up” output on the same line as the interface name indicates the Layer 1/Layer 2 interface state. This is the same as the Status and Protocol columns in the equivalent IPv4 command.
The
show ipv6 interface interface interface-id
command output shown in Figure 2 displays the interface status and all of the IPv6 addresses belonging to the interface. Along with the link local address and global unicast address, the output includes the multicast addresses assigned to the interface, beginning with prefix FF02.
The
show ipv6 route
command can be used to verify that IPv6 networks and specific IPv6 interface addresses have been installed in the IPv6 routing table. The showipv6route command will only display IPv6 networks, not IPv4 networks.
Within the routing table, a ‘C’ next to a route indicates that this is a directly connected network. When the router interface is configured with a global unicast address and is in the “up/up” state, the IPv6 prefix and prefix length is added to the IPv6 routing table as a connected route.
The ping command for IPv6 is identical to the command used with IPv4 except that an IPv6 address is used. The ping command is used to verify Layer 3 connectivity between R1 and PC1.
Filter Show Command Outp
Commands that generate multiple screens of output are, by default,
paused after 24 lines
. At the end of the paused output, the
--More--
text displays. Pressing Enter displays the next line and pressing the spacebar displays the next set of lines
Use the
terminal length
command to specify the number of lines to be displayed.
A value of 0 (zero) prevents the router from pausing between screens of 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
- Shows entire section that starts with the filtering expression
include
- Includes all output lines that match the filtering expression
exclude
- Excludes all output lines that match the filtering expression
begin
- Shows all the output lines from a certain point, starting with the line that matches the filtering expression
Command History Feature
The command history feature is useful, because it temporarily stores the list of executed commands to be recalled.
To recall commands in the history buffer, press Ctrl+P or the Up Arrow key. To return to more recent commands in the history buffer, press Ctrl+N or the Down Arrow key.
By default, command history is enabled and the system captures the last 10 command lines in its history buffer. Use the
show history
privileged EXEC command to display the contents of the buffer.
Use the terminal
history size user
EXEC command to increase or decrease the size of the buffer.
Routing Decisions
Switching Packets Between Networks
Router Switching Function
A primary function of a router is to forward packets toward their destination. This is accomplished by using a switching function, which is the process used by a router to accept a packet on one interface and forward it out of another interface.
A key responsibility of the switching function is to encapsulate packets in the appropriate data link frame type for the outgoing data link.
The router performs the following three major steps:
Step 1. De-encapsulates the Layer 2 frame header and trailer to expose the Layer 3 packet.
Step 2. Examines the destination IP address of the IP packet to find the best path in the routing table.
In this context, the term “switching” literally means moving packets from source to destination and should not be confused with the function of a Layer 2 switch.
Send a Packet
If a host is sending a packet to another. It must determine if the destination IPv4 address is on the same network..
The host determines its own subnet by doing an AND operation on its own IPv4 address and subnet mask. Next, the host does this same AND operation using the packet destination IPv4 address and its subnet mask
If the destination network address is the same network as source host, then source host does not use the default gateway. Instead, it refers to its ARP cache for the MAC address of the device with that destination IPv4 address. If the MAC address is not in the cache, then it generates an ARP request to acquire the address to complete the packet and send it to the destination.
If the destination network address is on a different network, then the host forwards the packet to its default gateway.
To determine the MAC address of the default gateway, the host checks its ARP table for the IPv4 address of the default gateway and its associated MAC address.
If an ARP entry does not exist in the ARP table for the default gateway, the host sends an ARP request. the Router sends back an ARP reply. the host can then forward the packet to the MAC address of the default gateway,
A similar process is used for IPv6 packets. Instead of the ARP process, IPv6 address resolution uses ICMPv6 Neighbor Solicitation and Neighbor Advertisement messages. IPv6-to-MAC address mapping are kept in a table similar to the ARP cache, called the neighbor cache.
Packet Routing
When the interface is a point-to-point (P2P) serial connection, the router encapsulates the IPv4 packet into the proper data link frame format used by the exit interface (HDLC, PPP, etc.). Because there are no MAC addresses on serial interfaces, R2 sets the data link destination address to an equivalent of a broadcast
Path Determination
The routing table search results in one of three path determinations:
Directly connected network
- If the destination IP address of the packet belongs to a device on a network that is directly connected to one of the interfaces of the router, that packet is forwarded directly to the destination device. This means that the destination IP address of the packet is a host address on the same network as the interface of the router.
Remote network
- If the destination IP address of the packet belongs to a remote network, then the packet is forwarded to another router. Remote networks can only be reached by forwarding packets to another router.
No route determined
- If the destination IP address of the packet does not belong to either a connected or remote network, the router determines if there is a
Gateway of Last Resort
available. A Gateway of Last Resort is set when a default route is configured or learned on a router. If there is a default route, the packet is forwarded to the Gateway of Last Resort. If the router does not have a default route, then the packet is discarded.
Best Path
The 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 quantitative value used to measure the distance to a given network. The best path to a network is the path with the lowest metric.
Dynamic routing protocols typically use their own rules and metrics to build and update routing tables. The routing algorithm generates a value, or a metric, for each path through the network.
Metrics can be based on either a single characteristic or several characteristics of a path. Some routing protocols can base route selection on multiple metrics, combining them into a single metric.
The following lists some dynamic protocols and the metrics they use:
Routing Information Protocol (RIP) - Hop count
Open Shortest Path First (OSPF) - Cisco’s 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
This is called equal cost load balancing.
Load balancing can increase the effectiveness and performance of the network
Equal cost load balancing can be configured to use both dynamic routing protocols and static routes.
Only EIGRP
supports unequal cost load balancing.
Administrative Distance
It is possible for a router to be configured with multiple routing protocols and static routes.
Administrative distance (
AD
) determines the route to install into the IP routing table. The AD represents the "trustworthiness" of the route;
Default AD
Router Operation
Analyze the Routing Table
The Routing Table
A routing table is a data file in RAM that is used to store route information about directly connected and remote networks.
routing table contains network or next hop associations.
The next hop association can also be the outgoing or exit interface to the next destination.
The routing table of a router stores information about:
Directly connected routes
- These routes come from the active router interfaces. Routers add a directly connected route when an interface is configured with an IP address and is activated.
Remote routes
- These are remote networks connected to other routers. Routes to these networks can either be statically configured or dynamically learned through dynamic routing protocols.
Routing Table Sources
Entries in the routing table can be added as:
Local Route interfaces - Added when an interface is configured and active. This entry is only displayed in IOS 15 or newer for IPv4 routes and all IOS releases for IPv6 routes. Letter:
L
Directly connected interfaces - Added to the routing table when an interface is configured and active. Letter:
C
Static routes - Added when a route is manually configured and the exit interface is active. Letter:
S
Dynamic routing protocol - Added when routing protocols that dynamically learn about the network, such as EIGRP ( Letter:
D
) or OSPF ( Letter:
O
), are implemented and networks are identified.
Remote Network Routing Entries
The entry identifies the following information:
Route source - Identifies how the route was learned.
Destination network - Identifies the address of the remote network.
Administrative distance - Identifies the trustworthiness of the route source. Lower values indicate preferred route source.
Metric - Identifies the value assigned to reach the remote network. Lower values indicate preferred routes.
Next-hop - Identifies the IPv4 address of the next router to forward the packet to.
Route timestamp - Identifies how much time has passed since the route was learned.
Outgoing interface - Identifies the exit interface to use to forward a packet toward the final destination.
Directly Connected Routes
Directly Connected Interfaces
Before the interface state is considered up/up and added to the IPv4 routing table, the interface must:
Be assigned a valid IPv4 or IPv6 address
Be activated with the no shutdown command
Receive a carrier signal from another device (router, switch, host, etc.)
When the interface is up, the network of that interface is added to the routing table as a directly connected network.
Directly Connected Routing Table Entries
An active, properly configured, directly connected interface actually creates two routing table entries.
The entries contain the following information:
Route source - Identifies how the route was learned. Directly connected interfaces have two route source codes. ‘C’ identifies a directly connected network. ’L’ identifies the IPv4 address assigned to the router’s interface.
Destination network - The address of the remote network.
Outgoing interface - Identifies the exit interface to use when forwarding packets to the destination network.
Directly Connected IPv6 Example
there is also a route installed to the FF00::/8 network. This route is required for multicast routing.
Statically Learned Routes
Static Routes
Static routes are manually configured. They define an explicit path between two networking devices.
Static routes are not automatically updated and must be manually reconfigured if the network topology changes.
The
benefits
of using static routes include improved security and resource efficiency. Static routes use less bandwidth than dynamic routing protocols, and no CPU cycles are used to calculate and communicate routes.
The main
disadvantage
to using static routes is the lack of automatic reconfiguration if the network topology changes.
There are two common types of static routes in the routing table:
Static route to a specific network
A static route can be configured to reach a specific remote network. IPv4 static routes are configured using the following command:
Router(config)# ip route network mask { next-hop-ip | exit-intf }
A static route is identified in the routing table with the code ‘S’.
Default static route
A default static route is similar to a default gateway on a host
The default static route specifies the exit point to use when the routing table does not contain a path for the destination network
1 more item...
The ‘S’ signifies that the route source is a static route while the asterisk (*) identifies this route as a possible candidate to be the default route
Static IPv6 Route Examples
To configure a default static IPv6 route, use the
ipv6 route ::/0 {ipv6-address | interface-type interface-number}
global configuration command.
Unlike the IPv4 static route, there is no asterisk (*) or Gateway of Last Resort explicitly identified.
1.3.4 Dynamic Routing Protocols
Dynamic Routing
Dynamic routing protocols are used by routers to share information about the reachability and status of remote networks.
Dynamic routing protocols perform several activities, including network discovery and maintaining routing tables.
Network discovery is the ability of a routing protocol to share information about the networks that it knows about with other routers that are also using the same routing protocol.
During network discovery, routers exchange routes and update their routing tables. Routers have converged after they have finished exchanging and updating their routing tables. Routers then maintain the networks in their routing tables.
IPv4 Routing Protocols
To determine which routing protocols are supported by the IOS, use the
router ?
command in global configuration mode as shown in the figure.
Cisco routers can support a variety of dynamic IPv4 routing protocols including:
OSPF - Open Shortest Path First
IS-IS - Intermediate System-to-Intermediate System
RIP - Routing Information Protocol
EIGRP - Enhanced Interior Gateway Routing Protocol
The entry beginning with ‘D*EX’ identifies that the source of this entry was EIGRP (‘D’). The route is a candidate to be a default route (‘
’), and the route is an external route (‘
EX’) forwarded by EIGRP.
IPv6 Routing Protocols
To determine which IPv6 routing protocols are supported by the IOS, use the
ipv6 router ?
command in global configuration mode.
ISR devices support dynamic IPv6 routing protocols including:
RIPng (RIP next generation)
OSPFv3
EIGRP for IPv6