Bridge design issues



I've been playing with the bridging code, and
something doesn't seem quite right about it. It seems
to work better and more efficiently when configured
the "wrong" way, according to the handbook.

The "correct" way would be a settup as follows:

bridge0 1.2.3.4 netmask 255.255.255.0 addm em0 addm
em1 up

where the bridge has the address and em0 and em1 are
members of the bridge. However this results in some
ugliness:

The path for traffic originating from the system
itself goes through the standard ethernet output
machinery and gets queued twice:

ip_output(bridge0) -> ether_output(bridge0) -> queued
on bridge0 :: bridge_start() ->bridge_enqueue(em0/em1)

bridge_output() is never used in this setup:

When the following "wrong" setup is used:

ifconfig em0 1.2.3.4 netmask 255.255.255.0
ifconfig bridge0 addm em0 addm em1 up

Where em0 has the address. This results in 2 desirable
things: 1) a real ethernet is used in packets, and 2)
the path is streamlined:

ip_output(bridge0) -> ether_output(bridge0) ->
bridge_output(bridge0) -> bridge_enqueue(em0/em1)


In my view, it should work the same no matter what the
setup, if done correctly. Any output sent to a bridge
should be passed through the same bridge output
machinery. So

ether_output(em0|em1|bridge0) should all resolve to
bridge_output(bridge0) and let the bridge determine
the proper path.

The reason the FreeBSD code doesn't work this way is
that the bridge interface doesn't point to itself.
Setting if_bridge in the bridge interface structure to
point to itself seems to normalized the path.
bridge_output() needs to be made aware that it may be
passed a bridge interface to make sure it resolves the
route before trying to send the packet.
bridge_forward() should also use bridge_output()
rather than resolving itself. The bridge resolution is
always the same logic; its undesirable to have
different paths for every case. Arguably, packets that
arrive from the local stack are no different from ones
that arrive via a bridge member in terms of output
resolution.

There should also be a way to assign a static ethernet
address to a bridge interface so its always the same.
ISPs in many countries are required to keep track of
devices so random ethernets are problematic idea for
them

Barney



____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • if_bridge/if_em packet corruption on last bridged em interface in SPAN mode
    ... We needed to replicate a gigabit SPAN port on a Cisco switch, and, due to the fact that gigabit Ethernet hubs don't seem to exist and that other devices that perform a similar function are costly, I've built my own in the form of a FreeBSD 7.0-RELEASE/amd64 machine. ... If I remove em0 from the bridge, the corruption begins to occur with em1, and so forth--it always happens with the last interface on the bridge. ... vendor = 'ATI Technologies Inc' ... subclass = HOST-PCI ...
    (freebsd-net)
  • Problem with OpenVPN and ethernet bridging
    ... I'm trying to get my feet wet with an ethernet bridging setup ... NIC of the dl360 server. ... I am not assigning IPs to the server's tap and bridge interfaces, ... I am creating the tap and bridge interfaces manually. ...
    (freebsd-questions)
  • Re: Windows XP Networking Problems - Solution
    ... >>>I wonder if the software router apparently included with the PA301 is the ... >>>My suggestion would be, as I repeat over and over, to use an Ethernet ... You wouldn't have to replace or bridge both ... >you'll need an Ethernet to HPNA bridge on the router end. ...
    (microsoft.public.windowsxp.network_web)
  • Re: Bridge building
    ... >> feature of XP that allows one to group network interfaces to create ... Partly because I'll soon have need of a wireless bridge ... >> So, with three ethernet NICs, a 54g wireless card, and a firewire ... Incidentally the 1394 adapters are using the ...
    (microsoft.public.windowsxp.network_web)
  • Re: How to connect PC to LaserWriter 360?
    ... Should I try to find a LocalTalk-to-Ethernet bridge cable? ... to ethernet bridge will just give you localtalk over ethernet. ... TCP/IP nor Windows printer sharing. ...
    (comp.periphs.printers)