4 Replies Latest reply: May 28, 2013 11:56 PM by fracjackmac RSS

    Token Bucket Algorithm


      I have a few questions about Frame-relay traffic shaping and the formula used to solve for values.


      Here is the problem

      Shape traffic on DLCI to 256kbs

      Allow bursts up to 512kbs

      set sampling interval to 10ms


      Here is the answer

      frame-relay cir 256000

      frame-relay bc 2560

      frame-relay be 2560


      This is directly out of the CCIE 360 materials.

      Why is the cir listed as 256000 but bc and be have been shortened?

      Why was be configured at all when the original problem didn't specify be?

      If we were supposed to set the tc to 10 ms how come it was configured in the answer?


      I have watched the videos but this formula just doesn't make sense, I am missing something. Any help is greatly appreciated.

        • 1. Re: Token Bucket Algorithm

          ok, I think I figured out how to solve for Bc but does Be always equal Bc? I can't seem to figure out how to solve for Be...

          • 2. Re: Token Bucket Algorithm

            Hello Frnd

            Shape traffic on DLCI to 256kbs & frame-relay cir 256000

            Solution: 256 * 1000 = 256000 bits/s. The CIR is listed in bits/s.


            frame-relay bc 2560


            Solution: Bc = CIR in Kbps * Tc.

                          Bc = 256 * 10 => 2560

            frame-relay be 2560

            Solution: Be = [Access Rate - CIR ] * Tc/1000      Note: Access Rate and CIR are in b/s

                          Be = [512000 - 256000 ] * 10/1000

                               = [256000] * 1/100

                               = [256000]/100

                               = 2560




            • 4. Re: Token Bucket Algorithm

              Dante's link provides a lot of good information, but the simpler document found here provides a more direct approach to the problem: www.cisco.com/warp/public/125/21.pdf

              A formula for the time interval in terms of committed burst is provided: Tc = Bc/CIR.  The document also indicates that Bc (and Be) is expressed in bits, Tc in seconds, and CIR in bits per second.


              You can rearrange this formula to determine committed burst: Bc = Tc * CIR.  As long as your units match up, it's easy to determine the correct value for Bc.


              Given a CIR of 256 kbps and a Tc of 10 ms:

                 1) Convert 256 kbps to 256000 bits per second.

                 2) Convert 10 ms to .01 seconds

                 3) Do the math: Bc = 256000 * .01 = 2560


              Since you are told to allow bursts up to 512 kbps, the DLCI's peak rate, you first need to determine your excess information rate (EIR) in order to determine Be [ Peak = CIR + Be/Tc per the document; therefore, EIR = Be/Tc ].

              EIR is defined as Burst Rate (Peak Rate) minus CIR so your excess information rate is 512 kbps - 256 kbps = 256 kbps.


              Rearranging the formula EIR = Be/Tc to solve for Be, you get Be = EIR * Tc.  Like the calculation for Bc, EIR should be in bits per second and the time interval should be in seconds.  Noting that Tc remains the same, you get the same result as Bc.


              Given an EIR of 256 kbps and a Tc of 10 ms:

                 1) Convert 256 kbps to 256000 bits per second.

                 2) Convert 10 ms to .01 seconds

                 3) Do the math: Be = 256000 * .01 = 2560


              Keep in mind that if your burst rate were 768 kbps while your CIR and time interval remained unchanged, your Be value would be 512000 * .01 = 5120.