* [Bridge] Setting the interfaces in promiscuous mode
@ 2004-09-16 16:28 Lionel Litty
2004-09-16 18:09 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Lionel Litty @ 2004-09-16 16:28 UTC (permalink / raw)
To: bridge
Hello,
I have been using the bridging facilities provided by Linux (vanilla
2.6.7 SMP with UML skas host patch applied) to bridge a regular
physical ethernet network (on interface eth0) with a virtual network
(on interface tap0, cf uml_switch,
http://user-mode-linux.sourceforge.net/networking.html). A couple of
virtual machines (run using user-mode linux, a tool that enables you
to run linux inside linux) are connected to the virtual network.
This is the script I use to set up the bridge:
brctl addbr br0
ifconfig eth0 0.0.0.0 promisc up
ifconfig tap0 0.0.0.0 promisc up
ifconfig br0 abc.def.ghi.jkl netmask 255.255.255.0 up
brctl stp br0 off #This is to ensure the bridge does not send spanning
tree protocol packets.
brctl setfd br0 1
brctl sethello br0 1
brctl addif br0 eth0
brctl addif br0 tap0
This worked fine. I then tried to set the two interfaces (eth0, tap0)
in non-promiscuous mode. My expectation was that the bridge would not
work anymore. Nevertheless, it kept working and my two networks were
still bridged. Virtual machines on the tap0 side of the bridge were
still able to communicate with physical machines on the eth0 side.
Moreover, network benchmarks showed that performance on the machine I
use as a bridge were better, which indicates that setting the
interfaces in non promiscuous mode had an influence on the behavior of
the network stack (which is not surprising).
I am puzzled by the fact that interfaces do not need to be in
promiscuous mode for the bridge to function properly. Anyone has an
idea why?
Thanks, Lionel.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bridge] Setting the interfaces in promiscuous mode
2004-09-16 16:28 [Bridge] Setting the interfaces in promiscuous mode Lionel Litty
@ 2004-09-16 18:09 ` Stephen Hemminger
2004-09-16 20:43 ` Lionel Litty
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2004-09-16 18:09 UTC (permalink / raw)
To: Lionel Litty; +Cc: bridge
On Thu, 16 Sep 2004 12:28:46 -0400
Lionel Litty <llitty@gmail.com> wrote:
> Hello,
>
> I have been using the bridging facilities provided by Linux (vanilla
> 2.6.7 SMP with UML skas host patch applied) to bridge a regular
> physical ethernet network (on interface eth0) with a virtual network
> (on interface tap0, cf uml_switch,
> http://user-mode-linux.sourceforge.net/networking.html). A couple of
> virtual machines (run using user-mode linux, a tool that enables you
> to run linux inside linux) are connected to the virtual network.
>
> This is the script I use to set up the bridge:
>
> brctl addbr br0
> ifconfig eth0 0.0.0.0 promisc up
> ifconfig tap0 0.0.0.0 promisc up
> ifconfig br0 abc.def.ghi.jkl netmask 255.255.255.0 up
> brctl stp br0 off #This is to ensure the bridge does not send spanning
> tree protocol packets.
> brctl setfd br0 1
> brctl sethello br0 1
> brctl addif br0 eth0
> brctl addif br0 tap0
>
> This worked fine. I then tried to set the two interfaces (eth0, tap0)
> in non-promiscuous mode. My expectation was that the bridge would not
> work anymore. Nevertheless, it kept working and my two networks were
> still bridged. Virtual machines on the tap0 side of the bridge were
> still able to communicate with physical machines on the eth0 side.
> Moreover, network benchmarks showed that performance on the machine I
> use as a bridge were better, which indicates that setting the
> interfaces in non promiscuous mode had an influence on the behavior of
> the network stack (which is not surprising).
>
> I am puzzled by the fact that interfaces do not need to be in
> promiscuous mode for the bridge to function properly. Anyone has an
> idea why?
promiscuous mode is tracked in the kernel with a counter, the kernel
won't change the actual hardware until the counter goes to zero. This is
why running something like tcpdump which changes interface to promiscuous mode
will have no effect on the bridge. How did you
force the interface out of non-promiscious mode? You may not changed anything.
Also promiscuous on tap means nothing really since there is no hardware
filtering.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bridge] Setting the interfaces in promiscuous mode
2004-09-16 18:09 ` Stephen Hemminger
@ 2004-09-16 20:43 ` Lionel Litty
2004-09-16 21:06 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Lionel Litty @ 2004-09-16 20:43 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: bridge
> promiscuous mode is tracked in the kernel with a counter, the kernel
> won't change the actual hardware until the counter goes to zero. This is
> why running something like tcpdump which changes interface to promiscuous mode
> will have no effect on the bridge. How did you
> force the interface out of non-promiscious mode? You may not changed anything.
>
I simply did "ifconfig eth0 -promisc" and "ifconfig tap0 -promisc".
"ifconfig" then no longer indicates that the interfaces are in
promiscuous mode. Are you saying that the output of ifconfig is not
reliable and that the interfaces may in fact still be in promiscuous
mode? This would make sense, but then how come the performance seems
to be affected by the change?
> Also promiscuous on tap means nothing really since there is no hardware
> filtering.
OK. I thought there might have been some software simulation of the
promiscuous mode.
Thanks, Lionel.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bridge] Setting the interfaces in promiscuous mode
2004-09-16 20:43 ` Lionel Litty
@ 2004-09-16 21:06 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2004-09-16 21:06 UTC (permalink / raw)
To: Lionel Litty; +Cc: bridge
On Thu, 16 Sep 2004 16:43:40 -0400
Lionel Litty <llitty@gmail.com> wrote:
> > promiscuous mode is tracked in the kernel with a counter, the kernel
> > won't change the actual hardware until the counter goes to zero. This is
> > why running something like tcpdump which changes interface to promiscuous mode
> > will have no effect on the bridge. How did you
> > force the interface out of non-promiscious mode? You may not changed anything.
> >
>
> I simply did "ifconfig eth0 -promisc" and "ifconfig tap0 -promisc".
> "ifconfig" then no longer indicates that the interfaces are in
> promiscuous mode. Are you saying that the output of ifconfig is not
> reliable and that the interfaces may in fact still be in promiscuous
> mode? This would make sense, but then how come the performance seems
> to be affected by the change?
Because when the stack thinks it is in promiscious mode then all the packets
have to be processed.
> > Also promiscuous on tap means nothing really since there is no hardware
> > filtering.
>
> OK. I thought there might have been some software simulation of the
> promiscuous mode.
>
> Thanks, Lionel.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-09-16 21:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-16 16:28 [Bridge] Setting the interfaces in promiscuous mode Lionel Litty
2004-09-16 18:09 ` Stephen Hemminger
2004-09-16 20:43 ` Lionel Litty
2004-09-16 21:06 ` Stephen Hemminger
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.