* [Bridge] Performance loss with bridging+routing.
@ 2007-03-15 17:05 Egi, Norbert
2007-03-15 17:59 ` Egi, Norbert
0 siblings, 1 reply; 6+ messages in thread
From: Egi, Norbert @ 2007-03-15 17:05 UTC (permalink / raw)
To: bridge
Hi,
I have a machine with 4 Ethernet intefaces and I set up the configuration you can see below (only the first "figure"). There are two subnetworks each having a bridge with 2 interfaces and both of the bridges have an IP address for packet forwarding between the two subnetworks.
HOST1 --------------- ETH0 ETH2 --------------- HOST3
10.1.1.3 | | 10.2.2.3
BR0 --- ROUTING --- BR1
10.1.1.1 10.2.2.1
| |
HOST2 --------------- ETH1 ETH3 --------------- HOST4
10.1.1.2 10.2.2.2
My problem is that if I forward packets (64byte minimum size packets) between two machines on the same network (i.e. only bridging is done) I get ~700.000 pps throughput, while if packets are going from one subnetwork to the other, so packets are also routed between the two subnetwork, the forwarded packet rate is only ~525.000 pps, so ~25% worse.
To find out how bridging and routing perform on their own with only 2 interfaces I set up the following to topologies and forwarded packets from HOST1 to HOST2.
--- BRIDGING ---
| |
HOST1 --------------- ETH0 ETH1 --------------- HOST2
10.1.1.1 Promisc(0.0.0.0) Promisc(0.0.0.0) 10.1.1.2
--- ROUTING ---
| |
HOST1 --------------- ETH0 ETH1 --------------- HOST2
10.1.1.2 10.1.1.1 10.2.2.1 10.2.2.2
With the bridged setup I get ~700.000 pps like before and in the routed setup ~685.000 pps, just a little bit below the bridged setup. This is good, exactly what I would have expect. However when I set up the configuration below, which is very similar to the first one above, only two interfaces are missing, I only get ~525.000 pps again.
--- ROUTING ---
| |
BR0 BR1
10.1.1.1 10.2.2.1
| |
HOST1 --------------- ETH0 ETH1 --------------- HOST2
10.1.1.2 Promisc(0.0.0.0) Promisc(0.0.0.0) 10.2.2.2
I have expected a little performance degradation compared to plain routing as a packet traverses two bridges besides being routed as well, but I think ~175.000 pps is too much.
I checked the MAC addresses learnt by both bridges and everything seemed alright. My assumption is that the bottleneck is in the bridge when it has to pass the packets up to the IP layer as opposed to when it has to send the packet out on another port, but I wouldn't expect such a big difference as it looks to me that very similar things should go on inside the bridge in both cases.
Has anyone had similar experience or I'm doing something wrong when combining bridging and routing?
If this is a normal behaviour could anyone tell me where and why the packets got dropped? Or why the performance loss occurs?
Any suggestions are very welcome.
Norbert
^ permalink raw reply [flat|nested] 6+ messages in thread* [Bridge] Performance loss with bridging+routing.
2007-03-15 17:05 [Bridge] Performance loss with bridging+routing Egi, Norbert
@ 2007-03-15 17:59 ` Egi, Norbert
2007-03-17 16:11 ` Jason Lunz
2007-04-07 14:16 ` Bart De Schuymer
0 siblings, 2 replies; 6+ messages in thread
From: Egi, Norbert @ 2007-03-15 17:59 UTC (permalink / raw)
To: Egi, Norbert, bridge
Sorry, it looks like the spaces have different sizes in my mailing system. I hope the graphs are more readable now.
Hi,
I have a machine with 4 Ethernet intefaces and I set up the configuration you can see below (only the first "figure"). There are two subnetworks each having a bridge with 2 interfaces and both of the bridges have an IP address for packet forwarding between the two subnetworks.
HOST1 --------------- ETH0 ETH2 --------------- HOST3
10.1.1.3 | | 10.2.2.3
BR0 --- ROUTING --- BR1
10.1.1.1 10.2.2.1
| |
HOST2 --------------- ETH1 ETH3 --------------- HOST4
10.1.1.2 10.2.2.2
My problem is that if I forward packets (64byte minimum size packets) between two machines on the same network (i.e. only bridging is done) I get ~700.000 pps throughput, while if packets are going from one subnetwork to the other, so packets are also routed between the two subnetwork, the forwarded packet rate is only ~525.000 pps, so ~25% worse.
To find out how bridging and routing perform on their own with only 2 interfaces I set up the following to topologies and forwarded packets from HOST1 to HOST2.
--- BRIDGING ---
| |
HOST1 --------------- ETH0 ETH1 --------------- HOST2
10.1.1.1 Promisc(0.0.0.0) Promisc(0.0.0.0) 10.1.1.2
--- ROUTING ---
| |
HOST1 --------------- ETH0 ETH1 --------------- HOST2
10.1.1.2 10.1.1.1 10.2.2.1 10.2.2.2
With the bridged setup I get ~700.000 pps like before and in the routed setup ~685.000 pps, just a little bit below the bridged setup. This is good, exactly what I would have expect. However when I set up the configuration below, which is very similar to the first one above, only two interfaces are missing, I only get ~525.000 pps again.
--- ROUTING ---
| |
BR0 BR1
10.1.1.1 10.2.2.1
| |
HOST1 --------------- ETH0 ETH1 --------------- HOST2
10.1.1.2 Promisc(0.0.0.0) Promisc(0.0.0.0) 10.2.2.2
I have expected a little performance degradation compared to plain routing as a packet traverses two bridges besides being routed as well, but I think ~175.000 pps is too much.
I checked the MAC addresses learnt by both bridges and everything seemed alright. My assumption is that the bottleneck is in the bridge when it has to pass the packets up to the IP layer as opposed to when it has to send the packet out on another port, but I wouldn't expect such a big difference as it looks to me that very similar things should go on inside the bridge in both cases.
Has anyone had similar experience or I'm doing something wrong when combining bridging and routing?
If this is a normal behaviour could anyone tell me where and why the packets got dropped? Or why the performance loss occurs?
Any suggestions are very welcome.
Norbert
________________________________
From: bridge-bounces@lists.osdl.org on behalf of Egi, Norbert
Sent: Thu 3/15/2007 17:05
To: bridge@lists.osdl.org
Subject: [Bridge] Performance loss with bridging+routing.
Hi,
I have a machine with 4 Ethernet intefaces and I set up the configuration you can see below (only the first "figure"). There are two subnetworks each having a bridge with 2 interfaces and both of the bridges have an IP address for packet forwarding between the two subnetworks.
HOST1 --------------- ETH0 ETH2 --------------- HOST3
10.1.1.3 | | 10.2.2.3
BR0 --- ROUTING --- BR1
10.1.1.1 10.2.2.1
| |
HOST2 --------------- ETH1 ETH3 --------------- HOST4
10.1.1.2 10.2.2.2
My problem is that if I forward packets (64byte minimum size packets) between two machines on the same network (i.e. only bridging is done) I get ~700.000 pps throughput, while if packets are going from one subnetwork to the other, so packets are also routed between the two subnetwork, the forwarded packet rate is only ~525.000 pps, so ~25% worse.
To find out how bridging and routing perform on their own with only 2 interfaces I set up the following to topologies and forwarded packets from HOST1 to HOST2.
--- BRIDGING ---
| |
HOST1 --------------- ETH0 ETH1 --------------- HOST2
10.1.1.1 Promisc(0.0.0.0) Promisc(0.0.0.0) 10.1.1.2
--- ROUTING ---
| |
HOST1 --------------- ETH0 ETH1 --------------- HOST2
10.1.1.2 10.1.1.1 10.2.2.1 10.2.2.2
With the bridged setup I get ~700.000 pps like before and in the routed setup ~685.000 pps, just a little bit below the bridged setup. This is good, exactly what I would have expect. However when I set up the configuration below, which is very similar to the first one above, only two interfaces are missing, I only get ~525.000 pps again.
--- ROUTING ---
| |
BR0 BR1
10.1.1.1 10.2.2.1
| |
HOST1 --------------- ETH0 ETH1 --------------- HOST2
10.1.1.2 Promisc(0.0.0.0) Promisc(0.0.0.0) 10.2.2.2
I have expected a little performance degradation compared to plain routing as a packet traverses two bridges besides being routed as well, but I think ~175.000 pps is too much.
I checked the MAC addresses learnt by both bridges and everything seemed alright. My assumption is that the bottleneck is in the bridge when it has to pass the packets up to the IP layer as opposed to when it has to send the packet out on another port, but I wouldn't expect such a big difference as it looks to me that very similar things should go on inside the bridge in both cases.
Has anyone had similar experience or I'm doing something wrong when combining bridging and routing?
If this is a normal behaviour could anyone tell me where and why the packets got dropped? Or why the performance loss occurs?
Any suggestions are very welcome.
Norbert
_______________________________________________
Bridge mailing list
Bridge@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/bridge
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Bridge] Performance loss with bridging+routing.
2007-03-15 17:59 ` Egi, Norbert
@ 2007-03-17 16:11 ` Jason Lunz
2007-03-19 18:27 ` Stephen Hemminger
2007-04-07 14:16 ` Bart De Schuymer
1 sibling, 1 reply; 6+ messages in thread
From: Jason Lunz @ 2007-03-17 16:11 UTC (permalink / raw)
To: bridge
n.egi@lancaster.ac.uk said:
> Has anyone had similar experience or I'm doing something wrong when
> combining bridging and routing? If this is a normal behaviour could
> anyone tell me where and why the packets got dropped? Or why the
> performance loss occurs?
>
> Any suggestions are very welcome.
I would try using oprofile to see where the most time is being spent.
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bridge] Performance loss with bridging+routing.
2007-03-17 16:11 ` Jason Lunz
@ 2007-03-19 18:27 ` Stephen Hemminger
2007-03-20 9:40 ` Egi, Norbert
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2007-03-19 18:27 UTC (permalink / raw)
To: Jason Lunz; +Cc: bridge
On Sat, 17 Mar 2007 16:11:11 +0000 (UTC)
Jason Lunz <lunz@falooley.org> wrote:
> n.egi@lancaster.ac.uk said:
> > Has anyone had similar experience or I'm doing something wrong when
> > combining bridging and routing? If this is a normal behaviour could
> > anyone tell me where and why the packets got dropped? Or why the
> > performance loss occurs?
> >
> > Any suggestions are very welcome.
>
> I would try using oprofile to see where the most time is being spent.
>
If you are doing simple bridging or routing performance is about
the same. I see about 380K packets per second or more depending
on bus speed and network interface card.
But if you do filtering then your performance can easily get CPU
limited, especially if you are doing connection tracking. The problem
is that filtering ends up reading the whole packet.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bridge] Performance loss with bridging+routing.
2007-03-19 18:27 ` Stephen Hemminger
@ 2007-03-20 9:40 ` Egi, Norbert
0 siblings, 0 replies; 6+ messages in thread
From: Egi, Norbert @ 2007-03-20 9:40 UTC (permalink / raw)
To: Stephen Hemminger, Jason Lunz; +Cc: bridge
Hi
>If you are doing simple bridging or routing performance is about
>the same. I see about 380K packets per second or more depending
>on bus speed and network interface card.
>
>But if you do filtering then your performance can easily get CPU
>limited, especially if you are doing connection tracking. The problem
>is that filtering ends up reading the whole packet.
The case is that I'm not doing any filtering at all, the packet entering the bridge goes up to the IP layer (instead of bridged to another interface) where it is recognized that it has to be routed to another port and after routing it leaves the machine on another port directly. On its way out it shouldn't even enter the bridge attached to the outgoing interface, so the extra processing is done only in the incoming port's bridge compared to simple routing. However, I have been tracing the packet in the kernel so now I more or less know what path the packet 'travels' in the kernel and now I'm going to use oprofile to find out where the bottleneck is and where the packets got dropped. Hopefully can find the answer to the question...
Norbert
_______________________________________________
Bridge mailing list
Bridge@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/bridge
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bridge] Performance loss with bridging+routing.
2007-03-15 17:59 ` Egi, Norbert
2007-03-17 16:11 ` Jason Lunz
@ 2007-04-07 14:16 ` Bart De Schuymer
1 sibling, 0 replies; 6+ messages in thread
From: Bart De Schuymer @ 2007-04-07 14:16 UTC (permalink / raw)
To: Egi, Norbert; +Cc: bridge
Op do, 15-03-2007 te 17:59 +0000, schreef Egi, Norbert:
> Sorry, it looks like the spaces have different sizes in my mailing
> system. I hope the graphs are more readable now.
The performance drop comes from the fact that your routed traffic is
buffered twice. The first time before the bridge code gets its hands on
it, the second time when the bridge code decides the packet is destined
for the bridge itself and sends it back to the buffer. I've at times
wondered if it were feasible and acceptable to get rid of this second
buffering... At first glance it seems quite feasible, but maybe it would
cause performance trouble elsewhere. Dunno...
You can probably circumvent the performance drop using the ebtables
brouting chain. See
http://ebtables.sourceforge.net/examples/example2.html
cheers,
Bart
PS: try to make your mailer cut lines @ 78 characters when sending
messages to Linux lists
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-04-07 14:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-15 17:05 [Bridge] Performance loss with bridging+routing Egi, Norbert
2007-03-15 17:59 ` Egi, Norbert
2007-03-17 16:11 ` Jason Lunz
2007-03-19 18:27 ` Stephen Hemminger
2007-03-20 9:40 ` Egi, Norbert
2007-04-07 14:16 ` Bart De Schuymer
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.