SONiC port channels and LACP explained: link aggregation from both ends of the cable

Lesson 5 of the SONiC course: a port channel toward a host that is already asking for one, the LACP negotiation read from the switch and from the host, the frames, and one member taken away while traffic runs, on Enterprise SONiC and on community SONiC.
Hand-drawn whiteboard: SONiC port channels, LACP from both ends, a leaf and a host joined by two links labelled PortChannel5

On this page

A host has two cables to the same switch, for the obvious reasons: more capacity, and it should not go offline because one cable was pulled. But two separate links between the same two devices are not twice the network. To a switch they are a loop, or two ports that lead to the same address. The two cables have to be presented as one link. That is link aggregation, and the protocol that negotiates it is LACP. This post builds a port channel on a SONiC switch toward a host that is already asking for one, reads the negotiation from both ends, looks at the frames, and takes one cable away while traffic is running. The switches run Enterprise SONiC 4.6.0; the same steps follow on community SONiC.

This is the written deep dive for lesson 5 of the SONiC course on the LevelUP I.T. YouTube channel. It runs on the lab built in lesson 1. Every output below is from the lab as the lesson recorded it.

What you'll find here

  • What link aggregation gives the rest of the switch: one interface, and a hash that picks a member per flow.
  • Why a bundle is negotiated: what LACP sends on every member, and the two things it protects against.
  • The host's bond before and after: a partner address of all zeros, then the switch's.
  • Building the port channel, and reading show interface PortChannel: actor and partner per member.
  • LACP frames captured on a member.
  • A VLAN and a gateway on the port channel; the records in CONFIG_DB; teamd.
  • One member shut down while a ping runs, and why packets are lost on a virtual cable.
  • The community SONiC command set for the same steps.

This post is for paying subscribers only

Subscribe to LevelUp I.T. newsletter and stay updated.

Don't miss anything. Get all the latest posts delivered straight to your inbox. It's free!
Great! Check your inbox and click the link to confirm your subscription.
Error! Please enter a valid email address!