LACP kasutamine
Sisukord
Sissejuhatus
Ethernet interface bonding tehnika võimaldab teatud tingimustel kasutada mitut arvutisse paigaldatud füüsilist võrguseadet ühe loogilise seadmena.
TODO - Alljärgnev tõlkida ära.
The reason you dont get a throughput greater than 943Mbps is due to the way that link aggregation (LACP) works.
When you aggregate two links using LACP eg. 2 x 1G you dont get a 1 x 2G link; you get one link of 2 x 1G. This means that a connection between two hosts can never use more than 1G, but if you have two connections you might be able to use 2 x 1G; if they choose to use different links in the LACP link (this is based on some calculation using eg. IP address, mac address etc.). In other words, a connection between two hosts, can never use more bandwidth than the original links bandwidth.
It's just not possible to make 1 x 2 Gbps link using 2 x 1 Gbps links using LACP. The reason is, that when a host sends data using a LACP link, it determines which interface (link) to use by calculating a hash value based on a combination of L2 and L3 information. So if you have two hosts you will get the same hash value each time since the source/destination mac/IP addresses don't change, and the sending host will send data using only one (the same) link/interface. If the sending host is sending data to two different hosts, you might be lucky, that the hash value for the two receiving hosts matches each of the links on the sending hosts, thereby sending data on both links/interfaces.
Tööpõhimõte
TODO
SLM2008 lüliti
TODO
Debian GNU/Linux
Tarkvara paigaldamine
Vajalik tarkvara sisaldub operatsioonisüsteemi tuumas, juhtprogrammi ifenslave paigaldamiseks sobib öelda
# apt-get install ifenslave-2.6
Seadistamine
Bonding seadme nimeks on tavaliselt bond0 ning LACP bonding (mitte segi ajada failover-bond seadmega) seadistatakse /etc/network/interfaces sektsiooniga
auto bond0 iface bond0 inet static address 10.0.3.87 netmask 255.255.255.0 slaves eth1 eth2 bond_mode 802.3ad bond_miimon 100 bond-lacp-rate 4
Erinevate olekute tähendused
- Round Robin - Packets are transmitted in a round robin fashion over the available slave interfaces. Provides both load balancing and fault tolerance
- Active Backup - One slave interface is active at any time. If one interface fails, another interface takes over the MAC address and becomes the active interface. Provides fault tolerance only. Doesn't require special switch support
- Balance XOR - Tranmissions are balanced across the slave interfaces based on ((source MAC) XOR (dest MAC)) modula slave count. The same slave is selected for each destination MAC. Provides load balancing and fault tolerance.
- Broadcast - Transmits everything on all slave interfaces. Provides fault tolerance.
- 802.3ad - This is classic IEEE 802.3ad Dynamic link aggregation. This requires 802.3ad support in the switch and driver support for retrieving the speed and duplex of each slave.
- Balance TLB - Adaptive Transmit Load Balancing. Incoming traffic is received on the active slave only, outgoing traffic is distributed according to the current load on each slave. Doesn't require special switch support
- Balance ALB - Adaptive Load Balancing - provides both transmit load balancing (TLB) and receive load balancing for IPv4 via ARP negotiation. Doesn't require special switch support, but does require the ability to change the MAC address of a device while it is open
Vaikimisi on balance-rr (round robin) ehk 0.
Vastav seadistamine käsurealt võiks toimuda nt selliselt
# modprobe bonding mode=802.3ad lacp_rate=1 miimon=100 xmit_hash_policy=layer3+4 # ifconfig bond0 10.0.3.87 netmask 255.255.0.0 # ifenslave bond0 eth1 eth2
Bonding seadme eemaldamiseks sobib öelda
# ifenslave -d bond0 eth1 eth2 # rmmod bonding
Bonding seadme omadusi saab vaadata
# cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.2.5 (March 21, 2008) Bonding Mode: IEEE 802.3ad Dynamic link aggregation Transmit Hash Policy: layer3+4 (1) MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 802.3ad info LACP rate: fast Active Aggregator Info: Aggregator ID: 1 Number of ports: 2 Actor Key: 17 Partner Key: 3 Partner Mac Address: a8:b1:d4:95:a3:85 Slave Interface: eth1 MII Status: up Link Failure Count: 0 Permanent HW addr: 00:0e:0c:ba:4b:3e Aggregator ID: 1 Slave Interface: eth2 MII Status: up Link Failure Count: 4 Permanent HW addr: 00:1b:21:1d:f6:06 Aggregator ID: 1
kus
- Bonding Mode: IEEE 802.3ad Dynamic link aggregation - kasutusel olev bonding režiim
Kasutamine
TODO
OpenBSD
LACP seadme moodustamiseks sobib öelda nt
# ifconfig trunk0 trunkport re1 trunkport re2 trunkproto lacp
Seadme omaduste esitamiseks
# ifconfig trunk0 trunk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:0c:42:07:1a:45 priority: 0 trunk: trunkproto lacp trunk id: [(8000,00:0c:42:07:1a:45,40E4,0000,0000), (8000,a8:b1:d4:95:a3:85,0003,0000,0000)] trunkport re2 active,collecting,distributing trunkport re1 active,collecting,distributing groups: trunk media: Ethernet autoselect status: active inet6 fe80::20c:42ff:fe07:1a45%trunk0 prefixlen 64 scopeid 0x1c inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
kus
- trunk id järel on esitatud komponentide mac aadressid
- tundub, et mõlema komponendi olemasolul reeglina ühendusega seotud väljuvad paketid liiguvad läbi ühe seadme ja sisenevad läbi teise
FreeBSD
vaja seadistada rc.confi
ifconfig_em0="up" ifconfig_em1="up" cloned_interfaces="lagg0" ifconfig_lagg0="laggproto lacp laggport em0 laggport em1" ipv4_addrs_lagg0="192.168.1.3/24"
Ning ifconfig peaks seejärel teatama
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC> ether 00:22:19:1d:7b:a8 media: Ethernet autoselect (1000baseT <full-duplex>) status: active em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC> ether 00:22:19:1d:7b:a8 media: Ethernet autoselect (1000baseT <full-duplex>) status: active lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC> ether 00:22:19:1d:7b:a8 inet 192.168.1.3 netmask 0xfffffc00 broadcast 192.168.3.255 media: Ethernet autoselect status: active laggproto lacp laggport: em1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> laggport: em0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
- Ametlik FreeBSD manual http://www.freebsd.org/doc/handbook/network-aggregation.html
Märkused
- Tundub, et bondinguks ettevalmistatud switchi kaudu arvutit ei õnnestu üle PXE alglaadida.
Kasulikud lisamaterjalid
- L2 redundantsus
- http://www.howtoforge.com/nic-bonding-on-debian-lenny
- http://www.wiki.cl.cam.ac.uk/rowiki/SysInfo/LinksysSwitch
- http://www.kernel.org/doc/Documentation/networking/bonding.txt
http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding