EtherChannel

EtherChannel allows a switch to treat multiple physical interfaces as a single logical interface. This allows two switches to be connected together by multiple interfaces and use all of the bandwidth available to all connected interfaces while still being able to use STP to prevent Layer 2 loops/broadcast storms.

Details

  • EtherChannel groups multiple interfaces together to act as a single interface
  • STP will treat this group as a single interface
  • Traffic on an EtherChannel is load balanced among the physical interfaces in the group. An algorithm is used to determine which traffic will use which physical interface.
  • Sometimes referred to as:
    • Port Channel
    • LAG (Link Aggregation Group)
  • There are also several keywords used to refer to EtherChannel in the CLI:
    • etherchannel, portchannel, and channel-group all appear on Cisco switches but refer to the same thing

Load-Balancing

  • EtherChannel load-balances based on ‘flows’
  • A flow is a communication between two nodes in the network
  • There is an algorithm to determine which particular physical interface a flow should be transmitted on
    • Frames in the same flow will be forwarded using the same physical interface
    • If frames in the same flow were forwarded using different physical interfaces, some frames may arrive at the destination out of order, which can cause problems
    • This algorithm takes a number of inputs. You can change which inputs are used to select interfaces. What inputs are available depends on switch model. Some common inputs are:
      • Source MAC
      • Destination MAC
      • Source & Destination MAC
      • Source IP
      • Destination IP
      • Source & Destination IP
      • TCP or UDP port numbers- Layer 4 - only some switches support this
  • show etherchannel load-balance - shows the current load-balancing configuration
  • port-channel load-balance (balance method) - sets the load balancing method
    • possible values (Cisco):
      • dst-ip
      • dst-mac
      • src-dst-ip
      • src-dst-mac
      • src-ip
      • src-mac
  • note thatetherchannel and portchannel are both used to refer to the same thing in different commands…
    • Confused? Don’t worry. There’s another one coming.

Configuration

  • There are three methods of EtherChannel configuration on Cisco switches;
    • PAgP (Port Aggregation Protocol)
      • Cisco proprietary protocol
      • Dynamically negotiates the creation/maintenance of the EtherChannel (similar to DTP for making trunk ports)
    • LACP (Link Aggregation Control Protocol)
      • Industry standard protocol (IEEE 802.3ad)
      • Dynamically negotiates the creation/maintenance of the EtherChannel (similar to DTP for making trunk ports)
      • PAgP and LACP are roughly analogous
      • Since LACP is not proprietary, it can be used to negotiate EtherChannels with switches from vendors other than Cisco. Because of this, LACP is generally preferred to PAgP.
    • Static EtherChannel
      • No protocol is used to determine if an EtherChannel should be formed
      • Interfaces are manually, statically configured to form an EtherChannel.
        • Usually avoided; not only is it annoying but the switches will not be able to dynamically detect and correct issues with the EtherChannel (e.g. if an interface fails it will not be automatically removed from the EtherChannel)
  • Up to 8 interfaces can be formed into a single channel (LACP allows up to 16, but only 8 will be active at any time; the remaining channels will be in standby waiting for an active interface to fail)
  • When selecting interfaces it is a good idea to use interface range to select all member interfaces at once, as their EtherChannel configurations must match
    • Same duplex (full/half)
    • Same speed
    • Same switchport mode (access/trunk)
    • Same allowed VLANs/native VLAN (for trunk interfaces)
  • If an interface’s configurations do not match the others, it will be excluded from the EtherChannel
  • Member interfaces don’t need to be consecutive port IDs (e.g. g0/1, g0/2, g0/3, etc.) but they probably should be for the sake of being organized
  • The basic interface configuration command ischannel-group (virtual-interface-number) mode (protocol-mode)
    • The different modes will be covered in protocol-specific sections below
    • The virtual-interface-number must match for all interfaces on the switch, but does not need to match the number used for the interfaces on the other switch
  • You can use the channel-protocol (protocol) command to explicitly define whether the interface(s) operate in PAgP (pagp) or LACP (lacp) mode.
    • Mostly useless as configuring an EtherChannel mode will automatically select the correct protocol
    • If you define a protocol with this command then try to select a mode with a different protocol you will get a protocol mismatch error.
  • Use show etherchannel summary to view info about the EtherChannel

PAgP Configuration

  • Two modes: auto and desirable [^I suspect that Cisco may have reused some of their code from DTP for this…]
    • Desirable:
      • channel-group (virtual-interface-number) mode desirable
      • Will actively try to form a PAgP EtherChannel if the other switch is able/supports PAgP
    • Auto:
      • channel-group (virtual-interface-number) mode auto
      • Will only form an EtherChannel if the other switch actively tries to (is in desirable mode)
  • The modes work in much the same way as DTP, except with EtherChannel instead of trunking
  • A new “Port-channel” interface will be created and appear in the show ip interface brief command
Mode TableAutoDesirable
AutoNo EtherChannelEtherChannel
DesirableEtherChannelEtherChannel

LACP Configuration

  • Nearly identical to PAgP, except the modes are called active and passive
    • Active:
      • channel-group (virtual-interface-number) mode active
      • Will actively try to form a LACP EtherChannel if the other switch is able/supports LACP
    • Passive:
      • channel-group (virtual-interface-number) mode passive
      • Will only form an EtherChannel if the other switch actively tries to (is in active mode)
  • A new “Port-channel” interface will be created and appear in the show ip interface brief command
Mode TablePassiveActive
PassiveNo EtherChannelEtherChannel
ActiveEtherChannelEtherChannel

Static Configuration

  • Only one mode: On
    • channel-group (virtual-interface-number) mode on
    • Manually tells the interface to form an EtherChannel
    • Only works if the other switch’s interfaces are also set to ‘On’ mode (on + desirable or on + active will not work!)

Configuring the Virtual Interface

  • You can configure the virtual Port-interface created by the EtherChannel much like a normal physical interface
  • Select the virtual interface with interface (interface-id) just like you would with a regular interface
    • the interface ID will probably be something like port-channel 1
  • You can configure the interface as a trunk
    • doing so will also configure all the member physical interfaces as trunks

Layer 3 EtherChannel

  • Using multilayer switches. Layer 3 may be desirable as it almost entirely eliminates the need for STP; Routed ports do not forward Layer 2 broadcasts.
  • Example commands:
    • int range (interface-ids)
    • no switchport //makes them routed (Layer 3) interfaces
    • channel-group 1 mode (mode) //you can use any number, not just 1, but keep things organized
    • int port-channel 1
    • ip address 10.0.0.1 255.255.255.252 //use whatever IP/Netmask are appropriate for your network
  • If all member interfaces are configured as routed/Layer 3 the Virtual EtherChannel interface will automatically be routed
  • The IP For the virtual interface should be configured on the virtual interface, not on the member interfaces

Notes, Definitions, Etc.

Oversubscription

When the bandwidth of the interfaces connected to end hosts is greater than the bandwidth of the connection to the distribution switch(es). Some is generally acceptable, assuming not all hosts are sending/receiving data at all times, but too much will cause congestion.