Networking Forums

Networking Forums > Computer Networking > Linux Networking > When are 'egress' traffic shaping rules applied?

Reply
Thread Tools Display Modes

When are 'egress' traffic shaping rules applied?

 
 
spip_yeah@yahoo.com
Guest
Posts: n/a

 
      11-29-2006, 06:38 PM
Hello,

I understand that shaping occurs on egress. However, what does it mean
exactly to leave an interface? Is it when a packet actually exits an
interface to be transmitted? Or does it also mean when a packet exits
one interface to be transmitted over another?

If we have a linux router with two interfaces, eth0 and eth1. And
packet arrives on eth1 that needs to be routed to eth0. From eth0 it is
transmitted. The packet is NOT considered to have left the eth1
interface, but only the eth0 interface, correct? Therefore, if there
are shaping rules on both eth0 and eth1, only the ones for eth0 will be
applied, correct?

Thank you.

 
Reply With Quote
 
 
 
 
buck
Guest
Posts: n/a

 
      11-30-2006, 07:35 PM
On 29 Nov 2006 11:38:29 -0800, (E-Mail Removed) wrote:

>Hello,
>
>I understand that shaping occurs on egress. However, what does it mean
>exactly to leave an interface? Is it when a packet actually exits an
>interface to be transmitted? Or does it also mean when a packet exits
>one interface to be transmitted over another?
>
>If we have a linux router with two interfaces, eth0 and eth1. And
>packet arrives on eth1 that needs to be routed to eth0. From eth0 it is
>transmitted. The packet is NOT considered to have left the eth1
>interface, but only the eth0 interface, correct? Therefore, if there
>are shaping rules on both eth0 and eth1, only the ones for eth0 will be
>applied, correct?
>
>Thank you.


No, that is not correct.

A packet deques when the shaper decides to do that, and the shaper
has no clue - and does not care about - where that packet is going.
So if a packet gets sent from eth1 to eth0, the egress shaping on eth1
decides when it goes to eth0 and the egress shaping on eth0 decides
when it gets sent to the internet.

When the buffer for eth1 fills up, the packets destined for eth0 will
be dropped.
--
buck

 
Reply With Quote
 
spip_yeah@yahoo.com
Guest
Posts: n/a

 
      12-01-2006, 12:56 AM
> No, that is not correct.
>
> A packet deques when the shaper decides to do that, and the shaper
> has no clue - and does not care about - where that packet is going.
> So if a packet gets sent from eth1 to eth0, the egress shaping on eth1
> decides when it goes to eth0 and the egress shaping on eth0 decides
> when it gets sent to the internet.


Ok, so shaping is applied when a packet is dequeued.

So there's something I don't understand, and the only way to explain it
would be that a packet never gets dequeued from one device to get
enqueued on another device, but I would like to confirm. In my example
I will refer to my use of netem, but this is not really netem specific,
only it's easy the see the results.

So if I again take my case of a linux router having 2 interfaces, eth0
and eth1. net0 is the network interfaced via eth0, and net1 is the
network interfaced via eth1.

I am setting a netem delay rule of 100 ms on eth1. Then a host from
net0 pings a host from net1. The ping is 100ms longer than without the
rule. This tells me that the packet has been dequeued only once, since
the 100 ms delay has only been applied once. This in turn tells me a
packet gets enqueued only for one device when going through a router.

So if we forget the round trip for now, and knowing that when a packet
goes through a router by entering from one interface and leaving from
another interface it apparently only gets queued once, which interface
does the packet get queued for? For the example, assuming a host on
net0 sends a packet to a host on net1, does the packet get enqueued,
and later dequeued, on eth0 or eth1?

Thank you.

 
Reply With Quote
 
Andy Furniss
Guest
Posts: n/a

 
      12-01-2006, 10:09 AM
(E-Mail Removed) wrote:
> Hello,
>
> I understand that shaping occurs on egress. However, what does it mean
> exactly to leave an interface? Is it when a packet actually exits an
> interface to be transmitted? Or does it also mean when a packet exits
> one interface to be transmitted over another?
>
> If we have a linux router with two interfaces, eth0 and eth1. And
> packet arrives on eth1 that needs to be routed to eth0. From eth0 it is
> transmitted. The packet is NOT considered to have left the eth1
> interface, but only the eth0 interface, correct? Therefore, if there
> are shaping rules on both eth0 and eth1, only the ones for eth0 will be
> applied, correct?
>
> Thank you.
>


Yes, ingress traffic does not hit the egress shaper on the nic it came
in on.

If you want to shape ingress you have to use ifb (recent 2.6s), you can
also police traffic on ingress.

Andy.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables: rules not applied? julien Linux Networking 2 08-03-2008 05:05 PM
traffic-shaping? peter pilsl Linux Networking 0 04-15-2007 08:20 PM
MN-100 and traffic shaping Nikitas Broadband Hardware 1 07-25-2004 01:19 AM
shaping traffic Benjamin Hirsch Home Networking 3 02-12-2004 07:51 PM
Traffic Shaping Leonardo H. Machado Linux Networking 0 10-12-2003 03:26 AM



1 2 3 4 5 6 7 8 9 10 11