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.
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. 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/
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.> > >
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.> > >
> 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/
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.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sorry if you have already answered this question, but i have a big mess right now.. I red the lartg FAQ and it literally says: "If you have 2 htb classes with different prio parameters, the class with the lowest prio parameter gets all the remaining bandwidth from the parent (after the other class has received its rate). The class with the lowest parameter will also the class with the lowest latency. However, if this class is overlimited (there is more traffic then the configured rate), the latency can go up. " I have to classes, and i have interactive traffic and non-interactive traffic, each assigned to one of these classes. When i get lots of tcp connections to the non-interactive and it begins to ceil, then it seems not to lend that bw again whenever the interactive-class needs it. They are configured like this: tc class add dev ${DEV} parent 1:1 classid 1:10 htb prio 1 rate 200kbit ceil 300kbit tc class add dev ${DEV} parent 1:1 classid 1:20 htb prio 2 rate 100kbit ceil 300kbit I dont understand this " However, if this class is overlimited (there is more traffic then the configured rate), the latency can go up. " <-- What should i do? Which prio should i set, so that interactive traffic class has low latency and has the highest prio? -----BEGIN PGP SIGNATURE----- Version: PGP 8.0 iQA/AwUBPtDzS37diNnrrZKsEQK0gQCdH4XOw+btszWcCTIFVFHMMv6ZNEoAnRub JXHTNKomeMnm0kBb9tvFqs15 =bwBZ -----END PGP SIGNATURE----- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Sunday 25 May 2003 18:46, GoMi wrote:> Sorry if you have already answered this question, but i have a big mess > right now.. I red the lartg FAQ and it literally says: > > "If you have 2 htb classes with different prio parameters, the class with > the lowest prio parameter gets all the remaining bandwidth from the parent > (after the other class has received its rate). The class with the lowest > parameter will also the class with the lowest latency. However, if this > class is overlimited (there is more traffic then the configured rate), the > latency can go up. " > > > I have to classes, and i have interactive traffic and non-interactive > traffic, each assigned to one of these classes. > > When i get lots of tcp connections to the non-interactive and it begins to > ceil, then it seems not to lend that bw again whenever the > interactive-class needs it. They are configured like this:It can take some time before the non-interactive traffic will slow down if you generate interactive traffic. You can prevent this by ceiling the non-interactive traffic so there is always some minimal bandwidth left for the interactive traffic.> tc class add dev ${DEV} parent 1:1 classid 1:10 htb prio 1 rate 200kbit > ceil 300kbit > tc class add dev ${DEV} parent 1:1 classid 1:20 htb prio 2 rate 100kbit > ceil 300kbit > > > I dont understand this " However, if this class is overlimited (there is > more traffic then the configured rate), the latency can go up. " <-- What > should i do? Which prio should i set, so that interactive traffic class has > low latency and has the highest prio?You have to create a low prio class for your interactive class with rate = maximum traffic that you ever expect in that class. If you send more data in the class, the latency will go up. Example : class 1, rate 50 kbit class 10, prio 1, rate 10 kbit class 11, prio 2, rate 10 kbit class 12, prio 2, rate 80 kbit If class 10 is sending less then 10kbit, the latency will be low. But if that class sends more then 10kbit, the latency will go up. You can prevent this by using policers in your filters so you can control how many packets are sended to class 10. 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/