Linux Netfilter discussions
 help / color / mirror / Atom feed
* IPMARK
@ 2008-09-18  8:30 Jason Cosby
  2008-09-18  9:06 ` IPMARK ArcosCom Linux User
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jason Cosby @ 2008-09-18  8:30 UTC (permalink / raw)
  To: netfilter

All,

Sorry to post here, but the LARTC list has gone belly up. I have a LAN of 35 with IPs from 192.168.1.6 thru 192.168.1.40 sharing a satellite link. I need to limit total bandwidth to 512Kbps and divide it evenly between all 35 clients. My plan is to create 35 individual queues and allow 100% borrowing so that the queues don't have to constantly be deleted/recreated upon user enter/exit. All traffic is run through NAT at the gateway computer. 

I see using IPMARK as the way to go, but am not clear how to put it together. The documentation doesn't quite clear it up for me. Can anyone help me get together a simple down and dirty script to do as I described? Once I get the network under control a bit I will continue implementing proper QOS. If I don't get a handle on this soon I will be tarred, feathered, and thrown in the desert to rot (almost), so any help is GREATLY appreciated. 

Thanks,
Jason

^ permalink raw reply	[flat|nested] 9+ messages in thread
* IPMARK
@ 2008-09-19  1:34 Jason Cosby
  0 siblings, 0 replies; 9+ messages in thread
From: Jason Cosby @ 2008-09-19  1:34 UTC (permalink / raw)
  To: netfilter

Thanks for the responses. I've studied Wondershaper, the LARTC, and ADSL-optimizer. There are lots of great ideas in there for TOS bandwidth division (also important), but, AFAIK, FairNAT is the only one focused on per user bandwidth division. 

Currently, I've got the user mark derived from the last part of the IP address * 10. It would save a lot of work and scripting using IPMARK, and I was getting errors out of MARK that I never figured out (might be the lack of using hex). Right now, I also have to specify the IPs in the script. I was hoping that using IPMARK would eliminate this as well--i.e. whatever IP comes along is checked against allowed MACs and auto assigned a user mark without me having to worry about it.

I'm also not clear on and'ing the user mark with the TOS mark after I get a basic per user bandwidth division going on and am iplementing TOS marking. 

Thanks,
Jason 

^ permalink raw reply	[flat|nested] 9+ messages in thread
* IPMARK
@ 2008-09-20  7:14 Jason Cosby
  2008-09-20 12:22 ` IPMARK Michal Soltys
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Cosby @ 2008-09-20  7:14 UTC (permalink / raw)
  To: nozo; +Cc: netfilter

Thank you so much for taking the time to help me out. If I could pick this apart a bit more and understand it, I would be on my way. 

eth=eth1--this refers to LAN dev or NET dev? (I ran the first line via ssh below on LAN dev and it locked up the machine. This is for egress then? I neglected to mention that ingress is what I seek to control initially, which will require IMQ AFAIK. When finished, I'll have done the math and controlled egress to the point where ingress is very close to where it needs to be without policing.) 

tc class add dev $eth parent 1:0 classid 1:1 hfsc ls m2 512kbps \
ul m2 512kbps

ls=link sharing, ul=upper limit, clear on those. m2 is synonimous with sc?


tc class add dev $eth parent 1:1 classid 1:101 hfsc rt m2 60kbps \
ls m2 200kbps

rt=realtime, clear on that. Not clear on 200kbps spec. Related to upper limit or can borrow up to 200?

tc qdisc add dev $eth handle 101:0 parent 1:101 pfifo limit 10

pfifo because we don't need anything more advanced here, we don't know what kind of traffic we're catching, don't know destination for IP based queue, catching fragments, or some other reason?


tc class add dev $eth parent 1:1 classid 1:102 hfsc rt m2 400kbps \
ls m2 400kbps

I'm not tracking on how we can have 400kbps of realtime and linksharing simultaneously. They're not mutually exclusive? Not sure what the 1:2 ratio (200:400) translates to, but I know that understanding this is vital. 

tc qdisc add dev $eth handle 102:0 parent 1:102 sfq limit 20 perturb 10 quantum 1

How did we arrive at limit of 20? quantum 1 is to ensure maximum granularity vs. a higher number?

iptables -t mangle -A FORWARD -o $eth -m iprange --src-range 192.168.1.6-192.168.1.40 -j CLASSIFY --set-class 1:102

This is gold and what I was searching for (before hfsc got my interest). Makes perfect sense. 

Thanks so much. Hopefully others will benefit from the light being shed on hfsc here.

Jason

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

end of thread, other threads:[~2008-09-20 12:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18  8:30 IPMARK Jason Cosby
2008-09-18  9:06 ` IPMARK ArcosCom Linux User
2008-09-18  9:45 ` IPMARK julien vehent
2008-09-19  8:23 ` IPMARK Michal Soltys
2008-09-19  8:52   ` IPMARK julien vehent
2008-09-20 12:24     ` IPMARK Michal Soltys
  -- strict thread matches above, loose matches on Subject: below --
2008-09-19  1:34 IPMARK Jason Cosby
2008-09-20  7:14 IPMARK Jason Cosby
2008-09-20 12:22 ` IPMARK Michal Soltys

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox