enobosarm

Clock rate and Bandwidth commands

Two commands which are often confused or misunderstood, are the clock rate and bandwidth commands.

In order to understand clock rate we first need to understand how the cabling works on routers. When connecting two routers together with a serial cable, one of the routers needs to host the DCE (Data Communications Equipment) side of the cable, and the other will host the DTE (Date Terminal Equipment) side. Most serial cables are marked on the connector if it’s the DTE or DCE.

So what’s the difference between the 2 sides? The DCE side of the cable is the side that sets the speed of the link (also known as clocking). Based on this, it’s safe to assume that the cable coming out of your router and going to your service provider is the DTE side, since you service provider sets the speed of the line based on the subscription you have purchased. The DTE side of the cable is where the communications terminate ie: your router terminates the connection from the service provider.

From a configuration point of view the DCE side of the cable is able to use the clock rate command to set the speed of the line. If the command is not used the interface will run at the maximum speed supported by the interface. If you have only subscribed for a 64k line, then the clock rate would have been set on the DCE side of the cable using the command ‘clock rate 64000’ under the interface.

AOIP.ORG# conf t

AOIP.ORG(config)# interface serial 1/0

AOIP.ORG(config-if)# clock rate 64000 (represented in BITS per second)

If you try use the clock rate command on the DTE interface you will receive the following error message “This command applies only to DCE interfaces”

To identify which end of the cable has been plugged into a Cisco router, you can also use the command “show controller” – see below diagram.

Cisco Show Controller Command

Cisco Show Controller Command

The bandwidth command however does not adjust the speed of the line at all, however it should be configured on ALL DTE and DCE interfaces because it is used by;

1/ Routing protocols – to calculate the cost of a path

2/ QOS (Quality of Service) – to identify how much bandwidth is availble to prioritize,

If no bandwidth command has been configured on the interface, Routing protocols and QOS will assume the line is running at the maximum speed supported by the interface which can result in incorrect routing and incorrect prioritization of packets.

The bandwidth command is issued under the interface, as is represented in Kilobits per second

AOIP.ORG# conf t

AOIP.ORG(config)# interface serial 1/0

AOIP.ORG(config-if)# bandwidth 64 (represented in kilobits per second)

Related posts:

  1. Interface Status
  2. Configuring EIGRP on a Cisco Router
  3. Cisco Administrative Distance
  4. Configuring an IP address on a Cisco Device
  5. Configuring the Console port on a Cisco Device


29 Responses to “Clock rate and Bandwidth commands”

  1. rasreh Says:

    hi,

    i am confused about the bandwidth. we have to synchronize bandwidth according to the clock rate. let’s say if the clock rate is 64000 then we must configure bandwidth 64kb/s to flow the packets without any lose.

    regards,

    rasreh

  2. Jay Says:

    Hi Rasreh,

    It’s not so much of a case of “synchronizing” the two sides. You need to look at them as two different entities altogether.

    The Clock rate command, will define the speed and set the line to only operate at that speed. This is usually done by your telco, but obviously in a lap environment you would need to set one side of your cable as the DCE and hence set the clock rate of that line.

    The bandwidth command however doesn’t set the speed AT ALL.

    The bandwidth command is what things like your routing protocols use to identify the least cost routing.
    So for example, if you have a 128k interface (physical support, not clock rate or bandwidth), your routing protocol will use the 128K for its formula to calculate the cheapest route to the destination. However, what if the line is ACTUALLY only running at 64k because that is all you have paid for from your telco? Your telco would have set the clock rate value on their side (DCE) to 64000 (64k) however your routing protocols still believe that the line is running at full speed (128k). This would then cause incorrect routing as the cost of the line has been calculated incorrectly as well.

    To remedy this, we put the bandwidth command on our side of the interface to inform things like routing protocols what the REALY speed of the line is so its calculations are correct.

    NOTE: It’s not only routing protocols that use this, QOS is one of the most important things to watch out for as its entire structure is around the bandwidth command.

    The main thing to understand about the difference between the two is this.

    Clock rate is WILL set the speed. Whatever is defined with the clock rate command will force the line to run at the given speed.

    Bandwidth is an indication to products like routing protocols and QOS as to what they line is “supposed” to be running at.

    This of course means that you could “lie” about the speed of the line with the bandwidth command. But would it really change the speed? – No, but it would influence how things like routing protocols make decisions about their path selection.

    I hope this helps.

    Best Regards,
    Jay

  3. Kenya Gettens Says:

    I appreciate you sharing this article.Much thanks again. Really Cool.

  4. Aslam Jahufer Says:

    ok thanks really helpful…..

    let say if you set up the bandwidth to 2000Kbps & set the clock rate also 2Mbps what could be the out put of the router. and the next issue is my IOS version is 12.4, when i entered the clock rate in the DTE interface it takes the value, what could be the problem
    Aslam

  5. Mitesh Says:

    hi,
    this was helpful….
    but does that mean if service provider sets the clock rate to 128k , we can set the bandwidth as 64 according to our requirement..

  6. Jay Says:

    @Aslam

    Remember it’s only the clock rate that will determine the speed of the line, not the bandwidth command. So if the clock rate has been set to 2Mbps, that is the speed the line will run at regardless of the bandwidth command.

    With regards to your problem on the DTE interface. It’s not possible to set the clock rate on the DTE side of the cable if everything is cabled correctly and you are using a real device (not a simulator or emulator like Boson or Dynamips). So assuming you are using a realy Cisco device, and your cable is plugged in correctly, this should not be possible.
    I have seen this happen on a few occurances, and all were resolved when the cables were tested and re connected.

    I hope this helps
    Jay

  7. Jay Says:

    @Mitesh,

    Yes you could do that. The first question of course would be… why?
    If the clock rate has been set at 128kb, it would be normal to configure your bandwidth statement to match. There are a few cases were this does not apply, and certainly you may have one of these cases. Just remember, try not to “lie” to the interface about what it’s speed is or when you try configure something like QOS on the line you are going to run into problems.

    Hope this helps
    Jay

  8. Mitesh Says:

    Thank You ..!

  9. yep Says:

    Very clear thanks a lot

  10. Raj Says:

    This does not answer my issue:
    How do you find that how much is bandwidth for that interface? I tried “show controller” but don’t see any output saying that BANDWIDTH = 1000000 or something like that.

  11. Jay Says:

    @Raj,

    You won’t see the bandwidth with “show controller”, you will see the clock rate though. Look at the above screen shot, you will see it says “received clockrate …….”.

    Bandwidth has no control over the actual speed of the line. If you want to see what bandwidth has being configured on the interface, you can get this from a “show run” or even a “show interface”.

    Remember, clock rate is the ACTUAL speed, bandwidth is a value that you allocate to the link to help with routing decisions and QOS.

  12. Gaurav Says:

    HI all

    I am using Bosonv6 ….when i am giving clock rate command to router then it showing
    ( % ambiguous command “clock rate 64000″ ).
    can any one tell me…that how can i resolve this problem

  13. Fernando Says:

    Hi Jay,

    First thanks for your article.

    Second, I am afraid I can not get the clock rate from the show controller command. Here is my output:

    Interface Serial0/0/0
    Hardware is GT96K
    DTE V.11 (X.21)idb at 0x42CEDEFC, driver data structure at 0x42CF5CE0
    wic_info 0x42CF6264
    Physical Port 1, SCC Num 1
    MPSC Registers:
    MMCR_L=0x000300C0, MMCR_H=0×00000000, MPCR=0×00000100
    CHR1=0x00FE007E, CHR2=0×00000000, CHR3=0×00000648, CHR4=0×00000000
    CHR5=0×00000000, CHR6=0×00000000, CHR7=0×00000000, CHR8=0×00000000
    CHR9=0×00000000, CHR10=0×00003008
    SDMA Registers:
    SDC=0×00002201, SDCM=0×00000080
    CRDP=0x0FA40840, CTDP=0x0FA427A0, FTDB=0x0FA427A0
    Main Routing Register=0×77777707 BRG Conf Register=0×00490018
    Rx Clk Routing Register=0×00000080 Tx Clk Routing Register=0×00000090
    GPP Registers:
    Conf=0×50055600, Io=0×50055600, Data=0xFFFFFBFF, Level=0×00001800
    TDM FPGA Registers:
    vmcr[0] = 0×00010040, vmcr[1] = 0×00000000,
    vmcr[2] = 0×00000000, vmcr[3] = 0×00000000
    ntrcr0 = 0×00000000, ntrcr1 = 0×00000000
    tdmcr = 0x0000006A, labcr = 0×00000000, tpllr_cr = 0×00000000
    nhr = 0×66666660, isr = 0×00000101, imr = 0×00000000
    548594 input aborts on receiving flag sequence
    0 throttles, 0 enables
    160506 overruns
    0 transmitter underruns
    0 transmitter CTS losts
    27681337 rxintr, 20399892 txintr, 0 rxerr, 0 txerr
    46592550 mpsc_rx, 183 mpsc_rxerr, 7174 mpsc_rlsc, 357504 mpsc_rhnt, 46258388 mpsc_rfsc
    1482 mpsc_rcsc, 0 mpsc_rovr, 183 mpsc_rcdl, 0 mpsc_rckg, 0 mpsc_bper
    2 mpsc_txerr, 2 mpsc_teidl, 0 mpsc_tudr, 2 mpsc_tctsl, 0 mpsc_tckg
    0 sdma_rx_sf, 976 sdma_rx_mfl, 160506 sdma_rx_or, 548594 sdma_rx_abr, 406125 sdma_rx_no
    0 sdma_rx_de, 183 sdma_rx_cdl, 837621 sdma_rx_ce, 0 sdma_tx_rl, 0 sdma_tx_ur
    0 sdma_rx_reserr, 0 sdma_tx_reserr
    0 rx_bogus_pkts, rx_bogus_flag FALSE
    0 sdma_tx_ur_processed

    It is supposed that the line is 512 kbits/second but I can not confirm it with the output.

    Kind regards,

    Fernando.

  14. Jay Says:

    Hi Fernando,

    Is this a 1600 series router? If not, please tell me which Router modem as well as the IOS that is running on the machine.

    Regards,
    Jay

  15. Jay Says:

    Hi Gaurav,

    Boson is a simulator, so sadly it does not have every command programmed to do something. Assuming you are typing the “clock rate 64000″ under the interface, then Boson doesn’t’ support the clock rate command.

    Although Boson used to be the number 1 program for learning Cisco commands, it’s been overtaken a few years ago by Dynamips. Otherwise known as Dynagen or GNS3. It is an emulator not a simulator so it accepts ANY commands you throw at it as long as the IOS you have loaded supports the command. Best of all, it’s free… you just need to get your hands on a IOS.

    Hope this helps.

  16. Onesphor Says:

    Very helpful!!!!!!!!!!!!!!!!!!!!

  17. Joe Mendola Says:

    what is the IOS command that allows to read the current clock rate value?

  18. Jay Says:

    @Joe – “show controller” is the command you can use. This is the same command I’ve used in the screen shot above.

  19. Joe Mendola Says:

    @Jay
    show controllers int fa0/1 for instance, helps you to see if you have the dce or the dte cable attached to that interface….then you can likely issue the clock rate command if you discover on that interface it is keeping the DCE cable !
    the command does not show the current value of the speed.
    I found only this thing: afterwards you issued the command clock rate on an interface, you can read the value you inserted, just with the show run command: under the specific interface, you can read the value of the clock rate.

    I have not found anything that can let me discover the current clock rate value, before i usethe clock rate on an interface

  20. Joe Mendola Says:

    of course there is an error in what i wrote before: i meant “show controllers int se0/1 for instance ”

    it has to be a SERIAL int; im sorry for the mistake

  21. Jay Says:

    @Joe – What router are you using? As a guess is it a 1600 / 1700 series router?

    I’ve run some tests on 4 different router models in the last few minutes and I’ve noticed the problem you are referring to on the lower end models, 1600/1700 series models.

    On a 1721 I get the following output

    DTE V.11 (X.21) TX and RX clocks detected

    but as you have said, I cannot see the exact clockrate that I’m receiving…

    On a 3845 I see the following

    cable type : V.11 (X.21) DTE cable, received clockrate 64000

    When displaying a show run, there is no clockrate command under that interface. This is the same result I’m getting for the other 16 serial interfaces on this router. This 3800 series router is not running any advanced images

    Cisco IOS Software, 3800 Software (C3845-IPBASE-M), Version 12.3(11)T7, RELEASE SOFTWARE (fc3)

    It would seem as though the lower end models don’t have a quick way to identify the received clockrate from your provider. If I do manage to find a command that will give you this info, I’ll be sure to post it here ;)

  22. Joe Mendola Says:

    @Jay first of all thanks for your reply and research.
    Im using packet tracer and GNS3. I didnt try the 3845 IOS. At least now i know it is tied up with the platform of the device im using with.
    Your comment has been very useful for me
    later

  23. jay Says:

    This is a wonderful forum. I have a question linking bandwidth and QoS:

    if a customer has a CIR of 15Mb but want to be able to burst up to 100Mb when necessary, is the config below of ok:

    )#policy-map SHAPE
    )#class class-default
    )#shape average 15000000 128000 100000000

    )# int fa0/0
    )# speed 100
    )# duplex full
    )# bandwidth 100000
    )# service-policy out SHAPE

    Thank you in anticipation of your response.

  24. Jimmie Gyaki Says:

    I was just looking for this tip. I’m fresh student of IOS system.

  25. pooja Says:

    can u plz tell me the differnce between clock rate and bandwith by an example? should clock rate and bandwidth b different on router? if yes then why? and if not then why?

  26. sandeep Says:

    @Jay:

    Nice post dude…..I read the entire article and its very useful. Thanks!!!!

    Im posting what I understud. Just let me know if I misunderstud sumthing as I am new to networking.

    1. Clockrate works only on Serial links and not on ethernet/gig s
    2. Bandwidth ommand can play important role for Protocals and QOS
    3. DTE belongs to Service provider and DTE to user. In case u buy a link from the service provider.

  27. Sandeep Says:

    Do I need to use a DTE/DCE marked cable for a point o point LAN conncetivity??

    Can I set clockrate and bandwidth on the LAN cable used to connect my 2 internal routers?

    Awaiting ur replies friends!!!!

    Thanks

  28. Jay Says:

    Clockrate is only required on serial cables. Ethernet, FE, GbE all run at full speeds

  29. Jay Says:

    Hi Sandeep,

    All right apart from your typo in 3/
    DCE is service provider
    DTE is customer side

Leave a Reply