# Convert bytes to MB on cisco router

Discussion in 'Cisco' started by tlanum@yahoo.com, Mar 29, 2006.

1. ### Guest

when doing a sho int atm and looking at the output.

Example

143849529 packets input, 129326779238 bytes
125183986 packets output, 29173768997 bytes
there is a way to convert this to actual Mb/s

Does someone know the calculation to achieve this

, Mar 29, 2006

2. ### Arnold NipperGuest

On 29.03.2006 22:59 wrote

> when doing a sho int atm and looking at the output.
>
> Example
>
> 143849529 packets input, 129326779238 bytes
> 125183986 packets output, 29173768997 bytes
> there is a way to convert this to actual Mb/s
>
> Does someone know the calculation to achieve this
>

Take the minimum of 'Last clearing of "show interface" counters' and
'uptime' and do the math,

--
Arnold Nipper, AN45

Arnold Nipper, Mar 29, 2006

3. ### Walter RobersonGuest

In article <>,
<> wrote:
>when doing a sho int atm and looking at the output.

>143849529 packets input, 129326779238 bytes
>125183986 packets output, 29173768997 bytes
>there is a way to convert this to actual Mb/s

>Does someone know the calculation to achieve this

On sufficiently new high-end devices you could probably
put together some TCL code that did the conversion for you.

The figures you gave are not enough information to calculate
Mb/s -- to calculate that, you need the time interval as
well as the volume difference.

You should decide "which" Mb/s you mean. Does your prefix 'M'
mean "million" (10^6), or does it mean the same "mega" that is
used to measure memory, 1024*1024*1024 (i.e., 2^30) ?

Also, because of inconsistant usage, you should decide if you
want megabits per second or megabytes per second.

I would suggest that possibly the easiest thing for you to do
would be to set up MRTG monitoring of the device, and let it
take the measurements and do the calculations and keep the nice
historical trend graphs. It usually isn't very useful to know
that the average traffic rate *since the device was last reset*
was something-or-other -- typically the low evening and weekend
figures distort those figures completely. You probably want to
get a good idea of what your peak rates are at various times:
MRTG and similar are great for that.

Walter Roberson, Mar 29, 2006
4. ### MervGuest

If you are just trying to get a traffic snapshot,
then clear the interface counters and then do
a show clock and a show interface together
wait several minutes and repeat. subtract the
traffic and the clock times and do the math.

you can also configure "load-interval 30" on the interface
and then it will give you traffic average for a 30 second period
as seen in the output of show interface

Merv, Mar 30, 2006
5. ### Joel SalminenGuest

Short answer... there is 8 bits to 1 bytes.

Covert bits to bytes: divide the megabits by 8
Covert bytes to bits: multiple the megabytes by 8

<> wrote in message
news:...
> when doing a sho int atm and looking at the output.
>
> Example
>
> 143849529 packets input, 129326779238 bytes
> 125183986 packets output, 29173768997 bytes
> there is a way to convert this to actual Mb/s
>
> Does someone know the calculation to achieve this
>

Joel Salminen, Mar 30, 2006
6. ### Walter RobersonGuest

In article <>,
Joel Salminen <nomail@nomail> top-posted, now corrected:
><> wrote in message
>news:...
>> when doing a sho int atm and looking at the output.

>> 143849529 packets input, 129326779238 bytes

>> there is a way to convert this to actual Mb/s

>Short answer... there is 8 bits to 1 bytes.

>Covert bits to bytes: divide the megabits by 8
>Covert bytes to bits: multiple the megabytes by 8

Please re-examine the information the OP has available.
It is in packets and bytes. There is no megabits or megabytes
on it, so neither of your calculations would apply.

Your calculations are also not correct as phrased. One does not
convert "bits" to "bytes" by dividing megabits by 8. Dividing
megabits by 8 would yeild megabytes, not bytes.

But the OP wanted "Mb/s". As I indicated in my earlier posting,
one first has to resolve what "Mb/s" means. "Mb/s" is sometimes
used for "megabits per second", and sometimes for "megabytes per
second" (but not correctly). In turn "megabits" might refer to
one million bits (10^6), or it might refer to "mega" as in the
use in computer memory, which is 1024*1024*1024 (2^30).

Once one has decided what "Mb/s" means, one will need a time
interval in order to do the appropriate calculation. Scaling
the data the OP showed by 8 cannot yield megabits PER SECOND.

Walter Roberson, Mar 30, 2006
7. ### TLanGuest

ok then i had this wrong. I thought this was the avg throughput at that
point in time on that interface. an engineer at AT&T informed me but I
must have misheard him.

I have setup MRTG so not an issue anymore

also Mb/s in my topic was meant as megabits per second.

TLan, Mar 30, 2006