Tech

Guides
 

Limit bandwidth on a Cisco Catalyst switch port

By David Davis, Special to ZDNet Asia
Thursday, January 10, 2008 08:10 AM

A TechRepublic reader recently e-mailed me to ask about limiting the bandwidth on a Cisco Catalyst switch port.

In fact, there are a number of uses for this configuration. Let's take a closer look.

Why should you limit bandwidth?
There are a number of reasons for limiting bandwidth on a Cisco switch Ethernet port. (Of course, the port speed of the switch port always poses an ultimate limitation.)

For example, let's say you work for an Internet service provider in a colocation facility, and you sell access to the Internet in 1-Mb increments. The switch port in question is 100-Mb full duplex. In this case, you would limit the end device connected to that switch port to whatever 1-Mb increment the customer has paid for.

This is just one example of how this configuration could be useful, but there are many other possibilities. Let's look at the commands used to create this bandwidth limit on a Cisco switch.

How do I configure a bandwidth limit?
In the Cisco IOS on a Catalyst switch (not  on a router), there's an Interface Mode command called shape round-robin queue bandwidth . More specifically, the command is srr-queue bandwidth .

This command has been around since IOS 12.2(25). For these examples, I'm using a Cisco Catalyst 2960 switch.

Entering the command appended with a question mark will display the command options. Here's an example:

Switch(config)# interface FastEthernet 0/1
Switch(config-if)# srr-queue bandwidth ?
  limit              Configure bandwidth-limit for 
this interface
  shape             Configure shaping on transmit queues
  share              Configure shared bandwidth

As you can see, the command options are limit , shape , and share . While we'll focus on the limit  option this time, keep in mind that you can also use the srr-queue bandwidth  command to shape and share bandwidth.

For example, let's say you have a 100-Mb Ethernet port on a Catalyst switch. You're selling the bandwidth on the port, and a customer has bought 10 Mb of bandwidth. Obviously, you want to limit the outbound bandwidth on the port to 10 Mb instead of the full 100 Mb.

To do so, go to Interface Configuration Mode on the switch port, and apply the srr-queue bandwidth limit  command. Here's an example:

Switch(config)# 
interface FastEthernet 0/1
Switch(config-if)# 
srr-queue bandwidth limit 90

The 90  sets the outbound bandwidth limit on the port to 90 percent of the port speed. Since this is a 100-Mb port, this should limit the outbound traffic from the port to 10 Mb.

Variations on bandwidth limiting
As with just about everything in the Cisco IOS, there are multiple ways to accomplish the same thing. One way would be to manipulate the port speed. But if you want to hard-code the port speed on the Ethernet port to 10 Mb, you could also limit the customer to only 10 Mb of bandwidth using the speed 10  command. However, you probably won't get the same level of performance from the 10-Mb Ethernet port.

What if you want a port speed that's less than 10 Mb? You could limit the port speed to 10 Mb and then use the srr-queue bandwidth limit 90  command to limit the outbound speed of the port to only 1 Mb.

What if you're working with a Cisco router instead of a switch? Cisco routers don't support the srr-queue  command. While there are several different QoS options that might accomplish the same thing, a common method that I've used is the rate-limit  command.

For example, on a Cisco router when in Interface Mode, you could limit outbound bandwidth to 1 Mb using the following command:

Router(config-if)# 
rate-limit output 10000000 2000 2000 
conform-action continue exceed-action drop

Summary
Whether it's inbound or outbound, being able to control bandwidth on a Cisco switch or router port is a very valuable skill. No matter how difficult or simple the task, knowing the right command is usually the key to getting the task completed when working with the Cisco IOS. For more information on using the srr-queue bandwidth  command, see Cisco's command reference or configuration guide.



WORTHWHILE?

0

0 votes
Blog

Talkback 3 comments

To set a 100mbps port to 10mb, surely the command would be:

srr-queue bandwidth limit 10

and not

srr-queue bandwidth limit 90

as this would limit the bandwidth to 90% of the port speed which is obviously 90mbps.
Posted by Andy Betts on Friday, February 01 2008 05:46 PM

Correct
yes its % dependent. "The 90 sets the outbound bandwidth limit on the port to 90 percent of the port speed. Since this is a 100-Mb port, this should limit the outbound traffic from the port to 10 Mb"
Posted by Dr.LAL on Thursday, September 25 2008 10:52 AM

Limit bandwidth on a Cisco Catalyst switch port
10000000 = 10mb. Why is it that you said " limit outbound bandwidth to 1 Mb using the following command:

Router(config-if)#
rate-limit output 10000000 2000 2000 "
Posted by allen on Wednesday, May 20 2009 01:22 PM


Guest user

Guest user

Level: 
Joined: —
Already a member? Log in »



 

Loading...

Whitepapers/Case Studies

Downloads

Network Administration News



Tech Jobs Now!

Tags

  1. bank
  2. business strategies & functions
  3. china
  4. cio
  5. environment
  6. financial
  7. hardware
  8. india
  9. industry
  10. information technology
  11. infrastructure / architecture management
  12. it outsourcing
  13. job
  14. leadership
  15. outsourcing
  16. revenue
  17. security
  18. software
  19. web
  20. web 2.0