diff --git a/2_stp/lsw1dis.jpg b/2_stp/lsw1dis.jpg old mode 100644 new mode 100755 index f0133d0..ca317d2 Binary files a/2_stp/lsw1dis.jpg and b/2_stp/lsw1dis.jpg differ diff --git a/2_stp/lsw2dis.jpg b/2_stp/lsw2dis.jpg old mode 100644 new mode 100755 index 63ad97b..795cffc Binary files a/2_stp/lsw2dis.jpg and b/2_stp/lsw2dis.jpg differ diff --git a/2_stp/lsw3dis.jpg b/2_stp/lsw3dis.jpg old mode 100644 new mode 100755 index cc3f32f..e496f14 Binary files a/2_stp/lsw3dis.jpg and b/2_stp/lsw3dis.jpg differ diff --git a/2_stp/lsw4dis.jpg b/2_stp/lsw4dis.jpg old mode 100644 new mode 100755 index b1ec9dd..66f603e Binary files a/2_stp/lsw4dis.jpg and b/2_stp/lsw4dis.jpg differ diff --git a/2_stp/main.typ b/2_stp/main.typ index 63e584a..176baa5 100644 --- a/2_stp/main.typ +++ b/2_stp/main.typ @@ -71,7 +71,7 @@ ] === STP算法的步骤 生成树算法有三个步骤,下面以@原始有环拓扑 为例,说明STP的工作原理。 - #figure(image("原始有环拓扑.jpg",format: "png",fit:"stretch",width: 25%),caption: "原始有环拓扑")<原始有环拓扑> + #figure(image("原始有环拓扑.jpg",format: "jpg",fit:"stretch",width: 25%),caption: "原始有环拓扑")<原始有环拓扑> + 选举根交换机 拓扑中,BID最小者当选。 @@ -103,13 +103,13 @@ caption: "链路带宽的成本" ) 例如,一系列千兆网口组成的路径,每经过一个设备的成本就是4。成本最小的口就是根端口。 - #figure(image("线路成本.jpg", format: "png", fit:"stretch",width: 45%),caption: "链路成本示例")<链路成本> + #figure(image("线路成本.jpg", format: "jpg", fit:"stretch",width: 45%),caption: "链路成本示例")<链路成本> 如@链路成本,A是根交换机,从B、C的G0/1口到A的成本值均为4,所以它们都被选为根端口。但是D的G0/1与G0/2口成本值都是4+4=8,成本值相同,则还需要进行网桥ID的比较。 - 对端的网桥ID(BID)最小。如上文所述,@链路成本 这种情况中D到A的无论哪条路成本都是8,则需要继续比较双方中哪个接口的对端BID更小。 - #figure(image("对端BID最小.jpg", format: "png", fit:"stretch",width: 80%),caption: "对端BID最小")<对端BID最小> + #figure(image("对端BID最小.jpg", format: "jpg", fit:"stretch",width: 80%),caption: "对端BID最小")<对端BID最小> B是00-06,C是00-05,即对端C的BID更小,所以D的G0/2被选举为了根端口。 - 对端的端口ID(PID)最小。在最后,如果路径成本和网桥ID都相同,则还要比较端口ID的大小。 - #figure(image("对端PID最小.jpg",format: "png", fit:"stretch",width: 65%),caption: "对端PID最小")<对端PID最小> + #figure(image("对端PID最小.jpg",format: "jpg", fit:"stretch",width: 65%),caption: "对端PID最小")<对端PID最小> 此处的PID优先级都是默认值,为128。而Fa0/1比Fa0/2小,所以Fa0/1被选举成为了根端口RP。 + 选举指定端口并阻塞备用端口AP @@ -134,7 +134,14 @@ = 实验环境 == 实验背景 #para[ - 网工系的宿舍楼中有一套局域网,各个寝室里有一些PC,寝室之间有几台交换机,PC和交换机之间通过网线连接。网工系学生热爱学习,经常开展研讨会,研究学术问题。在要求熄灯就寝之后,网工系学生不能出寝室门,于是他们在寝室的PC上开视频研讨会,继续讨论学术问题。为了提高网络的可靠性,他们在交换机之间安装了一些了冗余备份链路。但这会形成环路,报文可能在环形网络中不断循环,设备由于重复接收相同的报文,处理能力会下降。所以他们还需要在交换机上配置生成树协议,将环形网络结构修剪成无环路的树形网络结构。 + 某公司购置了 4 台交换机,组建网络。考虑到网络的可靠性,将 4 台交换机如 +图 Figure 6 所示拓扑搭建。由于默认情况下,交换机之间运行 STP 后,根交换机、根端 +口、指定端口的选择将基于交换机的 MAC 地址的大小,因此带来了不确定性,极 +可能由此产生隐患。公司网络规划,需要 S1 作为主根交换机,S2 作为 S1 的备份根 +交换机。同时对于 S4 交换机,E0/0/1 接口应该作为根端口。对于 S2 和 S3 之间的 +链路,应该保证 S2 的 E0/0/3 接口作为指定端口。同时在交换机 S3 上,存在两个接 +口 E0/0/10、E0/0/11 连接到测试 PC,测试 PC 经常上下线网络,需要将交换机 S3 与 +之相连的对应端口定义为边缘端口,避免测试电脑上下线对网络产生的影响。 ] == 实验设备 #align(center)[#table( @@ -158,57 +165,63 @@ 要求在配置好各个端口的路径开销值之后,运行STP能将@实验拓扑 中的Blocked Port端口阻塞。 == 按照拓扑图接线 按照拓扑图接线。 - #figure(image("接线图.jpg", fit:"stretch",width: 80%),caption: "接线图") + #figure(image("接线图.jpg", format: "jpg" ,fit:"stretch",width: 80%),caption: "接线图") == 配置PC #para[ - 设置319寝室的IP地址为`192.168.3.19`;319寝室的IP地址为`192.168.3.12`。 + 设置两台PC的IP地址分别为`10.130.81.211`和`10.130.81.203`。 ] == 配置STP #para[下列许多步骤在LSW1、LSW2、LSW3和LSW4上都有相同的操作,这里只列出*LSW2*上的操作步骤。] === 配置STP工作模式 配置环网中的设备生成树协议工作在STP模式: - #figure(image("step0.png",format: "png",fit:"stretch",width: 100%),caption: "配置STP工作模式") + #figure(image("step0.png",format: "jpg",fit:"stretch",width: 100%),caption: "配置STP工作模式") === 配置根桥和备份根桥设备 配置根桥设备为LSW1,备份根桥设备为LSW4: - #figure(image("step1.png",format: "png",fit:"stretch",width: 35%),caption: "配置根桥LSW1") - #figure(image("step2.png",format: "png",fit:"stretch",width: 60%),caption: "配置备份根桥LSW4") + #figure(image("step1.png",format: "jpg",fit:"stretch",width: 35%),caption: "配置根桥LSW1") + #figure(image("step2.png",format: "jpg",fit:"stretch",width: 60%),caption: "配置备份根桥LSW4") === 配置端口路径开销 配置端口的路径开销值: - #figure(image("step3.png",format: "png",fit:"stretch",width: 60%),caption: "配置端口路径开销") + #figure(image("step3.png",format: "jpg",fit:"stretch",width: 60%),caption: "配置端口路径开销") 特别地,LSW3的g0/0/1口的路径开销值为20000: - #figure(image("step4.png",format: "png",fit:"stretch",width: 70%),caption: "配置LSW3的g0/0/1口路径开销") + #figure(image("step4.png",format: "jpg",fit:"stretch",width: 70%),caption: "配置LSW3的g0/0/1口路径开销") === 使能STP破除环路 - - 将与PC机相连的端口设置为边缘端口。配置LSW2: - #figure(image("step5.png",format: "png",fit:"stretch",width: 70%),caption: "配置LSW2边缘端口") + - 将与PC机相连的端口设置为边缘端口: + #figure(image("step5.png",format: "jpg",fit:"stretch",width: 70%),caption: "配置LSW3边缘端口") 配置LSW3的g0/0/1口为边缘端口,并启用BPDU保护功能: - #figure(image("step6.png",format: "png",fit:"stretch",width: 70%),caption: "配置LSW3边缘端口并启用BPDU保护") + #figure(image("step6.png",format: "jpg",fit:"stretch",width: 70%),caption: "配置LSW3边缘端口并启用BPDU保护") - 设备全局使能STP: - #figure(image("step7.png",format: "png",fit:"stretch",width: 30%),caption: "全局使能STP") + #figure(image("step7-1.png",format: "jpg",fit:"stretch",width: 30%),caption: "全局使能STP") == 实验结果验证 === 查看各交换机端口状态 配置完成后,查看各个交换机的端口状态,确认生成树协议已经生效。 在LSW1上执行display stp brief命令,查看端口状态和端口的保护类型,结果如下: #figure(image("lsw1dis.jpg",format: "jpg",fit:"stretch",width: 75%),caption: "查看LSW1的STP状态") - 将LSW1配置为根桥后,与LSW2、LSW4相连的端口g0/0/2和g0/0/1在生成树计算中被选举为指定端口。 + 将LSW1配置为根桥后,与LSW2、LSW3相连的端口g0/0/1和g0/0/2在生成树计算中被选举为指定端口。 在LSW2上执行display stp interface g0/0/1 brief命令,查看端口g0/0/1状态,结果如下: #figure(image("lsw2dis.jpg",format: "jpg",fit:"stretch",width: 80%),caption: "查看LSW2的g0/0/1端口状态") - 端口g0/0/1在生成树选举中成为指定端口,处于*FORWARDING*状态。 + 端口g0/0/3在生成树选举中成为指定端口,处于*FORWARDING*状态。端口g0/0/2在生成树选举中成为Alternate端口,处于*DISCARDING*状态。 在LSW3上执行display stp brief命令,查看端口状态,结果如下: #figure(image("lsw3dis.jpg",format: "jpg",fit:"stretch",width: 80%),caption: "查看LSW3") - 端口g0/0/3在生成树选举中成为根端口,处于*FORWARDING*状态;端口g0/0/1在生成树选举中成为Alternate端口,处于*DISCARDING*状态。此外,由于我们配置了BPDU保护,g0/0/1状态的Protection字段显示为*BDPU*。 + 端口g0/0/2在生成树选举中成为根端口,处于*FORWARDING*状态。此外,由于我们配置了BPDU保护,g0/0/10状态的Protection字段显示为*BDPU*。 + + 在LSW4上执行display stp brief命令,查看端口状态,结果如下: + #figure(image("lsw4dis.jpg",format: "jpg",fit:"stretch",width: 80%),caption: "查看LSW4") + 端口g0/0/1在生成树选举中成为根端口,处于*FORWARDING*状态;端口g0/0/2在生成树选举中成为 Alternate 端口,处于*DISCARDING*状态; === 查看网络连通性 - 在319寝室的PC1上执行ping命令,查看与312寝室PC2的网络连通性,结果如下: - #figure(image("319ping312.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "查看网络连通性") - 两台PC之间可以正常通信,网络连通性正常。至此,319与312寝室的学生可以在熄灯后继续通过视频研讨会进行学术讨论。 + 在IP地址为`10.130.81.211`的PC上执行ping命令,查看与IP地址为`10.130.81.203`的PC的网络连通性,结果如下: + #figure(image("ping.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "查看网络连通性") + 可见两台PC之间可以正常通信,网络连通性正常。 +=== 实验评测 + 经过教辅学长亲自测试,S2与S3以及S2与S4之间的链路断开后,网络依然可以正常通信,各交换机`display stp brief`显示结果正常,说明STP配置成功,网络环路被成功破除。 = 实验总结 #para[ 本次实验通过配置生成树协议(STP),实现了对网络中的环路进行消除,保证了网络的稳定性和可靠性。通过实验,我掌握了生成树协议的基本概念和工作原理,学会了如何在网络设备上配置STP,理解了STP的防止环路、优化网络拓扑的功能。实验中,我通过实际操作,深入理解了STP在现代网络中的应用,提升了实践技能,为未来的网络工程职业生涯和专业认证考试打下了坚实基础。 ] #show heading: it => box(width: 100%)[ #v(0.50em) - #set text(font: hei) + #set text(font: "Noto Sans CJK SC") // #counter(heading).display() // #h(0.5em) #it.body diff --git a/photo_stp/{18DFCE58-DF30-434A-A0E8-05DAFB5E39B9}.png.jpg b/2_stp/ping.jpg similarity index 100% rename from photo_stp/{18DFCE58-DF30-434A-A0E8-05DAFB5E39B9}.png.jpg rename to 2_stp/ping.jpg diff --git a/2_stp/step0.png b/2_stp/step0.png old mode 100644 new mode 100755 index d170a9f..ebdfc27 Binary files a/2_stp/step0.png and b/2_stp/step0.png differ diff --git a/2_stp/step1.png b/2_stp/step1.png old mode 100644 new mode 100755 index b9ae62b..92e4d33 Binary files a/2_stp/step1.png and b/2_stp/step1.png differ diff --git a/2_stp/step2.png b/2_stp/step2.png old mode 100644 new mode 100755 index cb941f1..58a0a2e Binary files a/2_stp/step2.png and b/2_stp/step2.png differ diff --git a/2_stp/step3.png b/2_stp/step3.png old mode 100644 new mode 100755 index 0f0f555..26adb74 Binary files a/2_stp/step3.png and b/2_stp/step3.png differ diff --git a/2_stp/step4.png b/2_stp/step4.png old mode 100644 new mode 100755 index 22cc380..4da89cf Binary files a/2_stp/step4.png and b/2_stp/step4.png differ diff --git a/2_stp/step5.png b/2_stp/step5.png old mode 100644 new mode 100755 index 375b269..93489ec Binary files a/2_stp/step5.png and b/2_stp/step5.png differ diff --git a/2_stp/step6.png b/2_stp/step6.png old mode 100644 new mode 100755 index 36fc28b..d57e1c6 Binary files a/2_stp/step6.png and b/2_stp/step6.png differ diff --git a/photo_stp/{5911B281-E304-4DA1-AB5F-47C31DFF4193}.png.jpg b/2_stp/step7-1.png similarity index 100% rename from photo_stp/{5911B281-E304-4DA1-AB5F-47C31DFF4193}.png.jpg rename to 2_stp/step7-1.png diff --git a/2_stp/step7.png b/2_stp/step7.png old mode 100644 new mode 100755 index ad0415c..73af192 Binary files a/2_stp/step7.png and b/2_stp/step7.png differ diff --git a/2_stp/原始有环拓扑.jpg b/2_stp/原始有环拓扑.jpg index dcae81a..8514825 100644 Binary files a/2_stp/原始有环拓扑.jpg and b/2_stp/原始有环拓扑.jpg differ diff --git a/2_stp/实验拓扑.png b/2_stp/实验拓扑.png index 133c3db..a8809cb 100644 Binary files a/2_stp/实验拓扑.png and b/2_stp/实验拓扑.png differ diff --git a/2_stp/对端BID最小.jpg b/2_stp/对端BID最小.jpg index 08f94af..6a1586a 100644 Binary files a/2_stp/对端BID最小.jpg and b/2_stp/对端BID最小.jpg differ diff --git a/2_stp/对端PID最小.jpg b/2_stp/对端PID最小.jpg index f0b779c..973d4b2 100644 Binary files a/2_stp/对端PID最小.jpg and b/2_stp/对端PID最小.jpg differ diff --git a/2_stp/成品图.jpg b/2_stp/成品图.jpg index 35de268..49c0dc4 100644 Binary files a/2_stp/成品图.jpg and b/2_stp/成品图.jpg differ diff --git a/2_stp/线路成本.jpg b/2_stp/线路成本.jpg index a755d50..7052d5d 100644 Binary files a/2_stp/线路成本.jpg and b/2_stp/线路成本.jpg differ diff --git a/photo_stp/{0975C600-8272-4D00-A389-E94B3FEE6B49}.png.jpg b/photo_stp/{0975C600-8272-4D00-A389-E94B3FEE6B49}.png.jpg deleted file mode 100755 index 92e4d33..0000000 Binary files a/photo_stp/{0975C600-8272-4D00-A389-E94B3FEE6B49}.png.jpg and /dev/null differ diff --git a/photo_stp/{30F63191-A3A7-4587-AAF3-5DD4F7E4FAA7}.png.jpg b/photo_stp/{30F63191-A3A7-4587-AAF3-5DD4F7E4FAA7}.png.jpg deleted file mode 100755 index 58a0a2e..0000000 Binary files a/photo_stp/{30F63191-A3A7-4587-AAF3-5DD4F7E4FAA7}.png.jpg and /dev/null differ diff --git a/photo_stp/{35B20A12-36C1-4360-A7D2-CCD51F892B3A}.png.jpg b/photo_stp/{35B20A12-36C1-4360-A7D2-CCD51F892B3A}.png.jpg deleted file mode 100755 index d57e1c6..0000000 Binary files a/photo_stp/{35B20A12-36C1-4360-A7D2-CCD51F892B3A}.png.jpg and /dev/null differ diff --git a/photo_stp/{41D1AF82-0E56-4D64-B564-52D97032A255}.png.jpg b/photo_stp/{41D1AF82-0E56-4D64-B564-52D97032A255}.png.jpg deleted file mode 100755 index 795cffc..0000000 Binary files a/photo_stp/{41D1AF82-0E56-4D64-B564-52D97032A255}.png.jpg and /dev/null differ diff --git a/photo_stp/{43DEE3C9-E4FD-433F-8786-182D6C9FE9D5}.png.jpg b/photo_stp/{43DEE3C9-E4FD-433F-8786-182D6C9FE9D5}.png.jpg deleted file mode 100755 index 93489ec..0000000 Binary files a/photo_stp/{43DEE3C9-E4FD-433F-8786-182D6C9FE9D5}.png.jpg and /dev/null differ diff --git a/photo_stp/{56E9443F-DE49-4C8B-8CD6-7CC46635F914}.png.jpg b/photo_stp/{56E9443F-DE49-4C8B-8CD6-7CC46635F914}.png.jpg deleted file mode 100755 index 73af192..0000000 Binary files a/photo_stp/{56E9443F-DE49-4C8B-8CD6-7CC46635F914}.png.jpg and /dev/null differ diff --git a/photo_stp/{653BDDD9-E9A6-4D8B-8B55-86C53B2EA17F}.png.jpg b/photo_stp/{653BDDD9-E9A6-4D8B-8B55-86C53B2EA17F}.png.jpg deleted file mode 100755 index ca317d2..0000000 Binary files a/photo_stp/{653BDDD9-E9A6-4D8B-8B55-86C53B2EA17F}.png.jpg and /dev/null differ diff --git a/photo_stp/{663CA274-F51D-4FC7-8E4D-1313E54495DE}.png.jpg b/photo_stp/{663CA274-F51D-4FC7-8E4D-1313E54495DE}.png.jpg deleted file mode 100755 index 4da89cf..0000000 Binary files a/photo_stp/{663CA274-F51D-4FC7-8E4D-1313E54495DE}.png.jpg and /dev/null differ diff --git a/photo_stp/{69E67CC3-CDE8-4CD4-B050-AEA7CA774DDB}.png.jpg b/photo_stp/{69E67CC3-CDE8-4CD4-B050-AEA7CA774DDB}.png.jpg deleted file mode 100755 index e496f14..0000000 Binary files a/photo_stp/{69E67CC3-CDE8-4CD4-B050-AEA7CA774DDB}.png.jpg and /dev/null differ diff --git a/photo_stp/{782F1BEA-6957-4697-A47B-96E5DF42C8B2}.png.jpg b/photo_stp/{782F1BEA-6957-4697-A47B-96E5DF42C8B2}.png.jpg deleted file mode 100755 index 26adb74..0000000 Binary files a/photo_stp/{782F1BEA-6957-4697-A47B-96E5DF42C8B2}.png.jpg and /dev/null differ diff --git a/photo_stp/{7DB9C774-E750-4764-98C4-1F83966D88AA}.png.jpg b/photo_stp/{7DB9C774-E750-4764-98C4-1F83966D88AA}.png.jpg deleted file mode 100755 index ebdfc27..0000000 Binary files a/photo_stp/{7DB9C774-E750-4764-98C4-1F83966D88AA}.png.jpg and /dev/null differ diff --git a/photo_stp/{E139E040-ECCB-469C-AA0B-9408ED7F6B70}.png.jpg b/photo_stp/{E139E040-ECCB-469C-AA0B-9408ED7F6B70}.png.jpg deleted file mode 100755 index 66f603e..0000000 Binary files a/photo_stp/{E139E040-ECCB-469C-AA0B-9408ED7F6B70}.png.jpg and /dev/null differ