QinQ (802.1Q-in-802.1Q)
What it is for
There are only 4094 VLANs. A carrier serving hundreds of customers with L2 circuits hits a wall: each customer uses VLANs too, so customer A's VLAN 10 collides with customer B's.
QinQ's answer: whatever you use inside, the carrier wraps its own tag around it and looks only at the outer one.
Who reads which tag
★★★ Outer (S-tag, 0x88a8) -- the only layer the carrier's devices look at; it identifies which customer this is;
★★★ Inner (C-tag, 0x8100) -- the customer's own VLAN, carried transparently and never interpreted by the carrier.
★★ So to the customer the whole carrier network behaves like one cable: the tag goes in and comes out unchanged.
★ Common misconceptions
★★★ "Two tags is just 4 more bytes, no big deal" -- it is a big deal. The frame grows to 1526 bytes and every device in the carrier network must accept that, or you get "small packets fine, large packets fail" -- the classic QinQ fault.
★★ "The customer sets the outer tag" -- no, the carrier adds it at the PE; the customer neither sees nor controls it.
★ "TPID is always 0x8100" -- the standard outer TPID is 0x88a8; some gear defaults to 0x8100, and a mismatch cannot be parsed.