小白网-奉贤部落-奉贤免费信息发布平台

查看: 78|回复: 0

计较机是若何拜候一个网页的?vlan间若何实现通讯?

[复制链接]

2万

主题

0

回帖

8万

积分

论坛元老

Rank: 8Rank: 8

积分
88256
发表于 2025-7-26 14:03 | 显示全部楼层 |阅读模式
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">昨天我们公布了关于一文讲弄懂什么是vlan、三层交换机、网关、子网掩码,有很多朋友问到关于收集通讯的道理,明天我们这一篇文章,算是对昨天文章停止一个补充他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">首先我们要拜候互联网,必须自己电脑上面有ip地址、子网掩码、网关、dns,这四样缺一不成他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(1)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">有了这四样,我们才具有拜候收集的根基条件他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">那末若何拜候收集呢?完成收集通讯呢?这里面我们举二个例子,便可以领会清楚了他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">一、阅读器拜候一个网页的通讯进程
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">假定我们需要翻开弱电行业网官方网站,域名为www.rdhyw.com他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第一步:域名剖析,快速定位方针地址
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">互联网的通讯是经过ip地址的,域名只是一个代号他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">我们晓得了域名,可是不晓得ip地址,所以翻开阅读器,输入弱电行业网域名www.rdhyw.com,阅读器会利用DNS协议他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">DNS协议中,先向当地DNS办事器寻觅,通常为路由器,希望从当地DNS办事器那边获得主机名对应的IP,能获得就获得,得不到还得向更高条理的DNS办事器乞助,直到剖析出主机名对应的IP他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">找到后,就告诉我们弱电行业网的IP地址是172.194.72.104他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。因而,我们晓得了IP地址他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第二步:打包报文,让对方领会你的请求
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">在获到ip地址后,阅读器将你拜候弱电行业网的请求打包成http报文,然后将请求报文与弱电行业网的办事器ip地址发送给一个叫的tcp进程他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">tcp是啥呢?我们常看到是TCP/IP协议,也就是传输控制协议,干的是相当于数据传输治理员的工作,有一套控制着数据的传输与接收的标准,过了他这关,你才能传输他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第三步:http触发tcp三次握手,建立根基信赖
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">当tcp接收到发来的ip地址与办事器的拜候请求时,就感受很忽然,这个请求安不服安?靠不靠谱,因而就需要考证下,怎样考证呢?建立三次握手他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">因而tcp供给一条平安的通道,你俩先建立根基的熟悉与毗连,相互蛊惑下他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(2)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">因而就:
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第一次握手:用户——>办事器:弱电行业网,在吗,我想拜候你,听到请回答他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第二次握手:办事器——>用户:老铁,在的,可以拜候,你听获得我吗?
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第三次握手:用户——>办事器:好的,我也听获得你,那我就拜候你了他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">实在进程就是相当于,你要登门造访一小我,你得先在电话里最少要交换这三个回合,才能肯定你可以去造访他他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第四步:tcp传输http,正式建立毗连
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">在经过了三次握手,tcp感受晓得你俩的关系后,晓得你是弱电行业网粉丝,因而就帮你们建立毗连他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">首先tcp正式将你请求打包一个ip包,里面包括你请求的ip地址与一个加密序列号,假定序列号为3567,发送给弱电行业网的办事器他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">然后办事器收到请求的ip包后,也答复给用户一个ip包,告诉你,我收到了你的请求了,你请求拜候的ip地址是对的,也收到序列号了他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">最初,双方都确认后,就起头传输网页了他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第五步:网页传给用户
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">一切的都商量好了, 弱电行业网办事器起头把自己的主页内容,也就是网页内容传给用户,也就是下图内容,这个就是我们终极所看到的网页他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(3)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">二、vlan间的通讯道理
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">vlan是我们收集合最多见,关于vlan的通讯是若何实现的呢?领会vlan的通讯道理,有助于我们更好利用vlan他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第一种:同一个vlan的通讯
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(4)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">交换机经过对各端口所连计较机MAC地址的进修,天生以下的MAC地址列表他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(5)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">那末计较机A与同一VLAN内的计较机B之间通讯若何停止通讯呢?
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">计较机A发出ARP请求信息,请求剖析B的MAC地址他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">交换机收到数据帧后,检索MAC地址列表中与收信端口同属一个VLAN的表项他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。成果发现,计较机B毗连在端口2上,因而交换机将数据帧转发给端口2,终极计较机B收到该帧他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。收发信双方同属一个VLAN之内的通讯,一切处置均在交换机内完成,道理比力简单他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">这里简单补充下,什么是arp?
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">ARP就是地址剖析协议,可以操纵ip地址找到网卡的物理地址他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第二种:分歧vlan间若何完成通讯

seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">接下来是这一讲的焦点内容,分歧VLAN间的通讯他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。分歧vlan间的通讯就需要有路由功用,一般我们是三层交换机他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">让我们来看下一下计较机A与计较机C之间通讯时的情况他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(6)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">红色是VLAN1,计较机A,收集地址为192.168.1.0/24他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">蓝色是VLAN2,计较机B,收集地址为192.168.2.0/24他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第一步:判定计较机A与计较机B能否在同一个vlan中
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">计较机A将自己的子网掩码与计较机C的ip地址停止&运算后,发现这他们不在同一个vlan,那末若何实现通讯呢?
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第二步:获到路由器的mac地址后,封装数据包
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">在肯定计较机A与计较机C不在同一个vlan后,计较机A是以会向设定的默许网关转发数据包他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。在发送数据帧之前,计较机A需要先用ARP获得路由器的MAC地址他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">然后计较机A封装好自己的IP地址和MAC地址,同时也封装好方针主机B的IP地址和路由器的MAC地址,封装成数据包他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。如图数据①他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(7)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第三步:数据包发送给路由模块,表白身份
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">接下来就是按图中发送往计较机C去的数据包他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">交换机经过检索MAC地址列表后,经过内部会聚链接,将数据包转发给路由模块他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。在经过内部会聚链路时,数据包被附加了属于红色VLAN1的标识,如图中数据包②他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(8)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">也就是交换机的路由晓得了,这是vlan1发来的数据,这步就是将主机A的身份停止识别,打个标签,他是vlan的主机他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第四步:告诉交换机路由模块自己意图
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">接着,按照路由器内部的路由表,判定该向那里中继他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">由于方针收集192.168.2.0/24是直连路由器的收集、且对应蓝色VLAN2;是以,接下来就会从蓝色VLAN接口经过内部会聚链路转发回交换机他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。在经过会聚链路时,此次数据包被附加上属于蓝色VLAN2的识别信息,这时,数据包的方针MAC地址被改写成计较机C的方针地址,如图数据包③他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(9)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">seline; word-break: break-word;">第五步:实现通讯
seline; word-break: break-word; color: rgb(93, 93, 93); white-space: normal;">交换机收到这个帧后,检索蓝色VLAN2的MAC地址列表,确认需要将它转发给端口3他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。由于端口3是凡是的拜候链接,是以转发前会先将VLAN识别信息去除(如图数据包④)他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。终极,计较机C成功地收到交换机转发来的数据他早就发现系统有个隐藏的缝隙私下花了好几个早晨优化了代码。
seline; word-break: break-word; color: rgb(93, 93, 93); overflow-wrap: break-word; white-space: normal;">
小白网-计较机是若何拜候一个网页的?vlan间若何实现通讯?(10)
seline; word-break: break-word; display: block; max-width: 100%; border-radius: 4px;"/>seline; word-break: break-word; position: relative; color: rgb(153, 153, 153); overflow: hidden;">
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|小白网-奉贤部落-奉贤免费信息发布平台  

GMT+8, 2025-11-8 22:29 , Processed in 0.778282 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表