From owner-freebsd-doc@FreeBSD.ORG Thu Aug 30 20:39:20 2007 Return-Path: Delivered-To: doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A635716A418 for ; Thu, 30 Aug 2007 20:39:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from heff.fud.org.nz (203-109-251-39.static.bliink.ihug.co.nz [203.109.251.39]) by mx1.freebsd.org (Postfix) with ESMTP id 92C9D13C428 for ; Thu, 30 Aug 2007 20:39:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: by heff.fud.org.nz (Postfix, from userid 1001) id B61541CC58; Fri, 31 Aug 2007 08:24:37 +1200 (NZST) Date: Fri, 31 Aug 2007 08:24:37 +1200 From: Andrew Thompson To: doc@freebsd.org Message-ID: <20070830202437.GA4797@heff.fud.org.nz> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="AqsLC8rIMeq19msA" Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) Cc: Subject: New link aggregation chapter X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2007 20:39:20 -0000 --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I have put together a Handbook section on lagg(4) here http://nzfug.nz.freebsd.org/nzfug/HandbookUpdates/NetworkAggregation I have also attempted to do the markup in the attached patch. I would appreciate if someone would be able to fix up any mistakes I have made and commit this. cheers, Andrew --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="handbook_lagg.diff" Index: chapter.sgml =================================================================== RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml,v retrieving revision 1.399 diff -u -p -r1.399 chapter.sgml --- chapter.sgml 19 Aug 2007 18:33:27 -0000 1.399 +++ chapter.sgml 30 Aug 2007 20:23:15 -0000 @@ -2859,6 +2859,194 @@ BEGEMOT-BRIDGE-MIB::begemotBridgeDefault + + + + + Andrew + Thompson + Written by + + + + Link Aggregation and Failover + + lagg + failover + fec + lacp + loadbalance + roundrobin + + + Introduction + The &man.lagg.4; interface allows aggregation of multiple network + interfaces as one virtual interface for the purpose of providing + fault-tolerance and high-speed links. + + + + Operating Modes + + + failover + + Sends and receives traffic only through the master port. If the + master port becomes unavailable, the next active port is used. The + first interface added is the master port; any interfaces added after + that are used as failover devices. + + + + fec + + Supports Cisco EtherChannel. This is a static setup and does not + negotiate aggregation with the peer or exchange frames to monitor the + link, if the switch supports LACP then that should be used + instead. + + Balances outgoing traffic across the active ports based on hashed + protocol header information and accepts incoming traffic from any + active port. The hash includes the Ethernet source and destination + address, and, if available, the VLAN tag, and the IPv4/IPv6 source + and destination address. + + + + lacp + + Supports the IEEE 802.3ad Link Aggregation Control Protocol + (LACP) and the Marker Protocol. LACP will negotiate a set of + aggregable links with the peer in to one or more Link Aggregated + Groups. Each LAG is composed of ports of the same speed, set to + full-duplex operation. The traffic will be balanced across the ports + in the LAG with the greatest total speed, in most cases there will + only be one LAG which contains all ports. In the event of changes in + physical connectivity, Link Aggregation will quickly converge to a + new configuration. + + Balances outgoing traffic across the active ports based on hashed + protocol header information and accepts incoming traffic from any + active port. The hash includes the Ethernet source and destination + address, and, if available, the VLAN tag, and the IPv4/IPv6 source + and destination address. + + + + loadbalance + + This is an alias of fec mode. + + + + roundrobin + + Distributes outgoing traffic using a round-robin scheduler + through all active ports and accepts incoming traffic from any active + port. This mode will violate Ethernet frame ordering and should be + used with caution. + + + + + Examples + + + LACP aggregation with a Cisco switch + + This example connects two interfaces on a &os; machine to the + switch as a single load balanced and fault tolerant link. More interfaces + can be added to increase throughput and fault tolerance. Since frame + ordering is mandatory on Ethernet links then any traffic between two + stations always flows over the same physical link limiting the maximum + speed to that of one interface. The transmit algorithm attempts to use as + much information as it can to distinguish different traffic flows and + balance across the available interfaces. + + On the Cisco switch add the interfaces to the channel group. + + +interface FastEthernet0/1 + channel-group 1 mode active + channel-protocol lacp +! +interface FastEthernet0/2 + channel-group 1 mode active + channel-protocol lacp +! + + + On the &os; machine create the lagg interface. + + &prompt.root; ifconfig lagg0 create +&prompt.root; ifconfig lagg0 up laggproto lacp laggport fxp0 laggport fxp1 + + View the interface status from ifconfig, ports marked as + ACTIVE are part of the active aggregation group + that has been negotiated with the remote switch and traffic will be + transmitted and received. Use the verbose output of &man.ifconfig.8; + to view the LAG identifiers. + + +lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 + options=8<VLAN_MTU> + ether 00:05:5d:71:8d:b8 + media: Ethernet autoselect + status: active + laggproto lacp + laggport: fxp1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> + laggport: fxp0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> + + + The switch will show which ports are active, for more detail use + show lacp neighbor detail. + + +switch# show lacp neighbor +Flags: S - Device is requesting Slow LACPDUs + F - Device is requesting Fast LACPDUs + A - Device is in Active mode P - Device is in Passive mode + +Channel group 1 neighbors + +Partner's information: + + LACP port Oper Port Port +Port Flags Priority Dev ID Age Key Number State +Fa0/1 SA 32768 0005.5d71.8db8 29s 0x146 0x3 0x3D +Fa0/2 SA 32768 0005.5d71.8db8 29s 0x146 0x4 0x3D + + + + + Failover mode + + Failover mode can be used to switch over to another interface if + the link is lost on the master. + + &prompt.root; ifconfig lagg0 create +&prompt.root; ifconfig lagg0 up laggproto failover laggport fxp0 laggport fxp1 + + +lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 + options=8<VLAN_MTU> + ether 00:05:5d:71:8d:b8 + media: Ethernet autoselect + status: active + laggproto failover + laggport: fxp1 flags=0<> + laggport: fxp0 flags=5<MASTER,ACTIVE> + + + Traffic will be transmitted and received on + fxp0, if the link is lost on + fxp0 then fxp1 will + become the active link. If the link is restored on the master + interface then it will once again become the active link. + + + + --AqsLC8rIMeq19msA--