二层交换网络_网络中的第2层交换

二层交换网络

二层交换简介 (Introduction to Layer 2 Switching)

As you know hubs are not intelligent devices. Whenever a hub receives a frame, it broadcasts the frame in all ports. Also, the hub represents a single collision domain i.e. when any 2 hosts send frames simultaneously and a collision occurs. Due to these limitations of Hubs, there are problems in the network.

如您所知,集线器不是智能设备。 当集线器收到帧时,它将在所有端口中广播该帧。 同样,集线器表示单个冲突域,即,当任意两个主机同时发送帧并且发生冲突时。 由于集线器的这些限制,网络中存在问题。

Bridges were constructed to overcome the limitations of Hubs. Bridges are better than hubs. Bridges are used to connect local area networks. If you want to spread your local area network more then you can do it through the bridges. Bridges use the MAC address to forward the frames. But because the bridges had only 2 port, bridges were also not able to provide a reliable and scalable network.

建造桥梁是为了克服枢纽的局限性。 桥梁比集线器更好。 网桥用于连接局域网。 如果您想扩大局域网的范围,则可以通过网桥进行扩展。 网桥使用MAC地址转发帧。 但是因为网桥只有2个端口,所以网桥也无法提供可靠且可扩展的网络。

Switches are used to overcome the limitations of hubs and bridges. Every port of a switch is called single collision domain. Therefore a switch represents multiple collision domains and a single broadcast domain. Switches are an intelligent device.

交换机用于克服集线器和桥接器的限制。 交换机的每个端口称为单个冲突域。 因此,交换机代表多个冲突域和一个广播域。 开关是一种智能设备。

Switches to determine the destination in Layer 2 switching uses the table of the MAC (Media Access Control) addresses. This table is also called the CAM table. MAC address is hardcoded by the manufacturer on every host's NIC (Network Interface Card). Layer 2 switches Application Specific Integrated Circuits (ASIC) is used to maintain and maintain a table of MAC addresses.

用于确定第2层交换中的目的地的交换使用MAC(媒体访问控制)地址表。 该表也称为CAM表。 制造商在每个主机的NIC(网络接口卡)上将MAC地址硬编码。 第2层交换机专用集成电路(ASIC)用于维护和维护MAC地址表。

开关功能 (Functions of Switches )

Switches on Layer 2 performs 3 important functions:

第2层上的开关执行3个重要功能:

1)硬件地址学习 (1) Hardware Address Learning )

When the switch is first turned on, the CAM table is empty. When a host frame sends the store address of the switch frame to the CAM table. Because switch does not have the knowledge of the destination host at this time, so switch lets the frame broadcast all other ports except source port.

首次打开开关时,CAM表为空。 当主机帧将交换帧的存储地址发送到CAM表时。 由于交换机此时不了解目标主机,因此交换机允许帧广播源端口以外的所有其他端口。

All hosts discard this frame except for the host that has been sent to this frame. The person who receives the host frame sends the acknowledgment frame to the source host. Now switch stores the source address of this frame in your CAM table.

除已发送到该帧的主机外,所有主机都丢弃该帧。 接收主机帧的人将确认帧发送到源主机。 现在,switch将此帧的源地址存储在CAM表中。

Whenever a frame is sent to the network, Switch stores its source address in its CAM table. Thus a switch creates your CAM table. Once the switch stores all hosts' MAC addresses, it does not need to broadcast any frame as the first time. Now the frames are sent from the source to the destination like a point to point connection.

每当将帧发送到网络时,Switch会将其源地址存储在其CAM表中。 因此,一个开关将创建您的CAM表。 一旦交换机存储了所有主机的MAC地址,它就不需要在第一次广播任何帧。 现在,帧像点对点连接一样从源发送到目的地。

2)帧转发 (2) Forwarding of Frames )

As soon as a frame switch interface comes in, its destination MAC address is compared to the MAC addresses of the CAM table. If the destination address matches the frame, then the frame is forwarded only to the port corresponding to that MAC address.

一旦帧切换接口进入,它的目标MAC地址就会与CAM表的MAC地址进行比较。 如果目标地址与帧匹配,则仅将帧转发到与该MAC地址相对应的端口。

If the destination address of any frame does not match the CAM table then that frame is broadcasted. If a host receives the frame and sends its acknowledgment frame, then stores the address of that frame in the switch CAM table. If someone broadcast hosts or server frames then switch sends such frames to all hosts.

如果任何帧的目标地址与CAM表都不匹配,则广播该帧。 如果主机接收到该帧并发送其确认帧,则将该帧的地址存储在交换机CAM表中。 如果有人广播主机或服务器帧,则交换机会将此类帧发送到所有主机。

Switches provide 3 methods to forward frames:

交换机提供了三种转发帧的方法:

  • Store and Forward: The entire frame is copied to memory in this method. After copying the frame, it is performed on Cyclic Redundancy Check (CRC).

    存储并转发 :用这种方法将整个帧复制到内存中。 复制帧后,将执行循环冗余校验(CRC)。

  • Cut Through: In this method, the initial 6 bytes are copied from the header of the frame so that the destination host can be identified. This method does not perform any type of error checking.

    切入 :在此方法中,从帧的头复制前6个字节,以便可以标识目标主机。 此方法不执行任何类型的错误检查。

  • Fragment Free: In this method, 64 bytes of the frame are copied to perform the error checking.

    无碎片 :在此方法中,复制帧的64个字节以执行错误检查。

3)避免循环 (3) Loop Avoidance )

It is very important to have multiple links between switches. Because if there is a link down for some reason then the second link can be sent to the frames. But sometimes these multiple links cause many problems in the network.

交换机之间具有多个链接非常重要。 因为如果由于某种原因导致链接断开,则可以将第二个链接发送到帧。 但是有时这些多重链接会在网络中引起许多问题。

Because there is more than one link between switches, loops can be created in the network. If no loop avoidance technique is used then the broadcast storm is created in the network. Because of the loops in the network, one can get multiple copies of the host frames.

由于交换机之间存在多个链接,因此可以在网络中创建环路。 如果未使用环路避免技术,则会在网络中创建广播风暴。 由于网络中存在环路,因此可以获取主机帧的多个副本。

The Spanning Tree Protocol is used to prevent loops in Layer 2 switching.

生成树协议用于防止第2层交换中的循环。

翻译自: https://www.includehelp.com/computer-networks/layer-2-switching.aspx

二层交换网络

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值