gpt4 book ai didi

networking - 了解对数据包的 vlan 处理

转载 作者:行者123 更新时间:2023-12-04 16:17:06 25 4
gpt4 key购买 nike

大家好,我想了解标记和未标记数据包上的 vlan 行为。我遇到了这些声明,这听起来让我很困惑

When a tagged packet enters a port, the default VLAN ID setting has no effect on the tag.


1. The packet proceeds to the VLAN specified by its VLAN ID tag number.

2. If the port in which the packet entered does not belong to the VLAN
specified by the packet’s VLAN ID tag, the system drops the packet.


3. If the port belongs to the VLAN specified by the packet’s VLAN ID,
the system can send the packet to other ports with the same VLAN ID.

我对所有这些陈述都很困惑。这三个有何不同。他们相互矛盾数据包/端口属于特定的vlan ID意味着什么,因为端口只能有一个vlan ID

最佳答案

概述

我一直避免回答这个问题,因为我认为它会迁移到 Server Fault ;由于它在这里挥之不去,我将解决您问题的具体细节。如果没有更多关于作者为什么提出这些观点的背景,也很难完全回应,但我会尽力回答。我不知道为什么我花了这么多时间来回答这个问题,除了圣诞节和我妻子出国探望她的家人......

图表

我认为这些概念最好用一种叫做多层交换机的东西来说明,它只是一个也能理解 IP 地址的以太网交换机。我画了一张图来说明:

  • 交换机有四个物理接口(interface),编号为 Port 1/1、Port 1/2、Port 1/3 和 Port 1/4
  • 交换机有一个虚拟接口(interface),Vlan12。虚拟接口(interface)有一个以太网 MAC 地址和一个分配给它的 IP 地址。
  • 假设三个以太网帧进入端口 1/1
  • 端口 1/1 配置为接受 Vlan 标记 12 和 13。端口 1/1 也有一个默认的 Vlan 1;这意味着任何未标记的帧都被放入 Vlan 1。
  • 以太网交换机使用的第一个决策点是确定帧属于哪个 Vlan。
  • 接下来,以太网交换机查看它知道的以太网 MAC 地址数据库


  • Switch with Ethernet Vlans

    答案

    I am so confuse in all these statements.How does these three differ. They are contradicting one an other what does packet /port belong to specific vlan ID mean as port can have only one vlan ID



    实际上,这取决于我们正在讨论的端口类型。作者在 trunk mode 中非常清楚地描述了以太网交换机端口上发生的情况。 .
  • 以太网中继模式端口 如果它们处于中继模式,则可以处理多个 Vlan ID(请参见图中的端口 1/1)。端口 1/1 可以接受带有 Vlan 12 或 Vlan 13 的以太网帧;但是,这些帧必须有 802.1q tag让交换机知道它们属于
  • 中的哪个 Vlan
  • 以太网访问模式端口 只分配了一个 Vlan。

  • 为了解决文中引用的要点...

    When a tagged packet enters a port, the default VLAN ID setting has no effect on the tag.

    1. The packet proceeds to the VLAN specified by its VLAN ID tag number.



    可能发生的事情最好地说明了这一点。框架 A .

    即使端口 1/1 具有默认 Vlan (Vlan 1),帧 A 仍分配给 Vlan 12。因此,它可以退出端口 1/2、1/3 或直接转到虚拟接口(interface) Vlan12:
  • 如果帧 A 离开端口 1/2,802.1q tag (12) 发送到端口 1/1 仍保留在帧 A 上,因为端口 1/2 处于中继模式
  • 如果帧 A 离开端口 1/3,802.1q tag (12) 发送到端口 1/1 的帧 A 被删除,因为端口 1/3 处于访问模式
  • 如果帧 A 被传送到虚拟接口(interface) Vlan12(如果帧 A 的目标 MAC 地址是 000a.dead.beef),则交换机不需要将帧转发到其他任何地方。通常,您会看到寻址到交换机上虚拟接口(interface)的以太网帧的原因是出于管理目的,例如 telnet , ssh snmp .还有其他原因,但现在我们不要再让事情复杂化了。

  • ... 2. If the port in which the packet entered does not belong to the VLAN specified by the packet’s VLAN ID tag, the system drops the packet.



    发生的事情最好地说明了这一点。框架 B .

    端口 1/1 未配置为接受 Vlan ID 20,因此当交换机在 802.1q tag 中看到“20”时, 帧 B 被丢弃。

    ... 3. If the port belongs to the VLAN specified by the packet’s VLAN ID, the system can send the packet to other ports with the same VLAN ID.



    这又是指 框架 A ;在这种情况下,作者描述了如果交换机没有将帧 A 传送到虚拟接口(interface) Vlan12 会发生什么。

    最后我加入了 框架 C 供你引用。这是为了说明以太网中继端口上默认 Vlan 的行为。

    圣诞快乐,祝你学习顺利。

    关于networking - 了解对数据包的 vlan 处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8601009/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com