Sub topic 2
What a LAG or port channel is
This chapter defines a link aggregation group (LAG), shows how it appears to the rest of the network, and lists the rules that decide whether physical links can join one. It assumes you know Ethernet switching basics (MAC addresses, VLANs, trunks), why Spanning Tree Protocol exists, basic switch CLI navigation, and basic IP addressing with TCP/UDP ports. Hashing, LACP negotiation, and the full configuration come in later chapters. Here you build the working model.
The core idea: many wires, one logical interface
A link aggregation group (LAG) is a set of physical Ethernet links that a switch or host treats as a single logical link. The same idea goes by several names:
| Term | Where you see it |
|---|---|
| LAG | IEEE standards and many vendors |
| Port channel | Cisco IOS and many other switch CLIs |
| EtherChannel | Cisco's name for the technology |
| Bond or team | Linux (bonding) and Windows (NIC teaming) |
| Trunk | Some vendors, including HPE. Do not confuse this with a VLAN trunk. |
The standard is IEEE 802.1AX, which absorbed the older IEEE 802.3ad clause. Linux still uses the older name, as in mode 802.3ad.
The physical links are called member links (or member ports). The logical interface they form is the aggregate interface. On Cisco IOS it is Port-channel1. On Linux it is bond0.
The aggregate interface is a real interface in the configuration. You apply settings to it, such as trunk mode and allowed VLANs. Other protocols see it as one port. Spanning tree runs on it as one port, and the MAC table learns addresses against it as one port. A Layer 3 address can sit on it too.
What a LAG gives you
A LAG provides two things.
- More aggregate capacity. Three 1 Gbps members give a bundle with 3 Gbps of total capacity across many flows. This is not a single 3 Gbps pipe. See the next section.
- Redundancy. If one member fails, the remaining members carry the traffic. The logical interface stays up, so spanning tree sees no topology change and does not reconverge.
A LAG does not give you:
- A faster single connection. Each flow stays on one member link.
- Protection against failure of the whole device on either end. A normal LAG ends on one switch at each side. Multi-chassis designs address that and are covered in a later chapter.
Why one flow stays on one link
A switch must not reorder frames within a conversation. If it sent consecutive frames of one TCP stream over different members, they could arrive out of order, because the links have different queue depths. TCP would treat that as loss and slow down.
So the switch picks the member for each frame by hashing header fields. Every frame with the same field values gets the same hash and the same member. Different flows hash to different members, and that is how load spreads.
The consequence is simple. A single flow can never exceed the speed of one member. A file copy between two hosts over a 4 x 1 Gbps LAG tops out near 1 Gbps. Many flows from many hosts can fill the whole bundle, but only if the hash spreads them evenly. The next chapters cover how frames are distributed and how to choose the hash inputs.
The Python model below shows the principle. It is a simplified model, not what any switch ASIC actually computes.
import zlib
def pick_member(src_ip, dst_ip, src_port, dst_port, proto, n_links):
key = f"{src_ip}|{dst_ip}|{src_port}|{dst_port}|{proto}".encode()
return zlib.crc32(key) % n_links
# The same flow always maps to the same member link.
flow = ("10.0.0.5", "10.0.1.9", 50000, 443, "tcp")
print(pick_member(*flow, n_links=2) == pick_member(*flow, n_links=2))It prints True. If you change the source port, as a new TCP connection would, the result may differ.
How the rest of the network sees a LAG
Once bundled, the members stop acting as independent ports. Several behaviors follow.
- One logical port for switching. A MAC address learned on any member is recorded against the aggregate interface. A frame to that MAC may leave on any member, chosen by the hash.
- One spanning tree port. STP sees one port with one path cost. It does not block individual members, because it does not see them. That is the main reason to use a LAG instead of leaving parallel links to STP, which would block all but one.
- One configuration point. Trunk mode, allowed VLANs, and native VLAN belong on the aggregate interface. On Cisco IOS, the members inherit settings from the port channel.
- Frames are never duplicated or looped. Broadcast and unknown-unicast frames are sent on exactly one member. The receiving end does not forward them back into the bundle.
The last point is what makes a LAG loop-free. A broadcast leaving on one member arrives at the other switch on the matching member. That switch treats the aggregate as the ingress port, so it does not send the frame back out the same aggregate.
Conditions for joining a LAG
Both ends must agree on which links belong together. Members must also be compatible with each other. The usual requirements are:
- Same speed and same duplex on every member.
- Same switchport mode (access or trunk), same allowed VLANs, and same native VLAN.
- Same Layer 2 or Layer 3 role. You cannot mix a routed port and a switched port.
- All members on the same device, unless you use a multi-chassis design.
- No member used for something that conflicts with bundling, such as a SPAN destination.
The exact list and the failure symptoms get their own chapter. For now, remember the principle: the aggregate has one set of settings, so every member must be able to carry them.
Each member also needs a partner. Each member must connect to the same remote device, and the far side must bundle the same set of links. If Switch A bundles Gi0/1 and Gi0/2 but they land on two different neighbors, the result is unstable. Switches can see the same MAC address arrive from different places, and traffic can drop.
Three ways to form a bundle
The standard and vendors offer three ways to decide that links belong together.
| Mode | Protocol | Behavior |
|---|---|---|
| Static (unconditional) | None | The link is bundled because you configured it. No check that the other side agrees. |
| LACP | IEEE 802.1AX | Both sides exchange LACPDUs and bundle only links that match. |
| PAgP | Cisco proprietary | Similar to LACP, but only between Cisco devices. |
LACP is the default choice in mixed-vendor networks. It detects miscabling and mismatches before traffic is sent into a broken bundle. Static mode is simpler, but it has no such protection and can black-hole traffic if the far side differs. Later chapters compare them in detail. The sample configuration below uses LACP.
! Global: choose the hash inputs (available options vary by platform)
port-channel load-balance src-dst-ip
!
interface range GigabitEthernet0/1 - 2
switchport mode trunk
switchport trunk allowed vlan 10,20
channel-group 1 mode active
!
interface Port-channel1
switchport mode trunk
switchport trunk allowed vlan 10,20Reading this against the model above:
channel-group 1 mode activeputs both physical ports into group 1 and tells them to start LACP negotiation. IOS createsPort-channel1automatically.- The trunk settings appear on both the members and the port channel. They must agree. This is the "same settings" rule in practice.
port-channel load-balanceis a global setting. It affects how the whole switch picks members, not one bundle. On many platforms it applies to every port channel on that switch.
Common misconceptions
- "A 4 x 1 Gbps LAG is a 4 Gbps link." It has 4 Gbps of capacity in total, spread across flows. One flow is limited to 1 Gbps.
- "Traffic is split evenly." The hash only spreads flows, not bytes. A few large flows can overload one member while others sit idle.
- "I can mix a 1 Gbps and a 10 Gbps port." Most platforms refuse this. Where an implementation permits it, hashing still treats members as equals, which wastes the faster link.
- "The LAG protects me if a switch dies." A standard LAG ends on one device per side. Only a multi-chassis design tolerates a switch failure.
Summary of the model
- A LAG makes several physical links look like one logical interface.
- Settings live on the aggregate interface, and members must match.
- Capacity adds up across flows, but each flow uses one member.
- Failure of a member removes capacity but not the logical link.
- Bundling can be static or negotiated, with LACP as the standards-based option.
Exercise
A server connects to a switch with a 4 x 1 Gbps LAG. A backup job copies one large file over a single TCP connection to one destination host. Roughly what throughput can the job reach, and why? What would you change so that more of the bundle gets used?
Show answer
About 1 Gbps at most. The hash uses the same header fields for every frame in the connection, so all frames select the same member, and a member link carries 1 Gbps. To use more of the bundle, run several connections in parallel, such as multiple backup streams with different source ports, and use a hash that includes Layer 4 ports so the connections spread across members. Or move to faster member links.
Exercise
Switch A bundles Gi0/1 and Gi0/2 into Port-channel1. Gi0/1 is a trunk allowing VLANs 10 and 20. Gi0/2 is a trunk allowing only VLAN 10. What does the model in this chapter predict, and where should you correct it?
Show answer
The members do not have matching settings, and the aggregate has one set of settings. The switch is likely to refuse to bundle Gi0/2 or to suspend it. The correction is to configure the same allowed VLAN list on both members and on the Port-channel1 interface, and to make sure the far side matches.