All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] CBQ DEVICE BW?
@ 2003-05-23  8:56 Srikanth
  2003-05-23 10:14 ` Stef Coene
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Srikanth @ 2003-05-23  8:56 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

Hi,

The CBQ config file shud be some thing like this.

DEVICE=eth0,10Mbit,1Mbit
RATE=50Kbit
WEIGHT=5Kbit

Shall i hardcode the DEVICE BW as 10/100 Mbit
or
Shall i use any other tool like ethtool for getting this.
ethtool gives Speed: 10Mbps

If so, how about, if i use some other Interfaces other than eth0,
like ppp0 or some other?

C'd anybody can give a suggestion over this?

thanks & regards,
Srikanth.



[-- Attachment #2: Type: text/html, Size: 641 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LARTC] CBQ DEVICE BW?
  2003-05-23  8:56 [LARTC] CBQ DEVICE BW? Srikanth
@ 2003-05-23 10:14 ` Stef Coene
  2003-05-23 11:49 ` Srikanth
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stef Coene @ 2003-05-23 10:14 UTC (permalink / raw)
  To: lartc

On Friday 23 May 2003 10:44, Srikanth wrote:
> Hi,
>
> The CBQ config file shud be some thing like this.
>
> DEVICE=eth0,10Mbit,1Mbit
> RATEPKbit
> WEIGHT=5Kbit
>
> Shall i hardcode the DEVICE BW as 10/100 Mbit
> or
> Shall i use any other tool like ethtool for getting this.
> ethtool gives Speed: 10Mbps
>
> If so, how about, if i use some other Interfaces other than eth0,
> like ppp0 or some other?
>
> C'd anybody can give a suggestion over this?
Bandwidth should be the real physical bandwidth of the device.

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LARTC] CBQ DEVICE BW?
  2003-05-23  8:56 [LARTC] CBQ DEVICE BW? Srikanth
  2003-05-23 10:14 ` Stef Coene
@ 2003-05-23 11:49 ` Srikanth
  2003-05-23 12:38 ` Srikanth
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Srikanth @ 2003-05-23 11:49 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]

Thanks Stef,

I need to clarify more please.

Stef Coene wrote:

>On Friday 23 May 2003 10:44, Srikanth wrote:
>  
>
>>Hi,
>>
>>The CBQ config file shud be some thing like this.
>>
>>DEVICE=eth0,10Mbit,1Mbit
>>RATE=50Kbit
>>WEIGHT=5Kbit
>>
>>Shall i hardcode the DEVICE BW as 10/100 Mbit
>>or
>>Shall i use any other tool like ethtool for getting this.
>>ethtool gives Speed: 10Mbps
>>
>>If so, how about, if i use some other Interfaces other than eth0,
>>like ppp0 or some other?
>>
>>C'd anybody can give a suggestion over this?
>>    
>>
>Bandwidth should be the real physical bandwidth of the device.
>
Forgive me, if i'm wrong. 

As of my understanding, are the below lines right?

DEVICE BW = Real physical bandwidth of the device 

So, Here DEVICE means only the Interface, not the Link, am i right?
 
&

RATE = Rate assigned to perticular user/network/service.

How much the user/network/service can aquire max. allowable rate?


I can consider as 10/100 Mbps for ethernet interface.
So, how about, when i use ppp0 (pppoe) in my CBQ, is it same?
bcoz, pppoe uses eth0, am i right?

>
>Stef
>
reg,
Srikanth.

>
>  
>


[-- Attachment #2: Type: text/html, Size: 1701 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LARTC] CBQ DEVICE BW?
  2003-05-23  8:56 [LARTC] CBQ DEVICE BW? Srikanth
  2003-05-23 10:14 ` Stef Coene
  2003-05-23 11:49 ` Srikanth
@ 2003-05-23 12:38 ` Srikanth
  2003-05-23 16:53 ` Stef Coene
  2003-05-24  4:30 ` Srikanth
  4 siblings, 0 replies; 6+ messages in thread
From: Srikanth @ 2003-05-23 12:38 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 2891 bytes --]

One more question,

Stef Coene wrote:

>On Friday 23 May 2003 10:44, Srikanth wrote:
>  
>
>>Hi,
>>
>>The CBQ config file shud be some thing like this.
>>
>>DEVICE=eth0,10Mbit,1Mbit
>>RATE=50Kbit
>>WEIGHT=5Kbit
>>
>>Shall i hardcode the DEVICE BW as 10/100 Mbit
>>or
>>Shall i use any other tool like ethtool for getting this.
>>ethtool gives Speed: 10Mbps
>>
>>If so, how about, if i use some other Interfaces other than eth0,
>>like ppp0 or some other?
>>
>>C'd anybody can give a suggestion over this?
>>    
>>
>Bandwidth should be the real physical bandwidth of the device.
>  
>
How do i get the real physical bandwidth of the device?

The below program attached is giving the value 6, on my system.
In some other systems, it's giving 2 (don't know whether Kbps/Mbps).

>Stef
>
/*
 *    Gets the bandwidth of the interface.
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <errno.h>

#include <db.h>
#include <sys/types.h>
#include <sys/time.h>
#include <fcntl.h>

#include <sys/socket.h>
#include <sys/ioctl.h>
//#include <netdb.h>

#include <linux/in.h>
#include <linux/if.h>
#include "ifstats.h"

extern int errno;

int
IFSGetBandwidth (if_stats_desc_struct * ifsd)
{
//#ifdef HAS_SIOCGIFINDEX
  int s, status;
  struct ifreq ifr;
  struct in_addr ina;
  if_ip_addr_union ip;


  if (ifsd == NULL)
    {
        printf("case 1\n");             
        return (-1);
    }     

  /* Must have a specified interface. */
  if (ifsd->interface == NULL)
    {             
        printf("case 2\n");             
    return (-1);
    }

  /* Create a UDP socket. */
  s = socket (AF_INET, SOCK_DGRAM, 0);
  if (s < 0)
    {             
        printf("case 3\n");             
    return (-1);
    }
 
  /* Set interface name explicitly from ifsd. */
  strncpy (ifr.ifr_name, ifsd->interface, IFNAMSIZ);
  ifr.ifr_name[IFNAMSIZ - 1] = '\0';

  /*   Get bandwidth of interface and put into interface request
     *            *   structure.
     *                     */
  status = ioctl(s, SIOCGIFINDEX, &ifr);

  /* Close socket. */
  close (s);

  /* ioctl() failed? */
  if (status < 0)
    {             
        perror("! Ioctl");       
      printf("case 4\n");             
    return (-1);
    }     

  ifsd->bandwidth = ifr.ifr_bandwidth;
 printf("Hello World\n");
  printf("Bandwidth: %i\n", ifsd->bandwidth);
 
//#endif /* HAS_SIOCGIFINDEX */

  return (0);
}


main ()
{
      int retVal;
    if_stats_desc_struct * ifsd;

    ifsd = (if_stats_desc_struct *) malloc(sizeof(if_stats_desc_struct));
    if (ifsd == NULL)
        perror("! Malloc");

    ifsd->interface = (char *) malloc(20);
    if (ifsd->interface == NULL)
        perror("! Malloc");
    strcpy(ifsd->interface, "eth0");   
      retVal = IFSGetBandwidth (ifsd);
    free(ifsd->interface);
    free(ifsd);
    printf("retVal = %d\n", retVal);
}



regards,
Srikanth.

>
>  
>


[-- Attachment #2: Type: text/html, Size: 5363 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LARTC] CBQ DEVICE BW?
  2003-05-23  8:56 [LARTC] CBQ DEVICE BW? Srikanth
                   ` (2 preceding siblings ...)
  2003-05-23 12:38 ` Srikanth
@ 2003-05-23 16:53 ` Stef Coene
  2003-05-24  4:30 ` Srikanth
  4 siblings, 0 replies; 6+ messages in thread
From: Stef Coene @ 2003-05-23 16:53 UTC (permalink / raw)
  To: lartc

> Forgive me, if i'm wrong.
>
> As of my understanding, are the below lines right?
>
> DEVICE BW = Real physical bandwidth of the device
>
> So, Here DEVICE means only the Interface, not the Link, am i right?
Yes.

> &
>
> RATE = Rate assigned to perticular user/network/service.
>
> How much the user/network/service can aquire max. allowable rate?
Yes.  If you add the bounded parameter, you create a maximum for that class.

> I can consider as 10/100 Mbps for ethernet interface.
> So, how about, when i use ppp0 (pppoe) in my CBQ, is it same?
> bcoz, pppoe uses eth0, am i right?
I'm not sure about that.  But I think you have to use the eth0 speed.
Or use htb, no more bandwidth questions needed :)

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LARTC] CBQ DEVICE BW?
  2003-05-23  8:56 [LARTC] CBQ DEVICE BW? Srikanth
                   ` (3 preceding siblings ...)
  2003-05-23 16:53 ` Stef Coene
@ 2003-05-24  4:30 ` Srikanth
  4 siblings, 0 replies; 6+ messages in thread
From: Srikanth @ 2003-05-24  4:30 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]

Thanks Stef,

I've customized ethtool source, it's giving the correct values depends 
on the real
physical I/F BW. (as per my requirements)

I need only speed from that.

Stef Coene wrote:

>>Forgive me, if i'm wrong.
>>
>>As of my understanding, are the below lines right?
>>
>>DEVICE BW = Real physical bandwidth of the device
>>
>>So, Here DEVICE means only the Interface, not the Link, am i right?
>>    
>>
>Yes.
>
>>&
>>
>>RATE = Rate assigned to perticular user/network/service.
>>
>>How much the user/network/service can aquire max. allowable rate?
>>    
>>
>Yes.  If you add the bounded parameter, you create a maximum for that class.
>
>>I can consider as 10/100 Mbps for ethernet interface.
>>So, how about, when i use ppp0 (pppoe) in my CBQ, is it same?
>>bcoz, pppoe uses eth0, am i right?
>>    
>>
>I'm not sure about that.  But I think you have to use the eth0 speed.
>Or use htb, no more bandwidth questions needed :)
>
Yah, from now onwards, no more DEVICE BW questions.

>Stef
>
>  
>
Srikanth.

[-- Attachment #2: Type: text/html, Size: 1635 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-05-24  4:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-23  8:56 [LARTC] CBQ DEVICE BW? Srikanth
2003-05-23 10:14 ` Stef Coene
2003-05-23 11:49 ` Srikanth
2003-05-23 12:38 ` Srikanth
2003-05-23 16:53 ` Stef Coene
2003-05-24  4:30 ` Srikanth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.