二层交换网络_网络中的第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

二层交换网络

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/544021.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

最小化托盘示例工程

http://files.cnblogs.com/files/kekec2/BuyTicket.rar.gif转载于:https://www.cnblogs.com/kekec2/p/4914572.html

面试必备:TCP 经典 15 连问!

TCP协议是大厂面试必问的知识点。整理了15道非常经典的TCP面试题,希望大家都找到理想的offer呀1. 讲下TCP三次握手流程开始客户端和服务器都处于CLOSED状态,然后服务端开始监听某个端口,进入LISTEN状态第一次握手(SYN1, seqx),发…

range函数python_range()函数以及Python中的示例

range函数pythonPython range()函数 (Python range() function) The range() is a built-in function in Python which returns the sequence of values. It is used where we need to perform a specific action for a limited number of times. In general, if we write rang…

ISP QoS Lab

ISP QoS Lab1-PQ优先级队列(PQ,Priority Queue)中,有高、中、普通、低优先级四个队列。数据包根据事先的定义放在不同的队列中,路由器按照高、中、普通、低顺序服务,只有高优先级的队列为空后才为中优先级的…

面渣逆袭:JVM经典五十问,这下面试稳了!

引言1.什么是JVM?JVM——Java虚拟机,它是Java实现平台无关性的基石。Java程序运行的时候,编译器将Java文件编译成平台无关的Java字节码文件(.class),接下来对应平台JVM对字节码文件进行解释,翻译成对应平台匹配的机器…

操作系统大内核和微内核_操作系统中的内核类型

操作系统大内核和微内核As we have already studied about the Kernels, we know that the Kernel is a program which is the main component of the Operating System. Now let us study about the types of Kernels. 正如我们已经研究了内核一样 ,我们知道内核是…

POJ 3268:Silver Cow Party 求单点的来回最短路径

Silver Cow PartyTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 15989 Accepted: 7303Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A t…

【论文解读】Learning based fast H.264 to H.265 transcoding

时间: 2015 年 级别:APSIPA 机构: 上海电力大学 摘要 新提出的视频编码标准HEVC (High Efficiency video coding)以其比H.264/AVC更好的编码效率,被工业界和学术界广泛接受和采用。在HEVC实现了约40%的编码效率提升的同时&#…

面试必备:聊聊sql优化的15个小技巧

sql优化是一个大家都比较关注的热门话题,无论你在面试,还是工作中,都很有可能会遇到。如果某天你负责的某个线上接口,出现了性能问题,需要做优化。那么你首先想到的很有可能是优化sql语句,因为它的改造成本…

Scala程序将字符串转换为整数

In Scala, there is a huge library to support different operations on a string. One such operation is to convert string to int in Scala. 在Scala中,有一个庞大的库来支持对字符串的不同操作。 一种这样的操作是在Scala中将字符串转换为int。 A string can…

面试突击73:IoC 和 DI 有什么区别?

作者 | 磊哥来源 | Java面试真题解析(ID:aimianshi666)转载请联系授权(微信ID:GG_Stone)IoC 和 DI 都是 Spring 框架中的重要概念,就像玫瑰花与爱情一样,IoC 和 DI 通常情况下也是成…

MyBatis整合Spring的实现(13)

2019独角兽企业重金招聘Python工程师标准>>> 本章中分析insert元素的解析。 1 配置文件 <insert id"insert" parameterType"cn.vansky.schedule.time.menu.bo.Menu"><!--WARNING - mbggeneratedThis element is automatically generat…

python 生成对称矩阵_对称矩阵| 使用Python的线性代数

python 生成对称矩阵Prerequisites: 先决条件&#xff1a; Defining a matrix 定义矩阵 Identity matrix 身份矩阵 Transpose matrix 转置矩阵 In linear algebra, if the matrix and its transpose are equal, then the matrix is symmetric (MT M). 在线性代数中&#xff0…

麻了,代码改成多线程,竟有9大问题

很多时候&#xff0c;我们为了提升接口的性能&#xff0c;会把之前单线程同步执行的代码&#xff0c;改成多线程异步执行。比如&#xff1a;查询用户信息接口&#xff0c;需要返回用户基本信息、积分信息、成长值信息&#xff0c;而用户、积分和成长值&#xff0c;需要调用不同…

Javascript 事件冒泡处理

js中子节点和父节点有相同的事件,怎么只触发子节点的事件 方法一、在子节点触发事件里加上阻止冒泡$("p").click(function(event){ event.stopPropagation(); // do something }); 原生的类似 只是不同浏览器有些不同方法二、在父节点触发事件里加上阻止冒泡…

PHP rewinddir()函数与示例

PHP rewinddir()函数 (PHP rewinddir() function) rewinddir() function is used to rewind/reset the directory handle which is created by the opendir() function. rewinddir()函数用于后退/重置由opendir()函数创建的目录句柄。 Syntax: 句法&#xff1a; rewinddir(di…

浅聊一下线程池的10个坑

日常开发中&#xff0c;为了更好管理线程资源&#xff0c;减少创建线程和销毁线程的资源损耗&#xff0c;我们会使用线程池来执行一些异步任务。但是线程池使用不当&#xff0c;就可能会引发生产事故。今天跟大家聊聊线程池的10个坑。大家看完肯定会有帮助的~线程池默认使用无界…

Linux命令行上执行操作,不退回命令行的解决方法

问题描述&#xff1a; 如果你现在登录Centos执行了某个操作&#xff0c;但是操作一直占用命令行&#xff0c;命令行显示的也都是这个命令相关的操作&#xff0c;我想做其它事情 &#xff0c;该怎么办呢 &#xff1f; 解决方法&#xff1a; 根据《Linux命令行与Shell编程大全第2…

python 当日日期_Python程序寻找当日赢家

python 当日日期Problem statement: 问题陈述&#xff1a; There are two basketball teams (Team1 and Team2) in a school and they play some matches every day depending on their time and interest. Some days they play 3 matches, some days 2, some days 1, etc. 一…

SpringBoot 读取配置文件的 5 种方法!

作者 | 磊哥来源 | Java面试真题解析&#xff08;ID&#xff1a;aimianshi666&#xff09;转载请联系授权&#xff08;微信ID&#xff1a;GG_Stone&#xff09;Spring Boot 中读取配置文件有以下 5 种方法&#xff1a;使用 Value 读取配置文件。使用 ConfigurationProperties 读…