Part 4 of this series already briefly mentioned MAC learning modes. This post goes deeper into what’s behind the ARL table (Address Resolution / Learning Table) and the two learning modes that IEEE 802.1Q — and with it, AUTOSAR — precisely define.

The start-up learning phase

After assembly and initial commissioning of a network, per the SWS the switch goes through several sequential learning phases (MAC learning and IP address assignment) before the learned parameters are persistently stored, so they’re immediately available on future starts. Per the SWS, a typical trigger for this auto-configuration process is a diagnostic request over the bus or a broadcast message on the Ethernet network.

Initial commissioning
     │
     ▼
MAC learning phase (optional)          ── messages flow through the
     │                                     network, switch learns new
     │                                     MAC addresses
     ▼
IP address assignment
     │
     ▼
Persistent storage of learned
parameters (NVM)                       ── immediately available from
                                           the next start onward

SVL and IVL — the two learning modes per IEEE 802.1Q

ModeHow it works

SVL (Shared VLAN Learning)

The switch considers source MAC address and ingress port to create an ARL table entry — the VLAN ID plays no role in the assignment

IVL (Independent VLAN Learning)

The switch additionally considers the VLAN ID of the received frame — the same MAC address can thus be assigned to different ports depending on which VLAN it appears in

Choosing between SVL and IVL isn’t a matter of taste — it depends on the network topology: SVL is suitable when it’s guaranteed that a source MAC address appears exclusively at one switch port. Otherwise — e.g. when the same MAC address can be visible in multiple VLANs at different ports — IVL is mandatory to ensure an unambiguous assignment.

The mode is controlled via EthSwtMacAddressLearningMode (SVL/IVL); the learning phase additionally has to be activated via EthSwt_SetMacLearningMode (see Part 4 of this series).

Static vs. dynamic entries

Predefined MAC addresses (e.g. multicast addresses fixed at vehicle network design time) exist independently of the learning mode. The SWS explicitly distinguishes:

  • Under SVL, predefined MAC addresses are configured without a VLAN membership relation

  • Under IVL, predefined MAC addresses require a VLAN membership relation

Reading the ARL table: the two-phase pattern

EthSwt_GetArlTable returns a list of structs (MAC address, VLAN ID, port) — using a clever two-phase pattern:

uint16 numberOfElements = 0;
EthSwt_GetArlTable(switchIdx, &numberOfElements, NULL_PTR);
// → numberOfElements now holds the number of valid entries,
//   without any data being copied

Eth_MacVlanType buffer[numberOfElements];
EthSwt_GetArlTable(switchIdx, &numberOfElements, buffer);
// → buffer is now filled with up to numberOfElements entries

If called with numberOfElements set to 0, per the SWS the function copies no data and just returns the number of currently available entries — arlTableListPointer may be NULL_PTR in that case. That lets you allocate exactly the right buffer size instead of working with an estimated maximum.

Case study: wrong learning mode causes frames to land at the wrong port

  1. Symptom: a device is reachable over multiple VLANs at different switch ports, but frames only get delivered to one port

  2. Read EthSwt_GetArlTable and check whether the entry for the affected MAC address only shows a single port per VLAN ID

  3. Check EthSwtMacAddressLearningMode — if the switch is set to SVL even though the device appears in multiple VLANs at different ports, that’s the cause

  4. Switch to IVL so MAC address and VLAN ID jointly determine the port

Summary

AspectKey takeaway

SVL

MAC address + ingress port, no VLAN consideration — suitable only for unambiguous port assignment

IVL

MAC address + VLAN ID + ingress port — necessary for ambiguous topologies

Reading out

EthSwt_GetArlTable with a two-phase pattern: query count first, then fill an exactly sized buffer

Static entries

Configuration differs by learning mode (with/without VLAN membership)