SlideShare a Scribd company logo
1 of 8
VLAN ON LINUX / SP
09/2023
IEEE 802.1Q, often referred to as Dot1q, is the networking standard that supports virtual local area networking (VLANs) on an IEEE 802.3 Ethernet
network. The standard defines a system of VLAN tagging for Ethernet frames and the accompanying procedures to be used by bridges and switches
in handling such frames. The standard also contains provisions for a quality-of-service prioritization scheme commonly known as IEEE 802.1p and
defines the Generic Attribute Registration Protocol.
Portions of the network which are VLAN-aware (i.e., IEEE 802.1Q conformant) can include VLAN tags. When a frame enters the VLAN-aware portion of
the network, a tag is added to represent the VLAN membership. Each frame must be distinguishable as being within exactly one VLAN. A frame in the
VLAN-aware portion of the network that does not contain a VLAN tag is assumed to be flowing on the native VLAN.
The standard was developed by IEEE 802.1, a working group of the IEEE 802 standards committee, and continues to be actively revised with notable
amendments including IEEE 802.1ad, IEEE 802.1ak and IEEE 802.1s. The 802.1Q-2014 revision incorporated the IEEE 802.1D-2004 standard.
802.1Q adds a 32-bit field between the source MAC address and the EtherType fields of the original frame. Under 802.1Q, the maximum frame size is
extended from 1,518 bytes to 1,522 bytes.
The minimum frame size remains 64 bytes, but a bridge may extend the minimum size frame from 64 to 68 bytes on transmission.
This allows a tag to be popped without needing additional padding. Two bytes are used for the tag protocol identifier (TPID), the other two bytes for tag
control information (TCI). The TCI field is further divided into PCP, DEI, and VID.
https://en.wikipedia.org/wiki/IEEE_802.1Q
https://www.ieee802.org/1/pages/802.1Q-2014.html
https://www.ietf.org/rfc/rfc2674.txt
HARDWARE
NETWORK CARD
GNU/LINUX KERNEL
NETWORK
STACK
IFNAMES
/etc/network/interfaces
DPDK
VLAN CONTENT
LIBPCAP
MODULE 802.1Q
PROBE
# Check if the module is loaded
lsmod | grep 8021q
# Else load the module if required
sudo modprobe 8021q
# Create a sub network interface (Eg : eth0.100) using a VLAN ID equal to 100 ; similar to an ip alias
ip link add link eth0 name eth0.100 type vlan id 100
# Enable the network interface
ip link set dev eth0.100 up
HARDWARE
NETWORK CARD
GNU/LINUX KERNEL
NETWORK
STACK
IFNAMES
DPDK
VLAN CONTENT
LIBPCAP
MODULE 802.1Q
PROPOSAL #1 : by streaming from the probe that receive the vlan extracted from the vlan
PROBE
VLAN CONTENT
ffmpeg -i pipe: …
PIPE
same thing with a dpdk probe !
HARDWARE
NETWORK CARD
GNU/LINUX KERNEL
NETWORK
STACK
IFNAMES
VLAN CONTENT
MODULE 802.1Q
DRIVER VLAN NN6
/dev/vlan
Loading with parameters
vlan reader binary ffmpeg -i pipe: …
PIPE
PROPOSAL #2 : using a custom driver
Netfilter Hooks:
Consider using Netfilter hooks to intercept packets before
they are processed by the networking stack. You can use the
NF_INET_PRE_ROUTING hook to capture incoming packets
before routing.
VLAN Tag Handling:
You'll need to handle VLAN tagging and untagging, which
involves adding or removing the VLAN header from
incoming and outgoing packets.
Use functions like vlan_insert_tag() and
vlan_kill_tag() to handle VLAN tags.

More Related Content

Similar to Managing VLAN(802.1q) ON a LINUX operating system

Virtual Local Area Network
Virtual Local Area NetworkVirtual Local Area Network
Virtual Local Area NetworkAtakan ATAK
 
03 ft48923 en02gla0_general topics_
03 ft48923 en02gla0_general topics_03 ft48923 en02gla0_general topics_
03 ft48923 en02gla0_general topics_MelikaAjami
 
Tn 310 vlan-trunking
Tn 310 vlan-trunkingTn 310 vlan-trunking
Tn 310 vlan-trunkingsali Ibrahimu
 
What is IEEE and why?
What is IEEE and why?What is IEEE and why?
What is IEEE and why?Ankita Tiwari
 
Ccent notes part 1
Ccent notes part 1Ccent notes part 1
Ccent notes part 1ahmady
 
Hardened Ethernet In ITS 2010
Hardened Ethernet In ITS 2010Hardened Ethernet In ITS 2010
Hardened Ethernet In ITS 2010ethersteve
 
Final_IoT_Protocol Stack.pptx
Final_IoT_Protocol Stack.pptxFinal_IoT_Protocol Stack.pptx
Final_IoT_Protocol Stack.pptxjainam bhavsar
 
Ccna3 mod9-vtp
Ccna3 mod9-vtpCcna3 mod9-vtp
Ccna3 mod9-vtpjmdoger
 
Local Area Network – Wired LAN
Local Area Network – Wired LANLocal Area Network – Wired LAN
Local Area Network – Wired LANRaj vardhan
 
Advanced TCP/IP-based Industrial Networking for Engineers & Technicians
Advanced TCP/IP-based Industrial Networking for Engineers & TechniciansAdvanced TCP/IP-based Industrial Networking for Engineers & Technicians
Advanced TCP/IP-based Industrial Networking for Engineers & TechniciansLiving Online
 
Ethernet Computer network
Ethernet Computer networkEthernet Computer network
Ethernet Computer networkmiteshppt
 
OptiQNet-842-DM-v0.4-for-852
OptiQNet-842-DM-v0.4-for-852OptiQNet-842-DM-v0.4-for-852
OptiQNet-842-DM-v0.4-for-852Yi-Neng Lin
 
Internetworking Overview
Internetworking OverviewInternetworking Overview
Internetworking Overviewscooby_doo
 
Openstack Neutron Insights
Openstack Neutron InsightsOpenstack Neutron Insights
Openstack Neutron InsightsAtul Pandey
 

Similar to Managing VLAN(802.1q) ON a LINUX operating system (20)

Ethernet technology
Ethernet technologyEthernet technology
Ethernet technology
 
Virtual Local Area Network
Virtual Local Area NetworkVirtual Local Area Network
Virtual Local Area Network
 
03 ft48923 en02gla0_general topics_
03 ft48923 en02gla0_general topics_03 ft48923 en02gla0_general topics_
03 ft48923 en02gla0_general topics_
 
Tn 310 vlan-trunking
Tn 310 vlan-trunkingTn 310 vlan-trunking
Tn 310 vlan-trunking
 
Ethernet Frames Explained
Ethernet Frames ExplainedEthernet Frames Explained
Ethernet Frames Explained
 
Dot1qtnl
Dot1qtnlDot1qtnl
Dot1qtnl
 
What is IEEE and why?
What is IEEE and why?What is IEEE and why?
What is IEEE and why?
 
IEEE 802 Standards
IEEE 802 StandardsIEEE 802 Standards
IEEE 802 Standards
 
Ccent notes part 1
Ccent notes part 1Ccent notes part 1
Ccent notes part 1
 
Ccna3 mod9-vtp
Ccna3 mod9-vtpCcna3 mod9-vtp
Ccna3 mod9-vtp
 
Hardened Ethernet In ITS 2010
Hardened Ethernet In ITS 2010Hardened Ethernet In ITS 2010
Hardened Ethernet In ITS 2010
 
Final_IoT_Protocol Stack.pptx
Final_IoT_Protocol Stack.pptxFinal_IoT_Protocol Stack.pptx
Final_IoT_Protocol Stack.pptx
 
Ccna3 mod9-vtp
Ccna3 mod9-vtpCcna3 mod9-vtp
Ccna3 mod9-vtp
 
Local Area Network – Wired LAN
Local Area Network – Wired LANLocal Area Network – Wired LAN
Local Area Network – Wired LAN
 
Advanced TCP/IP-based Industrial Networking for Engineers & Technicians
Advanced TCP/IP-based Industrial Networking for Engineers & TechniciansAdvanced TCP/IP-based Industrial Networking for Engineers & Technicians
Advanced TCP/IP-based Industrial Networking for Engineers & Technicians
 
Ethernet Computer network
Ethernet Computer networkEthernet Computer network
Ethernet Computer network
 
Routing vlans
Routing vlansRouting vlans
Routing vlans
 
OptiQNet-842-DM-v0.4-for-852
OptiQNet-842-DM-v0.4-for-852OptiQNet-842-DM-v0.4-for-852
OptiQNet-842-DM-v0.4-for-852
 
Internetworking Overview
Internetworking OverviewInternetworking Overview
Internetworking Overview
 
Openstack Neutron Insights
Openstack Neutron InsightsOpenstack Neutron Insights
Openstack Neutron Insights
 

Recently uploaded

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 

Recently uploaded (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 

Managing VLAN(802.1q) ON a LINUX operating system

  • 1. VLAN ON LINUX / SP 09/2023
  • 2. IEEE 802.1Q, often referred to as Dot1q, is the networking standard that supports virtual local area networking (VLANs) on an IEEE 802.3 Ethernet network. The standard defines a system of VLAN tagging for Ethernet frames and the accompanying procedures to be used by bridges and switches in handling such frames. The standard also contains provisions for a quality-of-service prioritization scheme commonly known as IEEE 802.1p and defines the Generic Attribute Registration Protocol. Portions of the network which are VLAN-aware (i.e., IEEE 802.1Q conformant) can include VLAN tags. When a frame enters the VLAN-aware portion of the network, a tag is added to represent the VLAN membership. Each frame must be distinguishable as being within exactly one VLAN. A frame in the VLAN-aware portion of the network that does not contain a VLAN tag is assumed to be flowing on the native VLAN. The standard was developed by IEEE 802.1, a working group of the IEEE 802 standards committee, and continues to be actively revised with notable amendments including IEEE 802.1ad, IEEE 802.1ak and IEEE 802.1s. The 802.1Q-2014 revision incorporated the IEEE 802.1D-2004 standard. 802.1Q adds a 32-bit field between the source MAC address and the EtherType fields of the original frame. Under 802.1Q, the maximum frame size is extended from 1,518 bytes to 1,522 bytes. The minimum frame size remains 64 bytes, but a bridge may extend the minimum size frame from 64 to 68 bytes on transmission. This allows a tag to be popped without needing additional padding. Two bytes are used for the tag protocol identifier (TPID), the other two bytes for tag control information (TCI). The TCI field is further divided into PCP, DEI, and VID. https://en.wikipedia.org/wiki/IEEE_802.1Q https://www.ieee802.org/1/pages/802.1Q-2014.html https://www.ietf.org/rfc/rfc2674.txt
  • 3.
  • 5. # Check if the module is loaded lsmod | grep 8021q # Else load the module if required sudo modprobe 8021q # Create a sub network interface (Eg : eth0.100) using a VLAN ID equal to 100 ; similar to an ip alias ip link add link eth0 name eth0.100 type vlan id 100 # Enable the network interface ip link set dev eth0.100 up
  • 6. HARDWARE NETWORK CARD GNU/LINUX KERNEL NETWORK STACK IFNAMES DPDK VLAN CONTENT LIBPCAP MODULE 802.1Q PROPOSAL #1 : by streaming from the probe that receive the vlan extracted from the vlan PROBE VLAN CONTENT ffmpeg -i pipe: … PIPE same thing with a dpdk probe !
  • 7. HARDWARE NETWORK CARD GNU/LINUX KERNEL NETWORK STACK IFNAMES VLAN CONTENT MODULE 802.1Q DRIVER VLAN NN6 /dev/vlan Loading with parameters vlan reader binary ffmpeg -i pipe: … PIPE PROPOSAL #2 : using a custom driver
  • 8. Netfilter Hooks: Consider using Netfilter hooks to intercept packets before they are processed by the networking stack. You can use the NF_INET_PRE_ROUTING hook to capture incoming packets before routing. VLAN Tag Handling: You'll need to handle VLAN tagging and untagging, which involves adding or removing the VLAN header from incoming and outgoing packets. Use functions like vlan_insert_tag() and vlan_kill_tag() to handle VLAN tags.