All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin A. Brown" <mabrown-lartc@securepipe.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] How to limit a dev bandwidth.
Date: Fri, 15 Aug 2003 04:16:50 +0000	[thread overview]
Message-ID: <marc-lartc-106092111227940@msgid-missing> (raw)
In-Reply-To: <marc-lartc-106032592806296@msgid-missing>


Raghuveer,

 : "It's very important to understand that you can only shape outgoing
 : traffic".

Be careful with terminology.  Stef is absolutely correct above*.

It is true that you can only "shape"  outgoing traffic.  Please don't
confuse shaping with other types of traffic control mechanisms, such as
scheduling, policing or filtering.  Shaping can only be done on the
traffic you transmit.  You can't delay a packet that is arriving on your
device.  It's already there!

 : So is it not possible to shape the incomming traffic at all...? I
 : already got some useful links and suggestion from Martin for ingress
 : mode.

Yes, the link I sent [1] was a link to IMQ [2]...you can shape incoming
traffic by using IMQ.  IMQ simulates a real device, so that you can apply
mechanisms which perform shaping (an HTB class inside an HTB qdisc, for
example) on that IMQ device.  Now you push your incoming traffic through
that device, and you are transmitting (even if only virtually) that
traffic, allowing you to shape.

I also suggested that you could use policing to limit the amount of
bandwidth that you accept.  This isn't at all like shaping.

  shaping:   delaying packets to meet a certain average rate
  policing:  applying an action (frequently dropping the packet) to any
             packet which exceeds a rate

Policing is not as elegant as shaping, and (in my experience) offers less
granularity of control.  It is also not as easy to use under linux as is
shaping.  I welcome contradictory opinions and superior expertise.

 : Can you pls suggest how to do incomming traffic control, if the
 : incomming traffic hitting the firewall at WAN interface eth0 with LAN
 : interface at eth1. I would like to do traffic control based on LAN IP's
 : and protocols like HTTP, FTP, SMTP, POP etc, for incomming traffic
 : only. Meanwhile Iam going through the links send by Martin.

Let's try this with a little diagram:

            +---------------+
 Internet --| wan0     eth0 |-- private network
            +---------------+
       qdisc here       qdisc here
       will shape       will shape
     traffic sent       traffic sent
      to Internet       from Internet


So, shape your "upload" traffic on wan0 (ACKs, maybe the packets with a
TCP source port of 25 from your internal mailserver).

Shape the "download" traffic on eth0.  Here you have the opportunity of
deliberately delaying the traffic before it reaches the client in the
private network.

Once again, I would like to recommend tcng [3].  If you are not yet
familiar with the linux traffic control subsystem, you may (will) find
tcng considerably more approachable than the raw tc commands.  I have
written a crash course in using tcng with HTB [4], which should provide
you enough detail to get started with tcng.

Best of luck,

-Martin

* ...although clever people have found a way around this rule, by creating
  a device which allows us to simulate packet transmission on inbound
  traffic.  See my note on IMQ above.

  [1]  http://mailman.ds9a.nl/pipermail/lartc/2003q3/009616.html
  [2]  http://trash.net/~kaber/imq/
  [3]  http://tcng.sourceforge.net/
  [4]  http://tldp.org/HOWTO/Traffic-Control-tcng-HTB-HOWTO/

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com

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

  parent reply	other threads:[~2003-08-15  4:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-08  6:59 [LARTC] How to limit a dev bandwidth anzp
2003-08-08 17:06 ` Stef Coene
2003-08-10  0:16 ` Martin A. Brown
2003-08-14 10:57 ` Raghuveer
2003-08-15  4:16 ` Martin A. Brown [this message]
2003-08-16  4:36 ` Madhuri Patwardhan
2003-08-16 17:18 ` Martin A. Brown
2003-08-16 18:43 ` Madhuri Patwardhan
2003-08-19  9:26 ` Raghuveer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-106092111227940@msgid-missing \
    --to=mabrown-lartc@securepipe.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.