Thursday, January 9, 2014

QinQ from Linux to mikrotik -- IEEE 802.1ad

IEEE 802.1ad is an enternet networking standard known as IEEE 802.1QinQ and is an amendment to standard IEEE 802.1Q-1998. The technique is also known as provider bridging, Stacked VLANs, or simply QinQ or Q-in-Q. "Q-in-Q" can for supported devices apply to C-tag stacking on C-tag (Ethernet Type = 0x8100) but this has limited application in the modern methodology of network routing.
The original 802.1Q specification allows a single VLAN header to be inserted into an Ethernet frame. QinQ allows multiple VLAN tags to be inserted into a single frame, an essential capability for implementing metro ethernet network topologies. Just as QinQ extends 802.1Q, QinQ itself is extended by other Metro Ethernet protocols.
In a multiple VLAN header context, out of convenience the term "VLAN tag" or just "tag" for short is often used in place of "802.1Q VLAN header". QinQ allows multiple VLAN tags in an Ethernet frame; together these tags constitute a tag stack. When used in the context of an Ethernet frame, a QinQ frame is a frame that has 2 VLAN 802.1Q headers (double-tagged).


Example:

- linux:
#  modprobe 8021q
# vconfig add eth0 22
# vconfig add eth0.22 50
# ifconfig eth0.22.50 up
# ifconfig eth0.22.50 192.168.5.7/24

# ifconfig eth0.22.50
eth0.22.50 Link encap:Ethernet  HWaddr 48:5b:39:6b:14:4e 
          inet addr:192.168.5.7  Bcast:192.168.5.255  Mask:255.255.255.0
          inet6 addr: fe80::4a5b:39ff:fe6b:144e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2746 (2.7 KB)  TX bytes:928 (928.0 B)


- Mikrotik

/interface vlan
add interface=ether12 l2mtu=1596 name=vlan22 vlan-id=22
add interface=vlan22 l2mtu=1592 name=vlan50 vlan-id=50


/ip address
add address=192.168.5.1/24 interface=vlan50 network=192.168.5.0


-result

# ping 192.168.5.1
PING 192.168.5.1 (192.168.5.1) 56(84) bytes of data.
64 bytes from 192.168.5.1: icmp_seq=1 ttl=64 time=0.119 ms
64 bytes from 192.168.5.1: icmp_seq=2 ttl=64 time=0.118 ms
64 bytes from 192.168.5.1: icmp_seq=3 ttl=64 time=0.122 ms
^X^C
--- 192.168.5.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.118/0.119/0.122/0.012 ms


No comments:

Post a Comment