Now that you have a taste for some basic VLAN rewriting, let’s expand on the topic. Sometimes changing just the S-TAG of a frame isn’t enough. Service Providers provide Ethernet services to many customers, and each customer has their own unique set of requirements. When you need to go beyond doing a simple VLAN rewrite, you have to come back to the Service Provider-style configuration.
Service Provider VLAN mapping allows you to modify the packet in many different ways. Because IEEE 802.1Q and IEEE 802.1QinQ was designed to simply insert a four-octet shim into the frame, you can leverage a computer science data structure called a stack. A stack can best be characterized by “last in, first out.”
Figure 2-13 illustrates the basic concept of a stack. As items are added to the stack, they are pushed further down. Items can only be removed from the top of the stack. Hence, the last item in is the first out, and the first in is the last out.
There are three basic operations that are used with a stack data structure:
This operation adds data to the top of the stack.
This operation will remove the top of the stack.
This operation will swap/exchange the top of the stack with new data.
Figure 2-13. Basic stack data structure
When applying the stack data structure to VLAN mapping, the stack becomes the stack of IEEE 802.1Q shims. As new tags ...