Routers preferably select routes with lower administrative distance when multiple paths are available to the destination. When a router has two or more paths to a destination with equal cost metrics, the router forwards the packets using all paths equally, called equal-cost load balancing.
So, to balance the load, multiple routes are needed through a single routing protocol. The protocol should have an equal administrative distance to a destination when forwarding packets.
The router calculates multiple routes to a destination with metrics, and the shortest path is installed in the routing table. If the destination has more than one path with the same administrative distance and a metric value, all least-metric and same routes are installed in the routing table.
We can configure EIGRP to install multiple paths even if the metric is unequal. This is the only protocol that supports unequal cost load balancing. The Cisco router uses two types for balancing the network load: per-destination basis and per-packet basis. Balancing the load also depends on the switching mechanism configured on the router interface.
Per-destination load balancing
In this type, the router distributes the packets based on the destination address, distributes all packets for a specific destination over the first path, and uses the second path for the second destination on that same network. For most Cisco routers, per-destination load balancing is the default technique.
Per-Packet load balancing
In this type, the router sends one packet for the same destination over the first path, and the second packet for the same destination over the second path, and so on. Per-Packet guarantees equal load across all links.
The forwarding process determines the outgoing interface for each packet from the routing table and selects the least used interface. This also ensures equal use of all links. The video below demonstrates the process of per-packet type.
The path choice for the packet is the basic function of the router. The router ever selects the best path for packet sending. For selecting the best path router searches its routing table information for a network address that matches the packet destination IP address. The router selects the best route with the following three results.
Directly connected network
The directly connected routes are always the best path to any subnet. If the destination IP address of the packet belongs to directly connected device that is on the same network to one of the interfaces of the router and connected to this interface, and the packet directly forwarded to the destination device. The directly connected network is the host address on the same network as the interface of the router.
The administrative distance of the directly connected network is 0. When an IP address is configured to an interface of the router, the router will automatically create a directly connected route in its routing table.
The figure below illustrates the directly connected routes and remote routes. If we see the Router1, where host1 and Fa0/0 of Router2 are a directly connected network for Router1 and remaining all network is the remote network for Router1.
Remote network
If the packet’s destination IP address is not on the same network with an interface of the router; so, this is a remote network. If the destination address is on the remote network then the router forward packet to another router connected to the current router.
The packet for remote networks reached to the destination through the router to router. For complete process consult my earlier article Packet sending over a routed network.
No route determined
If the destination IP address of the IP packet not belongs to the directly connected or remote network; then the router determines for the Gateway of Last Resort. A Gateway of Last Resort is a route using the router when no other known route exists to send the IP packet. The Known routes are present in the routing table.
Therefore, any route not known by the routing table forwarded to the default route. If there is a default route, the router forwards the IP packet to the default route (Gateway of Last Resort). If the router does not have a default route, then the router discards the packet. The default route is 0.0.0.0.
Best Path
The router determines the best path for sending a packet by assessment of multiple paths to the same destination network and selecting the best and shortest path. In the case of multiple paths to the same destination network, each path uses a different exit interface on the router.
The router selects the best path using a protocol based value or metric to calculate the distance to the destination network. The lowest metric value is the Best Path to the destination network. Dynamic routing protocols use their own rules and metrics to build and update routing tables.
The algorithm of the protocol generates a metric, for each path through the network. Metrics can be based on a single characteristic or several characteristics of a path.
Some routing protocols select a route on multiple metrics, combining them into a single metric. Some examples of routing protocol are Routing Information Protocol (RIP), Open Shortest Path First (OSPF) and Enhanced Interior Gateway Routing Protocol (EIGRP).
The RIP is using hop count and OSPF is using Cisco’s cast based metric on available bandwidth. The Enhanced Interior Gateway Routing Protocol (EIGRP) is an example of multiple metrics type which uses bandwidth, delay, load, and reliability. The video demonstrates the difference between hop count and bandwidth metric.
For packet sending over the routed network, the IP address of the destination network is required. If the destination address belongs to the same network, and then the source does not use the default gateway. The host applies AND operation for determining the network address. I have already discussed the AND operation in my earlier article ANDing and Determining Network Address.
If the destination belongs to the same network, then the source device uses its ARP cache for the MAC address of the destination. If the MAC address is not listed in the ARP cache then the source generates an ARP request to acquire the MAC address to complete the packet sending to the destination.
When a packet is completed, the router send it to the destination. If the destination network address belongs to a different network, then the source consults its ARP cache for the gateway MAC address, if the MAC address is listed in the ARP cache the source forwards the packet to its default gateway.
If the address is not listed in the ARP cache; then the source first generates an ARP request to get the MAC address of the gateway and then send the packet to the gateway for further processing. See the video for the complete operation of a packet sending.
In the video, you can see the Laptop 0 packet sending to the webserver. The Laptop 0 first determines that the destination IPv4 address is not on the same network. So, Laptop 0 checks for default gateway IP address and MAC address.
The MAC address is not listed in the ARP cache of Laptop 0; So Laptop 0 generate an ARP request for acquiring the MAC address of the default gateway. When Laptop 0 received the MAC address then Laptop 0 encapsulates the layer3 Packet into layer2 frames and sends it to Layer1. Layer 1 sends a Layer 2 frame in the shape of an Ethernet frame (0 and 1).
The IPv6 also uses a similar procedure for IPv6 packets. But in place of the ARP process, IPv6 address resolution uses ICMPv6 Neighbor Solicitation and Neighbor Advertisement messages. IPv6-to-MAC address mapping is kept in a table similar to the ARP cache, called the neighbour cache.
Packet Forwarding and Routing
When Router1 receives the Ethernet frames from Laptop 0. Router1 examines the destination MAC address, which matches the MAC address of the Router receiving interface Gig0/1.
So, Router1 copies the frame into its buffer. The router identifies the frame type field as 0x800, which indicates that the frame has an IPv4 packet in the data part. The router de-encapsulates the Ethernet frame to check the destination IPv4 address.
When examining that the destination address does not match any of the directly connected interfaces of the Router1. Router1 then searches the routing table for matching the destination address network. When the address is matched to any of the network addresses in the routing table, the router selects an outgoing interface for the packet.
When the router selects an outgoing interface, For example, in the video; the destination address is matching to route 192.168.10.0/24. The exit interface for 192.168.10.0/24 is Gig0/0, so, the router encapsulates the packet in Ethernet layer 2 frames.
The frame included source MAC address and destination MAC address. The router1 exit interface Gig0/0 is a source and router-2 interface Fa0/0 is the destination for layer-2 frames this time.
When Router2 receives the Ethernet frame from Router1. It examines the MAC address and de-encapsulates the layer 2 frames to check the layer3 information. Then search the proper route in the routing table for address 192.168.10.2. This time the exit interface is serial port s0/3/0.
The router encapsulates the layer2 frame this time for a serial port which protocol is PPP. The PPP frames do not use MAC addresses. Each router is doing the same procedure with the packet sending until the original destination mentioned in layer 3 information, received the packet.
Reach the Destination
When the packet arrives at router4 directly connected network 192.168.10.0/24. The Router4 copies the data link Ethernet frame into its buffer and de-encapsulates the data link Ethernet frame.
The Router3 searches the routing table for the destination IPv4 address of the packet. The routing table has a route to a directly connected network on Router4. So, Router4 sent the packet directly to the destination.
The exit interface is directly connected to the Ethernet network; So, the router must resolve the destination IPv4 address of the packet with a destination MAC address. The Router4 searches for the destination IPv4 address of the packet in its ARP cache.
If the entry is not in the ARP cache; Router4 sends an ARP request out of its Fast Ethernet 0/0 interface. The Web Server sends back an ARP reply with its MAC address. Router4 then updates its ARP cache with an entry for 192.168.10.2 and the MAC address that is returned in the ARP reply.
The IPv4 packet is encapsulated into a new Ethernet data link frame and sent out to the Fast Ethernet 0/0 interface. When the Web Server receives the frame, it examines the destination MAC address in the frame; which matches the MAC address of the receiving interface; its Ethernet network interface card (NIC).
Then the Web Server copies the rest of the frame into its buffer and identifies the Ethernet Type field as 0x800; which means that the Ethernet frame has an IPv4 packet in the data portion. It de-encapsulates the Ethernet frame and passes the IPv4 packet to the IPv4 process of its operating system and send a reply according to the packet.
The router is a device that receives a packet from the source on any interface and forwards it to its destination on another interface. This is done by the router switching function, which encapsulates packets in the data link frame type for the outgoing data link.
The router routing function selects the best path for the packet destination, and the router switching function encapsulates the packet into the data link frame of the outgoing interface. The router switching function performs the following: receiving a packet from one network and destined for another.
1. The router receives the Layer 2 encapsulated frame and then de-encapsulates the Layer 2 frame header and trailer.
2. After De-encapsulation, the router reads Layer 3 information and the destination IP address of the IP packet to select the best path in the routing table.
3. When selecting a path for the packet destination, the router encapsulates the Layer 3 packet into a new Layer 2 frame and forwards the frame out of the exit interface.
Figures 1 to Figure 6 illustrate the packet switching over the routed network. As shown in Figure 1, the laptop generates an ICMP message for the server in the topology. The packet contains layer 3 information on the source and destination layer 3 addresses. The source layer 3 address is the address of the laptop, and the destination layer 3 address is the server’s IP address. As a packet travels from the source to the destination, the Layer 3 IP addresses do not change because the Layer 3 PDU does not change.
However, the Layer 2 data link addresses change at every hop as each router de-encapsulates and re-encapsulates the packet in a new Layer 2 frame. In Figure 1, the Layer 3 packet is encapsulated for the wireless access point and forwarded to Layer 2 (the laptop’s wireless card) and then to Layer 1 for transmitting on port 1. The wireless port is virtual, not a physical port.
Encapsulation into a different type of Layer 2 frame than the one commonly used for receiving packets is common. For example, a home router receives a frame from the wireless port and then sends it to router 3 over an Ethernet interface. So, the encapsulation for wireless and Ethernet is different. Also, encapsulation for Fast Ethernet, Giga Ethernet, and serial interfaces is different.
Figure 2 illustrates that the home router receives layer 2 packets in the shape of bits from layer 1 and then de-encapsulates the packet to read layer 3 information. When reading the source and destination, the router selects the proper outgoing interface, again encapsulates the packet, and sends it to Layer 2 and then to Layer 1.
Notice the source and destination MAC addresses and IP addresses, first on the home router and then on all the routers. The source and destination MAC addresses change at each router, but the IP address does not.
Also, notice in Figure 3 and Figure 4 that the ports between Router3 and Router2 have no MAC addresses in the frame. This is a serial link, and MAC addresses are only required on multi-access networks, such as Ethernet. A serial link is a point-to-point connection and uses a different Layer 2 frame that does not require the MAC address.
For example, when Ethernet frames destined for Server0 are received on Router3 from the Fa0/0 interface, they are de-encapsulated and then re-encapsulated for the serial interface. When Router2 receives the frame, it is de-encapsulated again and then re-encapsulated into an Ethernet frame with a destination MAC address.
The table below better summarizes the process of sending a packet from Laptop 1 to server 0. You can see the packet source IP, MAC address, Destination IP, and MAC address.
Notice that the source and destination IP addresses do not change until the packet reaches the final destination. However, the source and destination MAC addresses change for each hop. At stage 11th, when the server responds to Laptop 1, the source and destination addresses change accordingly because now server 0 sends a reply message to Laptop 1. So, this time, the source is server 0.
FAQs:
Q1: What is the primary function of a router’s switching capability?
A1: The primary function of a router’s switching capability is to forward packets between different networks or network segments.
Q2: What is Layer 2 switching?
A2: Layer 2 switching, or data link layer switching, is forwarding packets based on MAC (Media Access Control) addresses.
Q3: What is Layer 3 switching?
A3: Layer 3 switching, or network layer switching, is forwarding packets based on IP addresses.
Q4: How does a router’s switching function improve network performance?
A4: A router’s switching function improves network performance by increasing packet-forwarding speed, reducing latency, and optimizing network traffic.
Q5: What is the difference between a router and a switch?
A5: A router connects multiple networks and routes traffic between them, while a switch connects multiple devices within a network and forwards packets based on MAC addresses.
Q6: What are some benefits of Layer 3 switching in a router?
A6: Benefits of using Layer 3 switching in a router include improved network segmentation, increased security, and better traffic management.
Q7: Can a router perform both Layer 2 and Layer 3 switching?
A7: Yes, most modern routers can switch between Layer 2 and 3 depending on the network configuration and requirements.
Q8: How does a router determine where to forward packets?
A8: A router determines where to forward packets based on its routing table, which contains information about network addresses, subnet masks, and gateway addresses.
Q9: What is the role of ARP (Address Resolution Protocol) in router switching?
A9: ARP resolves IP addresses to MAC addresses, allowing the router to forward packets to the correct device on a network.
Q10: Are all routers capable of Layer 3 switching?
A10: No, not all routers are capable of Layer 3 switching. Some basic or older routers may only support Layer 2 switching.
Q11: What is a Protocol Data Unit (PDU)?
A11: A PDU is a data packet formatted for transmission across a network. It contains IP addresses, Ethernet headers, and other protocol-specific details necessary for data routing and processing.
There are numerous show commands using Cisco IOs to verify interface settings, operation, and configuration. The following three commands are very useful to identify an interface status especially when we are using the IPv4 address:
Verify Interface settings for IPv4 Addresses
show ip interface brief – The show ip interface brief is one of the most frequently used commands in the Cisco devices. This command provides abbreviated output than the show ip interface. It provides an outline of the key information for all the network interfaces on a router.
The figure below illustrates the output of this command. The output displays all interfaces on the router; the IP address assigned interfaces if any. It is also showing the operational status of the interface. The command also verifies the status of the switch interfaces. The figure below displays the output of show ip interface brief command.
show ip route – The show ip route command displays the routing table of the router. The routing table is the list of all networks where the router can communicate; their metrics and how to communicate with them. We can also use abbreviated command instead of full command. The abbreviated command is sh ip ro.
The command also has parameters after route (ro) likesh ip ro rip for all RIP routes. The figure below displays the output of show ip route. figure 2 displays the output of the show ip route command. There are three directly connected network entries and one EIGRP router entry. We will also discuss the parameters of the routing later in the coming article.
show running-config interface interface-id– The show interface command with interface-id displays the specific interface with configuration and statistics. This command interface and interface-id give a lot of information in the output.
show interfaces – We can also use this command to show interface information and packet flow count for all interfaces on the device. It displays all type of interfaces with configuration and statistics. This command provides a lot of information in the output. The abbreviation of this command sh int. The figure below illustrates the output of the show interface command.
show ip interface – We can also use this command to show the IPv4 related information for all interfaces on a router.
Verify interface settings for IPv6 Addresses
We can also verify interface settings and configuration for IPv6 addresses using similar commands with little changes in IPv4 verification commands.
The show ipv6 interface brief command in Figure 3 giving a result for the interfaces. The up/up indicates the Layer 1/Layer 2 interface state. This is equal as the Status and Protocol columns in the equivalent IPv4 command already showing in figure1.
The figure illustrates two configured IPv6 addresses for each interface. The IPv6 global unicast address is manually configured and the second address, which begins with FE80, is the link-local unicast address for the interface.
When someone configures a global unicast address on an interface, the link-local address is automatically added to this interface. The global unicast address is not necessary for the network but a link-local address is necessary for each network interface.
The show ipv6 interface FastEthernet 0/0 command displays the interface status and all of the IPv6 addresses to the interface. It also shows a link-local address and global unicast address including multicast addresses assigned to the interface, beginning with prefix FF02.
The show ipv6 route command display and verify IPv6 networks and specific IPv6 interface addresses in the IPv6 routing table. The show ipv6 route will only display IPv6 routes. The ping command is the same for both IPv4 and IPv6 interfaces. The ping command verifies Layer 3 connectivity.
The IPv4 loopback interface is logically configured internally in the router. In this lesson, we should discuss this interface configuration, but at this stage, it is necessary to know the Pv4 interface configuration before the IPv4 loopback interface configuration.
So, let’s come to the topic. As I said, the loopback interface is logical and cannot be physically found on the router. Therefore, it cannot connect to any other device physically. Its state is always up when a router is functioning.
It is instrumental in troubleshooting and managing a Cisco router because it ensures that at least one interface is always available for management. For example, we can use a loopback for testing purposes and the loopback interface instead of a physical interface address for routing purposes.
Usage of Loopback Interface
We can use the loopback to recognize the device because the address of the loopback never changes; therefore, it is the preferred method for identification of the router.
The Loopback Interface is always up and allows Border Gateway Protocol (BGP) neighbours between two routers to stay up even if one of the outbound physical interfaces connected between the routers is down. Loopback interfaces are also the termination points for Remote Source-Route Bridging and Data-Link Switching Plus.
The OSPF also uses the loopback address to determine protocol-specific properties for the device or network. Additionally, ping and mpls need a loopback address to function correctly. We can also apply stateless firewall filters to the loopback address to filter packets originating from or destined for the Routing Engine.
The configuration of the Loopback interface
We can enable multiple loopbacks on the Cisco router. Each loopback requires a unique IPv4 address. The number is different for routers, but it starts at 0 and goes up to billions.
Network Switches require IP addresses to enable remote management and configuration. If the IP address is not configured the IP address, the network administrator can’t easily connect to the device for remote management.
Remote management software and protocols, such as Telnet, TeraTerm, SSH, HTTP, or HTTPS, also require an IP address for connectivity.
A network switch does not have a dedicated interface to which the IP address can be assigned. Therefore, the IP address is assigned and configured on a virtual interface called a switched virtual interface called SVI.
We can also assign network switches a default gateway. The default gateway should be the IP address of the router interface. For example, the default gateway for switch0 is 192.168.0.1, and for swithc1, it is 192.168.1.1.
Generally, the first usable IP address or the last usable IP address is reserved as the default gateway address. In this diagram, the first IP address of both subnets is already used as a router interface address, so I am going to configure the last usable IP address of both subnets (192.168.0.254 and 192.168.1.254) as the default gateway on both switches.
Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface Vlan1 Switch(config-if)#ip address 192.168.0.254 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#exit Switch(config)#ip default-gateway 192.168.0.1 Switch(config)#
Do this for switch1 also and assign IP address 192.168.1.254.
Console Access is an essential topic for networking students, so I will explain console access to Cisco devices in this lesson. All Cisco routers and switches have a console port, the management interface. It connects a computer directly to a router or switch and manages it. The console port is also used for initial configuration.
Typically, the router console port is an RJ45 port. A Rollover cable is used to connect the Serial/COM port of the computer to the router or switch console port. It has to type RJ-45 to DB9 Console access cable and RJ-45 to RJ-45 Console access cable.
Terminal software is also required to access the router and switches. The Tera Term, Putty, and Hyper Terminal are usually used to access the router and switches on a console port. Most People use Putty software for console access. The figure below shows the terminal window of putty.
The cable connects the host’s serial port to the device’s console port. Most computers and notebooks now lack built-in serial ports.
The USB port can establish a console access connection if the host uses a computer without a serial port. For this purpose, a USB-to-RS-232 compatible serial port adapter is required when using the USB port.
The Cisco Integrated Service Router G2 supports a USB connection. It should use a USB Type-A to USB Type-B cable and an operating system device driver.
The driver for this type of cable is available from www.cisco.com. These routers use two console ports; only one can be active simultaneously. When someone connects the USB cable to the USB console port, the RJ-45 console port becomes inactive.
If the USB cable is not plugged into the USB port, the RJ-45 port becomes active. When connecting the USB cable, the Type-A side should be connected to the computer side, and the Type-B side should be connected to the outer side.
Frequently Asked Questions (FAQs)
Q: What is console access, and why is it important?
Console access allows network administrators to connect directly to the network equipment and manage it via a command-line interface (CLI). This is essential for configuring devices, troubleshooting, and ensuring network stability.
Q: How do I connect to a Cisco device’s console port?
To connect to a Cisco device’s console port, you’ll need a console cable (often a rollover cable) and a terminal emulation program such as PuTTY or Tera Term. Connect one end of the console cable to the Cisco device’s console port and the other to your computer’s serial port. Open the terminal emulator and configure it to match the device’s settings.
Q: What are the common terminal settings for Cisco console access?
The typical terminal settings for Cisco devices are:
Baud rate: 9600
Data bits: 8
Parity: None
Stop bits: 1
Flow control: None
Q: What if my computer doesn’t have a serial port?
If your computer lacks a serial port, you can use a USB-to-serial adapter. Install the necessary drivers for the adapter, then connect the console cable to the adapter and follow the same steps as if you were using a native serial port.
Q: How do I troubleshoot a console connection issue?
Ensure that the console cable is properly connected, check that the terminal settings match the device’s, and verify that the correct COM port is selected in your terminal emulator. Additionally, try restarting the terminal emulator and resetting the device.
Q: Can I access a Cisco device remotely?
Yes, remote access can be achieved using protocols like SSH or Telnet, provided the device supports remote connections. Remote access eliminates the need for physical console cables and allows management from any location with network access.
Q: What are the security considerations for console access?
Console access should be secured to prevent unauthorized access. Only authorized personnel should have physical access to console cables and ports. Configure strong passwords and, where possible, use secure protocols like SSH for remote access.
Device status LEDs are one of the easiest ways to mark signs of trouble on a network. The NICs, hubs, routers, and switches have these small indicators that warn users if anything is going wrong. In this article, we will examine some of the common networking device LEDs.
Ethernet Port Status LEDs
The computers connect to a network using a Cat 5/6 cable and Ethernet interface. Most Ethernet interfaces have one or two LED link indicators following them. Generally, a green LED means a good connection and a blinking green LED indicates network activity.
If the link light is not glowing, it means there is a problem with the network cable or the network itself. The switch port also has indicators. If one or both LEDs are not glowing, use a different cable. The following table illustrates most host computers’ LEDs.
Network Device Status LEDs
If you have seen the network devices hub, switch, and routers, you will notice multiple LEDs on the front of each device. These multiple LED indicators provide a quick status view for network operators and administrators.
Each port has one or two dedicated LEDs. For example, a Cisco Catalyst switch has several status LEDs that help network administrators monitor system activity, performance, and timely troubleshooting. When the switch is functioning, the status LEDs are generally glowing green, and they glow amber when there is a malfunction.
The Cisco ISRs also use status LEDs of various types to provide status information. The status LEDs also help the network administrator troubleshoot network malfunctions in a timely manner. All network devices have a unique set of LEDs.
For the descriptions of LEDs, read the device-specific documentation. The following presents the general guideline for network device LEDs, and in some cases it may be different.
We can configure and assign an IP address to a host using the following two methods:
Statically
This method manually assigns an IP address to the host. It is important to assign and configure the correct IP address, subnet mask, and default gateway. We should also configure the DNS server IP address manually using this method.
Statically assigned addresses are usually used to find specific network resources, such as servers and printers. They can also be used in smaller networks. In larger and corporate networks, static IP addresses are rarely liked. For setting a static IP address on a host using Windows, follow the following steps:
Click Start Menu> Control Panel > Network and Sharing Center. (For Windows 8 and higher, search for and open Control Panel and select Network and Internet).
Click Change adapter settings. (as per Figure 1)
Right Click on Interfaces required IP address configuration
Select and Click Properties
In the Connection Properties windows, select and click Internet Protocol Version 4(TCP/IPv4) (as per Figure 2)
Select “use the following IP address” (as per Figure 2)
Fill in the IP address, Subnet Mask, Default Gateway, and DNS addresses. (as per Figure 2)
Dynamically
In this method, we use the Dynamic Host Configuration Protocol (DHCP) to configure the IP address. The DHCP server provides a valid IP address, subnet mask, and default gateway for end devices. Large networks use dedicated DHCP servers to provide services.
DHCP services can be provided by a Cisco Catalyst switch or a Cisco ISR in a smaller branch or office setting. The home routers also provide DHCP services to home users. For setting a dynamic IP address on a host using Windows, follow the following steps:
Click Start Menu> Control Panel > Network and Sharing Center. (For Windows 8 and higher, search for and open Control Panel and select Network And Internet).
Click Change adapter settings.
Right Click on Interfaces required IP address configuration
Select and Click Properties
In the Connection Properties windows select and click Internet Protocol Version 4 (TCP/IPv4)
Click the “Obtain an IP address automatically” (as per Figure 3)