VLAN Tagging and Double Tagging - 7.2 English

AXI 1G/2.5G Ethernet Subsystem Product Guide (PG138)

Document ID
PG138
Release Date
2023-11-15
Version
7.2 English

VLAN tagging, also referred to as stacking, allows the TEMAC core to insert a predefined VLAN tag in select Ethernet frames as they pass through in either the transmit or receive direction.

Figure 1. VLAN Tagging AXI Ethernet Page-1 Sheet.2 Sheet.3 Sheet.4 Sheet.5 Sheet.6 Sheet.7 Sheet.8 Sheet.9 Sheet.10 Sheet.11 Sheet.12 Sheet.13 Sheet.14 Sheet.15 Sheet.16 Sheet.17 Sheet.18 Sheet.19 Sheet.20 Sheet.21 Sheet.22 Sheet.23 Sheet.24 Sheet.25 Sheet.26 Sheet.27 Sheet.28 Sheet.29 Sheet.30 Sheet.31 Sheet.32 Sheet.33 Sheet.34 6 bytes 6bytes Sheet.35 Type /Len Type/Len Sheet.36 FCS FCS Sheet.37 Data Data Sheet.38 46 - 1500 bytes normal 46 - 9198 bytes jumbo 46 - 1500 bytes normal 46 - 9198 bytes jumbo Sheet.39 Dest Addr DestAddr Sheet.40 SrceAddr SrceAddr Sheet.41 6 bytes 6bytes Sheet.42 2 bytes 2bytes Sheet.43 4 bytes 4bytes Sheet.44 Type /Len Type/Len Sheet.45 FCS FCS Sheet.46 Data Data Sheet.47 Dest Addr DestAddr Sheet.48 SrceAddr SrceAddr Sheet.49 4 bytes 4bytes Sheet.50 VLAN Tag VLANTag Sheet.51 Type /Len Type/Len Sheet.52 FCS FCS Sheet.53 Data Data Sheet.54 Dest Addr DestAddr Sheet.55 SrceAddr SrceAddr Sheet.56 VLAN Tag VLANTag Sheet.57 Type /Len Type/Len Sheet.58 FCS FCS Sheet.59 Data Data Sheet.60 Dest Addr DestAddr Sheet.61 SrceAddr SrceAddr Sheet.62 VLAN Tag VLANTag Sheet.63 VLAN Tag VLANTag Standard Arrow Standard Arrow.64 Sheet.65 Sheet.67 Sheet.68 Standard Arrow.69 Standard Arrow.70 Sheet.71 Sheet.72 Standard Arrow.73 Standard Arrow.74 Sheet.75 Sheet.76 Sheet.77 4 bytes 4bytes Sheet.78 Sheet.79 Sheet.66 X14090 X14090

One VLAN tag is added depending on the mode of operation:

  • Non-VLAN frames get one VLAN tag added to become single VLAN tagged frames.
  • VLAN tagged frames receive an extra VLAN tag and no checking is performed to see how many VLAN tags the frame already has (if there were three tags, it now has four).

Therefore, in cases that require adding a VLAN tag, one VLAN tag is added to the existing frame.

The TEMAC core basic VLAN mode extends the maximum normal frame size validation by 4 bytes. This mode does not extend to multiple VLAN tagging. Multiple VLAN frames that exceed 1,522 bytes are discarded as being too long. As mentioned previously, this requires the use of jumbo frame mode which eliminates the automatic invalidation of frames that normally would be too large for normal frame sizes.

When VLAN tagging is enabled at build time with the appropriate parameter, a field in the Reset and Address Filter Register is used to select one of four VLAN tagging modes and the Transmit VLAN Tag Register and Receive VLAN Tag Register is used to hold the VLAN tag value that is inserted. The four VLAN tagging modes which are selectable at runtime are:

  • Do not add tags to any frames.
  • Add one tag to all frames.
  • Add one tag only to frames that are already VLAN tagged.
  • Add one tag only to select frames that are already VLAN tagged based on VID value.

The fourth mode requires a method for specifying which tagged frames should receive an additional VLAN tag. TheTEMAC Receive Configuration Word 0 Register and Receive VLAN Data Table are used for this purpose. A value of 1 in the tag enable field for a TPID value indicates that frame should receive an additional tag. Again, transmit In-Band FCS mode is not allowed and receive FCS stripping is required when using VLAN tagging because the FCS field value is not correct for the frame with the additional VLAN tag. Although receive stripping is enabled, any padding, if present, is not stripped because the TYPE/LENGTH field of the receive frame contains a VLAN tag rather than a length value. However, the length field is still present.