O'Reilly logo

Juniper MX Series by Harry Reynolds, Douglas Richard Hanks Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Service Provider VLAN Mapping

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.

Stack Data Structure

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:

Push

This operation adds data to the top of the stack.

Pop

This operation will remove the top of the stack.

Swap

This operation will swap/exchange the top of the stack with new data.

Basic stack data structure

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required