Home Database Mysql Tutorial 交换机中tag、untag的理解

交换机中tag、untag的理解

Jun 07, 2016 pm 03:32 PM
tag exchange switch understand

交换机 中tag、untag的 理解 情况列举 Switch收发 Switch对标记的处理 remark Access (接收) Tagged = PVID 不接收 注:部分高端产品可能接收。 Access (接收) Tagged =/ PVID 不接收 注:部分高端产品可能接收。 Access (接收) Untagged 接收 增加tag=PVID

交换机中tag、untag的理解

情况列举 Switch收发 Switch对标记的处理 remark
Access (接收) Tagged = PVID 不接收 注:部分高端产品可能接收。
Access (接收) Tagged =/ PVID 不接收 注:部分高端产品可能接收。
Access (接收) Untagged 接收 增加tag=PVID 从PC

Access (发送) Tagged = PVID 转发 删除tag
Access (发送) Tagged =/ PVID 不转发 不处理
Access (发送) Untagged 无此情况 无此情况 无此情况

Trunk (接收) Tagged = PVID 接收 不修改tag
Trunk (接收) Tagged =/ PVID 接收 不修改tag
Trunk (接收) Untagged 接收 增加tag=PVID
Trunk (发送) Tagged = PVID If Passing then 转发 删除tag
Trunk (发送) Tagged =/ PVID If Passing then 转发 不修改tag
Trunk (发送) Untagged 无此情况 无此情况 无此情况(注)

Hybrid (接收) Tagged = PVID 接收 不修改tag 对端是trunk
Hybrid (接收) Tagged =/ PVID 接收 不修改tag 对端是trunk
Hybrid (接收) Untagged 接收 增加tag=PVID 类Trunk
Hybrid (发送) Tagged = PVID Tag 和 untag 中列出的vlan可以passing 看Tag项和untag项
Hybrid (发送) Tagged =/ PVID Tag 和 untag 中列出的vlan可以passing 看Tag项和untag项
Hybrid (发送) Untagged 无此情况 无此情况 无此情况(注)


我来解释一下
收报文:
Acess端口1、收到一个报文,判断是否有VLAN信息:如果没有则打上端口的PVID,并进行交换转发,如果有则直接丢弃(缺省)
发报文:
Acess端口: 1、将报文的VLAN信息剥离,直接发送出去      
收报文:
trunk端口: 1、收到一个报文,判断是否有VLAN信息:如果没有则打上端口的PVID,并进行交换转发,如果有判断该trunk端口是否允许该 VLAN的数据进入:如果可以则转发,否则丢弃
发报文:
trunk端口: 1、比较端口的PVID和将要发送报文的VLAN信息,如果两者相等则剥离VLAN信息,再发送,如果不相等则直接发送
收报文:
hybrid端口: 1、收到一个报文
      2、判断是否有VLAN信息:如果没有则打上端口的PVID,并进行交换转发,如果有则判断该hybrid端口是否允许该VLAN的数据进入:如果可以则转发,否则丢弃
发报文:
hybrid端口:1、判断该VLAN在本端口的属性(disp interface 即可看到该端口对哪些VLAN是untag, 哪些VLAN是tag)
      2、如果是untag则剥离VLAN信息,再发送,如果是tag则直接发送

================================
以下是神码大学郑老师的讲解,更清楚直观

先呈请一下上面的几个帖子的术语:

Tag为IEEE802.1Q协议定义的VLAN的标记在数据帧中的标示;
ACCESS端口,TRUNK端口是厂家对某一种端口的叫法,并非IEEE802.1Q协议的标准定义;

这个数据交换的过程比较复杂,如果想解释的话,首先要了解一下几个IEEE802.1Q协议的定理;
1、下面是定义的各种端口类型对各种数据帧的处理方法;

————————Tagged数据帧 Tagged数据帧 Untagged数据帧   Untagged数据帧
————————in             out               in                     out
Tagged端口___原样接收     原样发送     按端口PVID打TAG标记 按照PVID打TAG标记
Untagged端口_丢弃       去掉TAG标记   按端口PVID打TAG标记 原样发送

2、所谓的Untagged Port和tagged Port不是讲述物理端口的状态,而是将是物理端口所拥有的某一个VID的状态,所以一个物理端口可以在某一个VID上是Untagged Port,在另一个VID上是tagged Port;

3、一个物理端口只能拥有一个PVID,当一个物理端口拥有了一个PVID的时候,必定会拥有和PVID的TAG等同的VID,而且在这个VID上,这个物理端口必定是Untagged Port;

4、PVID的作用只是在交换机从外部接受到可以接受Untagged 数据帧的时候给数据帧添加TAG标记用的,在交换机内部转发数据的时候PVID不起任何作用;

5、拥有和TAG标记一致的VID的物理端口,不论是否在这个VID上是Untagged Port或者tagged Port,都可以接受来自交换机内部的标记了这个TAG标记的tagged 数据帧;

6、拥有和TAG标记一致的VID的物理端口,只有在这个VID上是tagged Port,才可以接受来自交换机外部的标记了这个TAG标记的tagged 数据帧;

以下是神州数码对命令的定义(各个厂家对命令的定义可能不一定一致,但是都必须遵循上面的定理):

1、Trunk端口就是在一个物理端口上增加这个交换机所有VLAN的VID标示,并且除了和这个物理端口PVID标示一致的VID标示为Untagged Port外,在其他的VID上都是Tagged Port;

2、Access端口就是指拥有一个和PVID标记相同的VID的物理端口,在这个VID上,遵循定理一定为untagged Port;

在了解了以上的基础理论之后,我们在来看一下楼主的问题:

一个数据包从PC机发出经过ACCESS端口->TRUNK端口->TRunk->ACCESS->PC数据包发生了怎么样的变化?

我们先把上述的描述变换为IEEE802.1Q的标准描述:

一个数据包从PC机发出经过(Untagged 数据帧)

ACCESS端口(PVID定义为100,VID=100=Untagged Port)->

TRUNK端口(PVID定义为1〈出厂配置,没有更改〉,VID=1=Untagged Port,VID=100=tagged Port)->

另一个交换机的TRunk端口(PVID定义为1〈出厂配置,没有更改〉,VID=1=Untagged Port,VID=100=tagged Port)->

另一个交换机的ACCESS端口(PVID定义为100,VID=100=Untagged Port)->

PC数据包发生了怎么样的变化?(Untagged 数据帧)

首先假设两台交换机刚刚开机(MAC地址表为空)从PC机发出的数据帧进入交换机的ACCESS端口以后,会按照这个端口的PVID打100的Tag标记,根据交换机的转发原理,交换机会把这个数据帧转发给VID=100的所有端口(除了进口以外),这个过程叫做VLAN Flood;参照上面的定理1;

由于Trunk端口拥有VID=100,所以才可接受这个标记Tag为100的tagged数据帧;参照上面的定理5;

由于Trunk端口在VID=100上为tagged Port,所以在发送数据帧出交换机的时候,不改变Tagged数据帧的结构;参照上面的定理1;

到了另一个交换机的Trunk端口的时候,由于Trunk端口拥有VID=100,所以才可接受这个标记Tag为100的tagged数据帧;参照上面的定理6;

另一个交换机的Trunk端口,接收到标记tag为100的tagged数据帧,并不作任何的更改;参照上面的定理1;

另一个交换机收到到标记tag为100的tagged数据帧,根据交换机的转发原理,交换机会把这个数据帧转发给VID=100的所有端口(除了进口以外);参照交换机交换原理(受到一个未知目的MAC数据帧);

这样另一个交换机的ACCESS端口就可以收到标记tag为100的tagged数据帧;参照上面的定理5;

另一个交换机的ACCESS端口在发出标记tag为100的tagged数据帧的时候,会去掉TAG标记,转发untagged数据帧给PC;参照上面的定理1;

这样PC机就收到了这个数据;

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1252
24
How to add swap space on Ubuntu 22.04 LTS How to add swap space on Ubuntu 22.04 LTS Feb 20, 2024 am 11:12 AM

Swap space plays an important role in Linux systems, especially when the system is low on memory. It acts as a backup memory storage space that helps the system run smoothly and maintain stability even under high load. This article provides you with a detailed guide to adding swap space on Ubuntu 22.04LTS to ensure that your system performance is optimized and can handle various workloads. Understanding Swap Space Swap space provides virtual memory that is used to supplement the system's physical RAM. When the system is low on RAM, the kernel swaps data to disk to prevent out-of-memory and system crashes. Linux systems commonly use swap space to handle this situation. Run multiple memory-intensive applications simultaneously to process very large files or data

Python program: Swap the positions of the first and last elements in a matrix between columns Python program: Swap the positions of the first and last elements in a matrix between columns Sep 08, 2023 pm 04:29 PM

A matrix is ​​a two-dimensional array of numbers arranged in rows and columns. Python does not have any data type to represent matrices, but we can use nested lists or NumPy arrays as matrices. See the following input and output scenarios to see how to swap the first and last column elements of a matrix. Input-Output Scenario Suppose we have a 3X3 matrix represented using a list of lists. The output matrix will be the resulting matrix of swapping the first and last column elements. Inputmatrix:[1,3,4][4,5,6][7,8,3]Outputmatrix:[4,3,1][4,5,6][3,8,7]Let us consider another A matrix whose rows and columns are unequal. Inputmatrix:

Broadcom Unveils Innovation, Launches Industry's First On-Chip Neural Network Switch Broadcom Unveils Innovation, Launches Industry's First On-Chip Neural Network Switch Dec 03, 2023 pm 08:51 PM

Broadcom recently announced the launch of the Trident5-X12 chip, which is equipped with a new NetGNT (Network General Neural Network Traffic Analyzer) on-chip neural network inference engine. NetGNT is different from traditional packet processing. It can work in parallel to enhance standard packet processing. pipeline. Traditional pipelines can only process one packet/path at a time, while NetGNT, as a machine learning inference engine, can be trained to identify various traffic patterns across the entire chip. It is understood that the Trident5-X12 chip has powerful software programming functions and on-site upgrade functions, providing a bandwidth of up to 16.0 Terabits/second, which is twice that of Trident4-X9. In addition, the new chip also supports

Is Huawei tag useful? Is Huawei tag useful? Nov 07, 2023 pm 03:24 PM

Huawei Tag is useful in helping users track and locate items. Huawei Tag is an intelligent positioning device launched by Huawei. It can help users track and locate the location of items. It can help users retrieve lost items, prevent items from being stolen, provide remote alarm functions, and add items through the community help function. Chances of recovery. However, it should be noted that Tag’s positioning range is limited and relies on mobile phone connection. Users also need to pay attention to the protection of personal privacy.

Learn more about the dis command in switch inspection Learn more about the dis command in switch inspection Feb 18, 2024 am 10:05 AM

What is the dis command used in switch inspection? In the maintenance and management process of network equipment, switches are an indispensable part. Inspection of switches is one of the important links to ensure the normal operation of the network. During the inspection process, the dis command is a commonly used command on switches. The purpose and function of the dis command will be introduced in detail below. dis is the abbreviation of display. It is a commonly used command on Huawei switch equipment and is used to display various information of the equipment. The dis command can display the configuration information and operating status of the switch.

How does a switch work? How does a switch work? Dec 26, 2023 pm 02:07 PM

The working principle of the switch is based on the second layer of the OSI reference model, the data link layer. A switch is a network device based on a learning process that enables communication between different devices in the network by parsing and forwarding data frames. The switch can continuously improve the contents of its internal forwarding table, improve the efficiency and reliability of data exchange, and ensure the stability and security of the connection. Switches are widely used in enterprise networks, data centers, campus networks and other scenarios to provide stable and efficient connection services for various applications.

How does a switch work? How does a switch work? Dec 26, 2023 am 11:56 AM

The working principle of the switch includes: 1. Data frame reception and analysis; 2. Forwarding table update; 3. Data frame forwarding; 4. Flood processing; 5. Connection maintenance. Detailed introduction: 1. Data frame reception and parsing. When the switch receives a data frame, it will first parse the data frame and extract the source MAC address and destination MAC address and other information; 2. Update of the forwarding table, The switch maintains a forwarding table internally, which records the correspondence between MAC addresses and interfaces; 3. Forwarding of data frames, etc.

Interpret HTTP status code 404 and develop corresponding solutions Interpret HTTP status code 404 and develop corresponding solutions Feb 18, 2024 pm 04:44 PM

Understand the meaning of HTTP status code 404 and countermeasures HTTP is a protocol used to transmit hypertext. It uses status codes to indicate the server's response status to requests. Among them, status code 404 is the most common one, which means "Not Found". When we access a web page or request a resource in the browser, if the server cannot find the requested resource, it will return a 404 status code. The meaning of the 404 status code is to tell the client that the requested resource cannot be found. this

See all articles