On Sat, Oct 24, 2015 at 06:12:44AM -0400, Ted Unangst wrote:
> Reyk Floeter wrote:
> > Hi,
> > 
> > as requested by Theo and discussed with many, the following diff moves
> > it into a new driver.  This also allowed to improve the logic of link
> > states related to the connection (as discussed with Claudio).
> > 
> > The new driver is called pair(4).
> > 
> >     # ifconfig pair1 rdomain 1 10.1.1.1/24 up
> >     # ifconfig pair2 rdomain 2 10.1.1.2/24 up
> >     # ifconfig pair1 patch pair2
> >     # route -T 1 exec ping 10.1.1.2
> >     # ifconfig pair1 -patch
> > 
> > manpages and documentation can be improved, but I'd like to continue
> > in the tree if there are no other serious concerns.
> 
> We are doing this because we don't want a bridge of vethers? ok, but what if I
> want to connect three rdomains together? I can put any number of vethers into
> a bridge, but pair would seem limited to exactly two interfaces.

vether doesn't help as it is not transmitting any traffic.

in other words,
        "vether is a bridge endpoint"
        "pair is a bridge link"

As with vether, you can add pairs to a bridge.  For example, add all
"rdomain 0" pairs to a central bridge (eg. for the common uplink), add
connect them with pairs in different rdomains.  This way, bridge0
becomes your "core switch".

Let's assume pair1-4 are all in rdomain 0:

# ifconfig bridge0 add pair1 add pair2 add pair3 add em0 up

And pair10,20,30 are in rdomain 1,2,3:

# ifconfig pair1 patch pair10
# ifconfig pair2 patch pair20
# ifconfig pair3 patch pair30

Now you can use rdomain 0 as an routing uplink from each rdomain as
well, assuming pair1 is 10.10.0.1 and pair10 in rdomain 1 is
10.10.0.10:

# route -T 1 add default 10.10.0.1

And, you can put the other pairs in bridges as well, to create
"distribution switches".  And pf will deal with is just fine.

btw., besides the patch, the main intentional difference between
vether(4) and pair(4) is the fact that pair(4)'s link state is down
until it is connected with another pair(4).  vether(4) is always up.
So you cannot use stand-alone pair(4) like vether(4).  I'm going to
document this in the manpage, but hodling it off until it is in the
tree.

Reyk

Reply via email to