
Recall first from Automotive Ethernet over a single pair
- A 1920 by 1080 stream at 30 frames per second and 8 bits per pixel needs about 498 Mbit/s before network overhead.
- A faster CAN FD data phase still leaves one shared bus with a limited application payload rate.
- 100BASE-T1 and 1000BASE-T1 use PAM3 over one twisted pair and provide full-duplex rates of 100 Mbit/s and 1 Gbit/s per direction, respectively.
How VLANs separate vehicle traffic
5 min readAutomotive Ethernet gives the bandwidth; this lesson answers how VLANs divide one switched network into isolated domains and how those networks are physically laid out.
An IPv4 host uses ARP broadcasts to resolve on-link addresses. In a vehicle integration test, an infotainment ECU looking up a local peer can therefore generate frames that reach control ECU ports if both belong to one Ethernet broadcast domain. VLAN filtering addresses this forwarding problem. The Linux bridge documentation describes the same mechanism in a software switch: with filtering enabled, forwarding uses the destination MAC address and VLAN together. A managed vehicle switch can enforce the same separation across physical ports.
A a logical Layer 2 forwarding domain defined by VLAN membership on switches and, where applicable, on endpoints determines where Ethernet frames can go. Use VLAN 10 for control and VLAN 20 for infotainment in the example below. These are design choices. A VLAN-aware switch learns where source MAC addresses are reachable within each VLAN. When it receives a broadcast in VLAN 20, it floods the frame only to eligible VLAN 20 ports, excluding the ingress port. A known unicast in VLAN 10 is forwarded toward its destination within VLAN 10. IP subnets help hosts decide where to send packets, while VLAN membership governs the switch's Layer 2 forwarding. Assigning different IP subnets to hosts on an unsegmented switch still leaves their Ethernet broadcasts in one domain.
IEEE 802.1Q defines the tag that lets a frame carry its VLAN identity. The tag sits after the source MAC address and before the original EtherType or length field. An ordinary 802.1Q customer tag uses the tag protocol identifier 0x8100. Its tag control information includes the VLAN ID, priority code point and drop eligible indicator. The VLAN ID is the field to inspect when checking whether a frame was classified into the intended domain. A higher priority value leaves the frame in the same domain.
An access port configured for untagged endpoint traffic assigns incoming untagged frames to its configured port VLAN ID, or PVID. In our example, the control ECU sends an untagged frame into an access port with PVID 10. If the destination is across a switch-to-switch link that carries VLAN 10 tagged, the first switch adds a tag on egress. The receiving switch reads the tag, associates the frame with VLAN 10 and sends it untagged if it exits another VLAN 10 access port. The two access links and the inter-switch link carry the same communication with different frame formats.
A a link configured to carry multiple VLANs, using tags to distinguish the VLANs carried tagged can carry VLAN 10 and VLAN 20 at the same time. Both ends need compatible VLAN membership and tagging settings. If one end omits VLAN 20 from its allowed membership, VLAN 10 can still work while infotainment fails across that link. When a trunk accepts untagged traffic, its ends also need compatible rules for classifying it. An untagged frame contains no VID for the receiver to check against the sender's intent.
IEEE 802.1ad provider bridging uses stacked VLAN tags, commonly called QinQ. The outer service tag, or S-tag, uses 0x88a8. The inner customer tag, or C-tag, commonly uses 0x8100. For example, a backbone configured for provider bridging can carry traffic from two separate local networks that both use inner VLAN 10. At ingress, it adds a different outer service VLAN ID for each local network. The backbone forwards those services separately using the outer tag. At the corresponding egress, removing the outer tag preserves the original inner VLAN identity for the local network. On an ordinary trunk carrying control VLAN 10 and infotainment VLAN 20, one tag on each frame is sufficient. QinQ adds another tag when a second level of VLAN identity needs to travel with the frame.
Traffic between the two domains requires an explicit forwarding function, such as an IP gateway with an interface in each VLAN and a policy for permitted traffic. For example, a gateway can expose an approved vehicle status service to infotainment while control broadcasts remain in the control VLAN. The VLAN tag carries a forwarding identifier. Authentication and encryption require separate mechanisms. The domains can also share a physical link, switch and power supply, so a failure or contention on shared resources can affect both.
How switch placement changes failure and diagnosis
3 min readPhysical topology describes the links devices are wired to. VLAN membership describes which domains those links carry. Start with the physical path between the producer and consumer, then check the VLAN configuration at every port along that path. Two ports on the same switch can be in different VLANs, while ports on opposite ends of the vehicle can belong to the same VLAN.
In a star, each branch has a separate point-to-point link to a central switch. On a test bench, connecting each ECU directly to that switch makes it easy to identify the cable and port serving each endpoint. Losing one ECU's link disconnects that branch. If the central switch loses power, all branches that depend on it lose their switched connectivity. In a vehicle, direct links back to a central location can require more switch ports there and longer cable runs from remote devices. A branch can also lead to a zone switch serving several endpoints, in which case losing that branch affects the devices that depend on it.
In a daisy-chain, switches connect in sequence. Consider a central switch linked to a front-zone switch, which is linked in turn to a rear-zone switch. A rear ECU's traffic to the central computer crosses both inter-switch links. The chain may suit a cable route where successive switches are close to one another. The central-facing link carries upstream traffic from both zones. If the link between the two zones opens, the rear zone loses its path to the central switch, while communication between rear devices on the same functioning switch can continue. If the front-zone switch loses power, rear traffic also loses its path through that switch. When you read a wiring drawing, trace which links and switches each flow needs and mark the endpoints affected by each failure.
A managed switch makes this design observable. You can configure per-port VLAN membership, PVID and tagged or untagged egress, then inspect link state and counters. A link that reports up confirms connectivity at the link level. Forwarding still depends on the VLAN settings. For a control ECU that can reach a local peer but misses a remote one, check the control VLAN on both ends of each inter-switch link before changing IP addresses.
a switch function that copies selected ingress traffic, egress traffic or both to a monitoring port gives a diagnostic laptop a view of frames exchanged by other devices. If the question is whether an ECU transmits an ARP request, mirror ingress on its access port. If the question is whether the switch sends that request across the inter-switch link with the intended VID, mirror trunk egress. Comparing those points helps distinguish a silent ECU from a forwarding or tagging problem. Check the switch's mirror behavior before interpreting tags. The copied frame can reflect the switch's capture point and mirror configuration. If the traffic being copied exceeds the monitor link's capacity, the capture can also miss frames while normal forwarding continues.
What a Linux capture can prove
5 min readUbuntu can model two endpoints on a shared tagged link with a virtual Ethernet pair. A veth pair delivers a frame sent on one end to its peer. Linux VLAN interfaces insert and receive frames for a configured VID on a parent device. The lab uses one parent at each end of the pair and creates both VLAN interfaces on each parent. There is no switch in this setup. You are testing tag insertion and receive-side VLAN demultiplexing. The access-port and mirror behavior described above belongs to a switch.
The left endpoint holds both VLAN interfaces. On the right, the control interface stays with its parent in namespace m12-ctl. The infotainment interface moves to a separate namespace, m12-info, while it still uses the same right-hand parent. That extra namespace gives the infotainment address its own network stack. A VLAN 10 ARP request then reaches a stack that does not own the VLAN 20 address. Run the lab in Ubuntu 24.04 with sudo. Use a VM if your WSL2 kernel cannot create one of the required device types.
Create the namespaces and bring up the parent interfaces. The names and addresses below are lab configuration inputs.
sudo ip netns add m12-left
sudo ip netns add m12-ctl
sudo ip netns add m12-info
sudo ip link add va type veth peer name vb
sudo ip link set va netns m12-left
sudo ip link set vb netns m12-ctl
sudo ip -n m12-left link set va up
sudo ip -n m12-ctl link set vb up
Create both VLAN interfaces on each parent. In ip link add, link gives the parent, name sets the new interface's name, and id selects the VID. The dot in names like va.10 is a naming convention. The id argument determines the actual tag.
sudo ip -n m12-left link add link va name va.10 type vlan id 10
sudo ip -n m12-left link add link va name va.20 type vlan id 20
sudo ip -n m12-ctl link add link vb name vb.10 type vlan id 10
sudo ip -n m12-ctl link add link vb name vb.20 type vlan id 20
sudo ip -n m12-ctl link set vb.20 netns m12-info
sudo ip -n m12-left addr add 192.0.2.1/24 dev va.10
sudo ip -n m12-ctl addr add 192.0.2.2/24 dev vb.10
sudo ip -n m12-left addr add 198.51.100.1/24 dev va.20
sudo ip -n m12-info addr add 198.51.100.2/24 dev vb.20
sudo ip -n m12-left link set va.10 up
sudo ip -n m12-left link set va.20 up
sudo ip -n m12-ctl link set vb.10 up
sudo ip -n m12-info link set vb.20 up
Open the captures in two terminals. -n keeps addresses numeric and -e prints link-layer information. These captures are on VLAN interfaces, so use the interface name to identify which domain received the traffic. For a tag inspection on the shared path, capture on vb in m12-ctl with tcpdump -n -e -i vb. Tag presentation can depend on where the capture occurs and how VLAN metadata is passed to the capture stack.
# Terminal 1
sudo ip netns exec m12-ctl tcpdump -n -e -i vb.10 'arp or icmp'
# Terminal 2
sudo ip netns exec m12-info tcpdump -n -e -i vb.20 'arp or icmp'
In a third terminal, establish a working baseline. Each ping should receive replies, and its traffic should appear on the matching right-hand interface. A fresh neighbor lookup generates ARP, while a repeated ping may reuse a cached mapping. Seeing ICMP on both captures during their respective tests also confirms that each capture is attached to an active interface.
sudo ip netns exec m12-left ping -I va.10 -c 2 -W 1 192.0.2.2
sudo ip netns exec m12-left ping -I va.20 -c 2 -W 1 198.51.100.2
A plain ping to 198.51.100.2 takes the working VLAN 20 route. To test what happens when the same destination is sought on VLAN 10, add a more specific on-link route for that one address via va.10. This forces neighbor discovery on VLAN 10. The expected result is an ARP request for 198.51.100.2 on vb.10, no corresponding request on vb.20, and no echo reply. Linux needs the destination MAC address before the IPv4 echo request can be sent directly. In a real run of these commands (Ubuntu 24.04 in a privileged container) the capture on vb.10 showed repeated lines of the form Request who-has 198.51.100.2 tell 192.0.2.1, one per second while the forced ping ran, the capture on vb.20 showed no request for that address in the same period, and the ping reported 100% packet loss. MAC addresses and timestamps on your machine will differ. A ping failure alone could have several causes. The ARP seen on the VLAN 10 receiver, together with the working VLAN 20 baseline and the absence of that request on VLAN 20, shows where this test stops.
sudo ip -n m12-left route add 198.51.100.2/32 dev va.10 scope link
sudo ip netns exec m12-left ping -I va.10 -c 2 -W 1 198.51.100.2
sudo ip -n m12-left route del 198.51.100.2/32 dev va.10
sudo ip netns exec m12-left ping -I va.20 -c 2 -W 1 198.51.100.2
Stop both captures with Ctrl+C, then delete the lab namespaces.
sudo ip netns del m12-info
sudo ip netns del m12-ctl
sudo ip netns del m12-left
Control and infotainment frames can follow distinct forwarding rules and still share the same outbound link. TSN and the determinism it guarantees asks what timing guarantees are possible on that shared path and which conditions must hold for them to apply.
Key takeaways
- VLAN membership determines where a switch can forward an Ethernet broadcast.
- A trunk can carry multiple VLANs on one link, and QinQ can preserve an inner VLAN tag under an outer service tag.
- A star endpoint link serves one branch, while a daisy-chain inter-switch link can serve several downstream devices.
- A forced on-link ping and captures on both receive VLAN interfaces can show where neighbor discovery stops.
Reflect
- Explain to a colleague, in two sentences: trace a frame from an untagged access port across a tagged trunk
- Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
- What surprised you when you ran the commands yourself?
On a real board
Repeat the key commands on your Raspberry Pi or lab board over SSH or the serial console. Note anything that behaves differently from your PC, such as missing tools, a BusyBox shell or a read-only filesystem.
References and further reading
- Kernel documentationLinux Ethernet bridge: VLAN filtering and forwarding
- Man pageip-link(8): virtual links and VLAN devices
- Man pageip-netns(8): named network namespaces
- Man pageveth(4): virtual Ethernet pairs
- Man pagetcpdump(8): capture and inspect network traffic
Official documentation first. Links checked when the lesson was published.