This tutorial explains how to view, configure, and modify the bandwidth of an interface on a Cisco router. Learn the usages and purposes of the interface bandwidth command.
What is the bandwidth?
Bandwidth is the maximum amount of data that an object can transfer within a given amount of time. It is object-specific. Two different objects may have similar or different bandwidths. It depends on many factors such as the object's capacity, environment, configuration, etc.
Some objects allow us to configure their bandwidths. If an object supports bandwidth customization, we can use this feature to match the object's bandwidth to the bandwidth of another object. Two objects with similar bandwidths work more effectively.
Bandwidth is not the speed or guarantee of the transmission. It is the maximum capacity of the transmission that an object can achieve. For example, if the bandwidth of a cable is 100Mbps, it can't transfer more than 100Mb of data in a second.
To know more about the bandwidth, you can check the following tutorial.
Differences between Throughput and Bandwidth Explained
Purposes of the bandwidth command
The bandwidth command allows us to configure the bandwidth of an interface on the router. Interface bandwidth is the maximum amount of data that an interface can load on the attached media within a given amount of time. For example, if an interface can load 100Mb of data on the connected media in one second, then the interface's bandwidth is 100Mbps.
Some protocols use the interface's bandwidth for various functions. For example, TCP and UDP use the interface's bandwidth to decide the size of a segment. EIGRP and OSPF use the interface's bandwidth to calculate routing metrics. Protocols read the interface's bandwidth from the running configuration. The bandwidth command allows us to configure the interface's bandwidth in the running configuration.
Since some protocols use the interface's bandwidth for various functions, Cisco assigns a default bandwidth to each interface. If you will not configure the interface's bandwidth, protocols will use the default bandwidth. If you will configure the interface's bandwidth, protocols will use the configured bandwidth.
The bandwidth command sets the interface's bandwidth in the running configuration. It does not change the actual or the physical bandwidth of the interface. You can use the bandwidth command for the following purposes.
- To match an interface's bandwidth to the bandwidth of the connected media.
- To influence the metric of a route if the routing protocol uses the bandwidth as a metric component.
Let's discuss the above purposes in detail.
Different media types have different bandwidths. When we connect a media to an interface of the router, we use the bandwidth command to set the interface's bandwidth equal to the bandwidth of the media.
Media bandwidth is the amount of data that a media can transfer within a given time. For example, if a cable can transfer 1Gb data in a second, then the cable's bandwidth is 1Gbps.
To utilize the maximum capacity or bandwidth of the cable, you should configure the interface's bandwidth equal to the cable's bandwidth. For example, if the cable's bandwidth is 1544Kbps, you should configure the interface's bandwidth to 1544Kbps.
If you configure the interface's bandwidth less than or more than the cable's bandwidth, the performance of the network will decrease.
Let's take an example. A 100Mbps cable is connected to an interface.
If you configure the interface's bandwidth to 10Mbps, the upper-level protocols will assume that interface is connected to a 10Mbps link. They will encapsulate data packets for a 10Mbps link. Although the cable can carry 100Mb of data per second, the interface will only load 10Mb of data per second over the cable. With this configuration, you will waste 90% of the cable's bandwidth.
If you configure the interface's bandwidth to 200Mbps, the upper-layer protocols will assume that interface is connected to a 200Mbps link. They will encapsulate data packets for a 200Mbps link. Since the size of data packets is more than the maximum capacity of the cable, the cable can not carry them. This configuration will generate many errors.
If you configure the interface's bandwidth to 100Mbps, the upper-layer protocols will encapsulate data packets for a 100Mbps link. This configuration utilizes the full capacity of the cable and interface.
Using the bandwidth command to influence a routing protocol's metric
Some routing protocols such as EIGRP and OSPF use the interface's bandwidth to calculate the metric of each route. We can use the bandwidth command to influence their metric calculation. For example, EIGRP uses the interface's bandwidth in the metric calculation formula. By changing an interface's bandwidth, we can force EIGRP to select the route we want for a particular destination without making any change in the physical layout of the network.
Let's understand it through an example.
In the following network, Router0 has two routes to reach Router2. Both routes have two serial links. Serial links or cables connect to serial interfaces. The default bandwidth of a serial interface is 1544Kbps.
You can download this network topology from the following link.
Packet Tracer Lab for the bandwidth command
If we don't change the default bandwidth of any serial interface on both routes, both routes have equal costs. To verify this, we can use the 'show ip route' command on router Router0.
The following image shows the output of the 'show ip route' command.
As you can see in the output, the cost of both routes is 2684416.
By default, EIGRP adds only one and the best route to each destination network in the routing table. To select the best route, EIGRP compares the cost of each route. It selects the route that has the lowest cost.
If there is a tie between two routes, EIGRP adds both routes to the routing table. This feature is known as the load balancing between equal-cost routes.
Now, change the default bandwidth of a serial link and run the "show ip route" command again. You can also use the "show ip route eigrp" command to view only EIGRP routes.
The following image shows this practice.
The following points explain the above exercise.
Serial 0/0/0 connects Router0 to Router2 via Route1. Serial 0/0/1 connects Router0 to Router2 via Route2. With the default bandwidth on both interfaces, the cost of both routes is 2684416.
Later, we changed the bandwidth of Serial 0/0/0 to 64. As soon we changed the bandwidth of Serial 0/0/0, EIGRP recalculated the cost of both routes. Since we had reduced the bandwidth of a link on Route1, the cost of Route1 increased.
Since EIGRP keeps only the route that has the lowest cost in the routing table, it excludes Route1 from the routing table. However, it keeps Route1 in the Topology table for backup.
To verify this and view the new cost of Route1, you can use the 'show ip eigrp topology' command. The following image shows the output of this command.
This way, an administrator can easily force EIGRP to select a specific route without making any physical change in the physical layout.
To learn how EIGRP calculates the metric of a route or how the EIGRP metric calculation formula works, you can check the following tutorial.
EIGRP metric calculation formula explained
That's all for this tutorial. In this tutorial, we learned the purposes and usages of the bandwidth command on Cisco routers.