OpenBSD Journal

New Feature Alert: trunk(4)

Contributed by todd on from the redundant-redundancy dept.

First released in OpenBSD 3.8, trunk(4) is used to aggregate multiple network interfaces as one virtual trunk interface. In English, this means you take two network cards, plug them both into the same (or a different switch) and you continue functioning even if you unplug one. As released in 3.8, the trunk(4) interface implemented a simple roundrobin protocol.

New in -current, there is a failover protocol. This permits specifying one of the network cards as the master, and a secondary one to be used if the primary one is observed to be unplugged. One ingenious use of this new feature is for users who bridge their wireless network and wired networks. One may use a trunk interface to assign the IP address of a laptop. The trunk interface then in turn uses the ethernet interface of the laptop as master, and the wireless interface as the failover port. Unplugging the laptop to go sit in the breeze on the porch permits no connections to be reset, while returning to plugin the wired network permits a download from a local server to greatly increase in speed.

Servers will likely want round-robin which also permits to aggregate bandwidth. This means faster than 100mbit speeds with multiple 100mbit ethernet cards, for example.

With a `super redundant setup' of failover trunking, one can setup a system with 6 nics in each of two machines and several switches that result in a super resilient setup in which no one piece of equipment (including a switch) failing will permit loss of traffic.

(Comments are closed)


Comments
  1. By Anonymous Coward (85.194.198.91) on

    Ingenious? true, but has not this been in Linux a long time..

    Comments
    1. By Anonymous Coward (82.43.92.127) on

      I'll take every feature in OpenBSD that gets put in. Personally, I don't care if Linux has it or not, I still ain't using Linux.

    2. By Marco Peereboom (67.64.89.177) marco@peereboom.us on http://www.peereboom.us

      Yeah it is! in a .o file.

      Open source, who needs it?

      Comments
      1. Comments
        1. By Marco Peereboom (67.64.89.177) marco@peereboom.us on http://www.peereboom.us/

          Nice try! If you want something that actually works you need the intel closed source crap. Besides GPL is nearly as bad as a .o.

          Please take your linux tripe elsewhere. We don't care.

        2. By Anonymous Coward (70.27.15.123) on

          Sure. But the remark was about trunking wireless and wired interfaces together. Most wireless drivers are binary only on linux.

    3. By Anonymous Coward (69.70.207.240) on

      I don't know much about Linux anymore (don't care to to be honest) but so what if it's in other OS's (Windows, Linux kernel, Solaris, etc. etc.), this is in OpenBSD and as always gives OpenBSD much greater potential than the previous release(s).

    4. By Shane J Pearson (202.45.125.5) on

      Ingenious? true, but has not this been in Linux a long time..

      Many people who appreciate OpenBSD, appreciate that much thought goes into features well before they are implemented. So that the implementation is done properly. A nice new feature is added to OpenBSD and then some guy has to come in and say "doesn't Linux already do this?". Many people here will be thinking, "who cares", since they have come to appreciate the cleanliness and correctness which OpenBSD strives for.

      I know personally for myself and I would imagine others would also feel, that this appreciation is all the stronger because many would have come to OpenBSD from the quirky nature of Linux.

      I don't mind how long OpenBSD might take to get some feature, because I know when it gets it, it will be functional, secure and concise in both code and documentation.

    5. By Anonymous Coward (24.84.57.120) on

      And many features of Linux were already in Windows or Unix or Solaris or...

      What's your point?

    6. By Anonymous Coward (211.30.160.26) on

      "Ingenious? true, but has not this been in Linux a long time.."

      Take your Linux PR crap and shove it up a Windows user, they need it more.

      This is a OpenBSD place, we don't need your crap here. Nor do we care.


      I use all sorts of OSs, and I always use OpenBSD for firewalls and any other application where security is primary.

      This trunking feature seems interesting.

    7. By geek00L (60.50.204.156) on

      I wonder why there's always a guy who has no idea claiming something here. No one will bother what you have in your linux world, we are more care about what OpenBSD offers, no one will ever listen to you and it's waste of your stupid efforts here. And since you are anonymous coward, keep yourself coward, silence and don't speak like a coward. I use all sort of Operating Systems too, and I'm always happy if there's new feature implemented in the Operating System.

    8. By pete gilman (147.249.60.21) on


      "Ingenious? true, but has not this been in Linux a long time.. "

      maybe, but in openbsd it's:

      a) properly implemented

      b) truly free and open

      c) well-documented with a man page written by someone who speaks english properly

      hint: openbsd users aren't interested in who does it first, we're interested in who does it right.

      Comments
      1. By Anonymous Coward (193.110.152.115) on

        well-documented with a man page written by someone who speaks english properly

        Thanks for me (poor french people)....an for 90% of the world !

  2. By Matthias Kilian (84.134.44.220) on

    ... continue functioning even if you unplug one.

    I thought the proper way to disrupt a network connection were to cut the cable using an axe. At least there are rumours that certain OpenBSD developers tend to prefer this method ;-)

    Comments
    1. Comments
      1. By suspect (81.84.108.22) on

        oh god, the guy is crazy

      2. By Matthias Kilian (84.134.65.207) on

        Thanks (wth didn't I find those pictures myself?)

        Oh, and Wim: what about selling hardware network disruption tools with nice OpenBSD logos at booths next year?

  3. By Anonymous Coward (66.12.209.210) on

    Yeah, this is definitely a nice new feature.
    Here's how I have my laptop setup...
    
    $ cat /etc/hostname.trunk0
    !ifconfig trunk0 trunkproto failover 10.0.0.91 netmask 255.255.255.0
    
    $ cat /etc/hostname.gem0
    up
    !ifconfig trunk0 trunkport $if
    
    $ cat /etc/hostname.wi0
    up
    !ifconfig trunk0 trunkport $if
    
    $ cat /etc/hotplug/attach                                                       
    #!/bin/sh
    
    class=$1
    name=$2
    
    case $class in
    3)
            ifconfig $name up
            ifconfig trunk0 trunkport $name
            ;;
    esac
    

  4. By Chad Loder (216.239.134.34) on

    Has anyone benchmarked the performance of bandwidth aggregation?

    Comments
    1. By Anonymous Coward (24.84.57.120) on

      Something that would be interesting to me is the ability to have a VPN operate over multiple links. Typically you might have a cable modem and a DSL modem, each with separate IP addresses. So you'd need to have, if I understand correctly, two separate VPN tunnels setup. Can OpenBSD be setup so that a failure in one network seamlessly fails over to the other?

  5. By marklar (203.26.16.67) on

    Grr..

    Cisco uses:
    Etherchannel = multiple physical ports, Trunk = multiple vlans
    Everyone else:
    Trunk = multiple physical ports, ? = multiple vlans

    Comments
    1. By Booms (24.141.158.193) on

      Ah, yes... we all love Cisco's adherance to standards. I believe "link aggregation" is the vendor neutral term, and IIRC the standard is 802.1ad, but I don't see that mentioned in the man pages anywhere.

      Does anyone know if this new feature is standards compliant? How does traffic make it back to the OpenBSD box from the switch - is there a shared MAC on both interfaces? Is your speed inbound to the system limited by a single link, or will the switch balance traffic back to the box over both links as well?

      Lots of questions, but definitely a useful feature, and will be very handy for many applications.

      Comments
      1. By djm@ (203.217.30.86) on

        No, it doesn't yet support 802.3ad (LACP). It is a very overcomplex protocol to do quite a simple thing. -d

        Comments
        1. By Jason Wright (65.202.219.66) jason@thought.net on http://www.thought.net/jason/

          C'mon, we support 802.1d STP, what's so hard about 802.3ad? =)

    2. Comments
      1. By Anonymous Coward (67.64.89.177) on

        Yawn, not interesting.

      2. By Anonymous Coward (81.163.130.151) on

        bondage?

  6. By Jim (68.250.26.213) on

    Or am I asking too much. I'm not well versed in networking details so this could be a _really_ dumb question.

    Comments
    1. By corentin (88.136.45.3) on

      Yes; you can use a trunk interface as you would use any other type of network interface.

  7. By Anonymous Coward (219.109.232.83) on

    So does it support 802.3ad Trunking? Most modern switches sopport 802.3ad, so I hope the tun interface does/will.

    Comments
    1. By Anonymous Coward (219.109.232.83) on

      sorry I meant the 'trunk' interface

      Comments
      1. By Anonymous Coward (68.106.232.57) on

        Please read comment "djm@ (IP 203.217.30.86) on Sat Dec 24 06:08:20 2005 (GMT)" above.

  8. By Anonymous Coward (68.106.232.57) on

    I too am curious, what if any are the requirements for configuration on Ethernet switches (or hubs?) to support either mode of trunk(4)?

    Comments
    1. By Anonymous Coward (213.118.74.206) on

      Simple: they do not require any configuration at all.

      Comments
      1. By cameronsto (71.56.12.90) on www.5tokes.com

        For failover this is correct, but for bandwidth aggregation I believe the switch does need to support trunking.

        -cameron

  9. By Anonymous Coward (213.164.101.50) on

    trunk(4) says:

    ...
    The following example uses an active failover trunk to set up roaming between wired and wireless networks using two network devices. Whenever the wired master interface is unplugged, the wireless failover device will be used:

    # ifconfig em0 up
    # ifconfig ath0 192.168.1.1 netmask 255.255.255.0 nwid my_net
    # ifconfig trunk0 trunkproto failover trunkport em0 trunkport ath0 \
    > 192.168.1.1 netmask 255.255.255.0
    ...

    where it is indicated which one interface is the master? by the wording it seems to be em0, but OTOH may be it is ath0? or is it always the first interface given to the ifconfig? if so, it should be said explicitly, no? the man page for ifconfig is no help in this department also...

Latest Articles

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]