Re: [LARTC] Shaping per IP in PPPoE borrowing or sharing Uplink or Downlink

2006-04-20 Thread Rani Ahmed
thanks for your help. but i am not that much used to tc. i use tcng. so 
how should i write that in tcng?

Anton Glinkov wrote:


If they are all on the same ethernet device, you can match them with:
tc filter add dev ${DEVICE} parent 1: protocol all u32 \
match u16 0x8864 0x at -2 flowid 1:${ID}

8864 is the PPP session ethernet protocol

you can play around with u32 if you want to match tos or ports and stuff..

 


helo again. I think this question i am asking is worth:

we know that pppoe-server creates a pppX device on each connection done
to it.
So, when i have to shape, i have to shape each pppX connection device on
itself alone.
What i know is that the borrowing method on one device by itself,  e.g.
ppp0, alone using HTB or the like. this means that i have to create for
another device, e.g. ppp1, its own HTB or CBQ tree.

So, how can i in PPPoE technology setup sharing or borrowing between all
the pppX devices so it won't let network starvation problem float on
surface?

Thanks.

   



 



___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] Shaping per IP in PPPoE borrowing or sharing Uplink or Downlink

2006-04-15 Thread Anton Glinkov
If they are all on the same ethernet device, you can match them with:
tc filter add dev ${DEVICE} parent 1: protocol all u32 \
match u16 0x8864 0x at -2 flowid 1:${ID}

8864 is the PPP session ethernet protocol

you can play around with u32 if you want to match tos or ports and stuff..

> helo again. I think this question i am asking is worth:
>
> we know that pppoe-server creates a pppX device on each connection done
> to it.
> So, when i have to shape, i have to shape each pppX connection device on
> itself alone.
> What i know is that the borrowing method on one device by itself,  e.g.
> ppp0, alone using HTB or the like. this means that i have to create for
> another device, e.g. ppp1, its own HTB or CBQ tree.
>
> So, how can i in PPPoE technology setup sharing or borrowing between all
> the pppX devices so it won't let network starvation problem float on
> surface?
>
> Thanks.
>

-- 
Anton Glinkov
network administrator

___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] Shaping per IP in PPPoE borrowing or sharing Uplink or Downlink

2006-04-14 Thread Martin A. Brown

Hello again Rani,

 : helo again. I think this question i am asking is worth:
 : 
 : we know that pppoe-server creates a pppX device on each 
 : connection done to it. So, when i have to shape, i have to shape 
 : each pppX connection device on itself alone. What i know is that 
 : the borrowing method on one device by itself, e.g. ppp0, alone 
 : using HTB or the like. this means that i have to create for 
 : another device, e.g. ppp1, its own HTB or CBQ tree.
 : 
 : So, how can i in PPPoE technology setup sharing or borrowing 
 : between all the pppX devices so it won't let network starvation 
 : problem float on surface?

You should probably consider IMQ [0] or the new-ish IFB [1].  With 
either tool, you'll be able to create a traffic control structure 
which spans multiple output devices.

Good luck,

-Martin

 [0] IMQ = Intermediate Queuing Device
 http://www.linuximq.net/
 http://lartc.org/howto/lartc.imq.html
 http://wiki.nix.hu/cgi-bin/twiki/view/IMQ/HowToInstall
 [1] IFB = Intermediate Functional Block
 http://mailman.ds9a.nl/pipermail/lartc/2006q2/018641.html
 http://marc.theaimsgroup.com/?l=linux-netdev&m=113674224714758&w=2

-- 
Martin A. Brown --- Wonderfrog Enterprises --- [EMAIL PROTECTED]
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


RE: [LARTC] Shaping per IP in PPPoE

2006-04-11 Thread Roberto Scattini


hi, i use the roaringpenguin pppoe-server and limit the bandwidth per 
interface with this script:
(im using freeradius plugins too, thats the reason of the 
/var/run/radattr.pppx file)

(/etc/ppp/ip-up.d/0pppx_up)

#!/bin/sh

DOWN=`cat /var/run/radattr.$1 | grep 'RP-Downstream-Speed-Limit' | cut -d ' 
' -f 2`
UP=`cat /var/run/radattr.$1 | grep 'RP-Upstream-Speed-Limit' | cut -d ' ' -f 
2`


# limit Download Bandwidth with a simple htb qdisc and class (add QoS 
here?...)

/sbin/tc qdisc add dev $1 root handle 1: htb default 1
/sbin/tc class add dev $1 parent 1: classid 1:1 htb rate ${DOWN}kbit ceil 
${DOWN}kbit burst 1540



/sbin/tc qdisc add dev $1 handle : ingress
/sbin/tc filter add dev $1 parent : protocol ip prio 50 u32 \
   match ip src 0.0.0.0/0 \
   police rate ${UP}kbit burst 10k drop flowid :1

and have another script for deleting the rules 
(/etc/ppp/ip-down.d/0pppx_down):


#!/bin/sh

/sbin/tc qdisc del dev $1 root
/sbin/tc qdisc del dev $1 ingress

ppp executes this scripts each time an interface gets up or down.

hope it helps.

Roberto Scattini




From: Rani Ahmed <[EMAIL PROTECTED]>
To: lartc@mailman.ds9a.nl
Subject: [LARTC] Shaping per IP in PPPoE
Date: Tue, 11 Apr 2006 18:49:29 +0300

hi all.
i am currently now serving PPPoE in my area.
i had a script  generated  from tcng that worked perfectly before i started 
serving PPPoE.
the issue is not in the script it self BUT in  that "tc" code is not shaping 
on the ethernet anymore BUT INSTEAD

on the pppX devices. I tested it and talking jargon, what should i do?

The issue is that for each PPPoE login, PPPoE-server creates on the server a 
pppX device. that is 10 logins means 10 ppp devices. from ppp0 till ppp9. 
and one might die upon disconnection.

___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

_
Sabe más sobre la próxima generación del MSN Messenger. 
http://imagine-msn.com/minisites/messenger/default.aspx?locale=es-ar


___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


Re: [LARTC] Shaping per IP in PPPoE

2006-04-11 Thread Martin A. Brown

Hello Rani,

 : i am currently now serving PPPoE in my area. i had a script 
 : generated from tcng that worked perfectly before i started 
 : serving PPPoE. the issue is not in the script it self BUT in that 
 : "tc" code is not shaping on the ethernet anymore BUT INSTEAD on 
 : the pppX devices. I tested it and talking jargon, what should i 
 : do?
 : 
 : The issue is that for each PPPoE login, PPPoE-server creates on 
 : the server a pppX device. that is 10 logins means 10 ppp devices. 
 : from ppp0 till ppp9. and one might die upon disconnection. 

I'd suggest simply using the pppoe ip-up configuration scripts to 
call the appropriate tc or tcng commands.  Since ip-up should be 
called something like this:

  ip-up ppp0 $TTY $SPEED 192.168.0.4 10.0.0.4 $OTHER

Is ip-up called by YOUR pppoe-server binary? I am not able to test 
this.

you should be able to create a script that would either execute tc 
commands or a create tcng file on the fly.  I created the basic 
structure of such a script below, although you could probably 
add/replace your own shell functions (tc_sfq, tc_my_complex_config) 
with a much more complex traffic control configuration.

Good luck,

-Martin

#! /bin/bash
#
# -- add queuing to an interface brought up by pppd, 2006-04-11; -MAB
#GPL
#
# ip-up  
dev="$1"&& shift
pty="$1"&& shift
spd="$1"&& shift
lip="$1"&& shift
rip="$1"&& shift


logger () { command logger -it "${0##*/}" -- "$@" ; }
abort  () { logger "$@" ; exit 1 ; }

tc_tbf () {
  local dev="$1"&& shift
  local lip="$1"&& shift
  local rip="$1"&& shift
  test "$dev" = ""  && abort "${FUNCNAME}() called with no device name"
  test "$lip" = ""  && abort "${FUNCNAME}() called with no local IP"
  test "$rip" = ""  && abort "${FUNCNAME}() called with no remote IP"

  cat <<-EOTC
tc qdisc add dev $dev root handle 1:0 tbf rate 1544kbit limit 20kB 
burst 3kB
EOTC
}

# -- run all commands in a single shell that we instruct to quit on any error
#
tc_tbf  "$dev" "$lip" "$rip" | bash -e

# -- did the shell complete successfully?
#
test "$?" -gt 0 && abort "Could not install traffic control on $dev."

logger "Installed traffic control configuration on $dev."

# -- end of file



-- 
Martin A. Brown --- Wonderfrog Enterprises --- [EMAIL PROTECTED]
___
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc