Realtek Layer 2 Protocols
The Realtek 0x8899 is a proprietary Ethertype used for remote control, loop detection, and CPU packet tagging. The protocol identification is a 4-bit or 8-bit value immediately after the 0x8899 value.
The known protocols are:
0x9: 4-byte Switch CPU tag version0x90xA: 4-byte Switch CPU tag version0xA0x01: Realtek Remote Control Protocol.[1]0x04: 8-byte Switch CPU tag version0x04
The information about these protocols is from confidential documents shared with developer partners, from Linux DSA tag implementation, or by reverse engineering.
Switch CPU tag version 0x9
The Realtek protocol 0x9 is a 4-byte Ethertype tag used for unmanaged switches.
| Offsets | Octet | 0 | 1 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 0 | 0 | Version 0x9
|
Priority | Disable MAC Learn | Reserved | RX/TX | |||||||||||
| 2 | 16 | EtherType | |||||||||||||||
- Disable MAC Learn: Disable learning of source MAC address
-
0x0: Learn source MAC address -
0x1: Don't learn source MAC address - TX/RX:
- TX to CPU: indicate the receive port number
- RX from CPU: indicate the forwarding port mask
Switch CPU tag version 0xA
The Realtek protocol 0xA is a 4-byte Ethertype tag used for unmanaged switches. There is no official documentation about this protocol, and even the Linux tag driver was written based on reverse engineering. This CPU tag is supported by Linux DSA since version 5.9[2].
| Offsets | Octet | 0 | 1 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 0 | 0 | Version0xA
|
Reserved | RX/TX | |||||||||||||
| 2 | 16 | EtherType | |||||||||||||||
- TX/RX:
- TX to CPU: indicate the receive port number
- RX from CPU: indicate the forwarding port mask
Switch CPU tag version 0x04
The Realtek protocol 0x04 is an 8-byte Ethertype tag used for unmanaged switches. This CPU tag is supported by Linux DSA since version 5.16[3]
| Offsets | Octet | 0 | 1 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 0 | 0 | Version 0x04
|
Reason | ||||||||||||||
| 2 | 16 | Enable EFID | Enhanced FID | Enable Priority | Priority | Keep VLAN | Enable Vlan | Disable MAC Learn | VIDx | ||||||||
| 4 | 32 | Allowance | RX/TX | ||||||||||||||
| 6 | 48 | EtherType | |||||||||||||||
- Reason:
-
0x00: packet was forwarded or flooded to CPU -
0x80: packet was trapped to CPU
-
- Enable EFID:
-
0x0: Don't force EFID -
0x1: Force EFID
-
- Enhanced FID, if "Enable EFID" is set
- Enable Priority:
-
0x0: Don't force priority -
0x1: Force priority
-
- Priority: if "Enable Priority" is set
- Keep VLAN: keep VLAN tag format
- Enable VLAN
-
0x0: Don't force VLAN -
0x1: Force VLAN
-
- Disable MAC Learn: Disable learning of source MAC address
-
0x0: Learn source MAC address -
0x1: Don't learn source MAC address - VIDx: index pointing to VLAN
- Allowance: Use TX/RX as allowance mask
-
0x0: no allowance port mask, TX/RX is the forwarding port mask -
0x1: use TX/RX as allowance port mask (don't forward to any port not set in TX/RX)
-
- TX/RX:
- TX to CPU: indicate the receive port number
- RX from CPU: indicate the forwarding (if "Allowance" is not set) or allowance port mask (if "Allowance" is set)
References
- ↑ "RTL8326 Datasheet" (PDF). Retrieved 6 January 2022.
- ↑ "net: dsa: tag_rtl4_a: Implement Realtek 4 byte A tag · torvalds/linux@efd7fe6". GitHub. Retrieved 2022-01-06.
- ↑ "net: dsa: tag_rtl8_4: add realtek 8 byte protocol 4 tag · torvalds/linux@1521d5a". GitHub. Retrieved 2022-01-06.
This article "Realtek Layer 2 Protocols" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Realtek Layer 2 Protocols. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.
