try to finish stp report
BIN
2_stp/main.pdf
@ -1,15 +1,15 @@
|
||||
#import "labtemplate.typ": *
|
||||
#show: nudtlabpaper.with(title: "生成树协议(STP)配置",
|
||||
author: "王李烜",
|
||||
id: "202202001046",
|
||||
author: "程景愉",
|
||||
id: "202302723005",
|
||||
training_type: "无军籍",
|
||||
grade: "2022",
|
||||
grade: "2023",
|
||||
major: "网络工程",
|
||||
department: "计算机学院",
|
||||
advisor: "张军",
|
||||
jobtitle: "工程师",
|
||||
lab: "306-707",
|
||||
date: "2024.11.07",
|
||||
date: "2025.09.19",
|
||||
header_str: "《网络工程》实验报告",
|
||||
)
|
||||
#set page(header: [
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#show heading: it => box(width: 100%)[
|
||||
#v(0.50em)
|
||||
#set text(font: hei)
|
||||
#set text(font: "Noto Sans CJK SC")
|
||||
#it.body
|
||||
]
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
#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
|
||||
@ -70,7 +70,6 @@
|
||||
- 备用端口(Alternate Port/Backup Port):备用端口是指那些既不是根端口也不是指定端口的端口。这些端口在STP中被阻塞,不参与数据的转发,但它们仍然会接收BPDU,以便于在网络拓扑发生变化时,可以快速转变为根端口或指定端口,从而提供链路的备份。
|
||||
]
|
||||
=== STP算法的步骤
|
||||
#para[
|
||||
生成树算法有三个步骤,下面以@原始有环拓扑 为例,说明STP的工作原理。
|
||||
#figure(image("原始有环拓扑.jpg",format: "png",fit:"stretch",width: 25%),caption: "原始有环拓扑")<原始有环拓扑>
|
||||
+ 选举根交换机
|
||||
@ -104,13 +103,13 @@
|
||||
caption: "链路带宽的成本"
|
||||
)
|
||||
例如,一系列千兆网口组成的路径,每经过一个设备的成本就是4。成本最小的口就是根端口。
|
||||
#figure(image("线路成本.jpg",format: "png",fit:"stretch",width: 45%),caption: "链路成本示例")<链路成本>
|
||||
#figure(image("线路成本.jpg", format: "png", 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: "png", 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: "png", fit:"stretch",width: 65%),caption: "对端PID最小")<对端PID最小>
|
||||
此处的PID优先级都是默认值,为128。而Fa0/1比Fa0/2小,所以Fa0/1被选举成为了根端口RP。
|
||||
|
||||
+ 选举指定端口并阻塞备用端口AP
|
||||
@ -122,7 +121,6 @@
|
||||
- BPDU转发端口到根交换机的路径成本最小的是指定端口DP。例如D、E之间的两条链路,D到A的成本更低,所以在这两条链路上,DP均在D交换机处。
|
||||
选举完指定端口,剩余端口就成了备用端口AP(Alternate Port),将他们阻塞(Block)掉,即可在所有交换机之间形成一条无环的链路。
|
||||
#figure(image("成品图.jpg",format: "jpg",fit:"stretch",width: 40%),caption: "最终形成的链路拓扑(绿色粗线为连通的链路)")<成品图>
|
||||
]
|
||||
== BPDU保护
|
||||
#para[
|
||||
如果有人伪造RST BPDU恶意攻击交换设备,当边缘端口接收到该报文时,会自动设置为非边缘端口,并重新进行生成树计算,引起网络震荡。配置BPDU保护功能后,如果边缘端口收到BPDU报文,边缘端口将会被立即关闭,防止网络中的恶意攻击。
|
||||
@ -139,7 +137,6 @@
|
||||
网工系的宿舍楼中有一套局域网,各个寝室里有一些PC,寝室之间有几台交换机,PC和交换机之间通过网线连接。网工系学生热爱学习,经常开展研讨会,研究学术问题。在要求熄灯就寝之后,网工系学生不能出寝室门,于是他们在寝室的PC上开视频研讨会,继续讨论学术问题。为了提高网络的可靠性,他们在交换机之间安装了一些了冗余备份链路。但这会形成环路,报文可能在环形网络中不断循环,设备由于重复接收相同的报文,处理能力会下降。所以他们还需要在交换机上配置生成树协议,将环形网络结构修剪成无环路的树形网络结构。
|
||||
]
|
||||
== 实验设备
|
||||
#para[
|
||||
#align(center)[#table(
|
||||
columns: (auto, auto,auto),
|
||||
rows:(2em,2em,3em),
|
||||
@ -152,20 +149,16 @@
|
||||
"PC", "联想启天M410
|
||||
Windows 10", "2",
|
||||
)]
|
||||
|
||||
另有网线若干,控制线1条。
|
||||
]
|
||||
= 实验步骤及结果
|
||||
== 实验拓扑
|
||||
#para[
|
||||
按实验背景,绘制拓扑图如下:
|
||||
#figure(image("实验拓扑.png",format: "png",fit:"stretch",width: 60%),caption: "实验拓扑图")<实验拓扑>
|
||||
要求在配置好各个端口的路径开销值之后,运行STP能将@实验拓扑 中的Blocked Port端口阻塞。
|
||||
]
|
||||
== 按照拓扑图接线
|
||||
#para[
|
||||
按照拓扑图接线。
|
||||
#figure(image("接线图.png",format: "jpg",fit:"stretch",width: 80%),caption: "接线图")
|
||||
]
|
||||
#figure(image("接线图.jpg", fit:"stretch",width: 80%),caption: "接线图")
|
||||
== 配置PC
|
||||
#para[
|
||||
设置319寝室的IP地址为`192.168.3.19`;319寝室的IP地址为`192.168.3.12`。
|
||||
@ -173,36 +166,26 @@
|
||||
== 配置STP
|
||||
#para[下列许多步骤在LSW1、LSW2、LSW3和LSW4上都有相同的操作,这里只列出*LSW2*上的操作步骤。]
|
||||
=== 配置STP工作模式
|
||||
#para[
|
||||
配置环网中的设备生成树协议工作在STP模式:
|
||||
#figure(image("step0.png",format: "png",fit:"stretch",width: 100%),caption: "配置STP工作模式")
|
||||
]
|
||||
=== 配置根桥和备份根桥设备
|
||||
#para[
|
||||
配置根桥设备为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")
|
||||
]
|
||||
=== 配置端口路径开销
|
||||
#para[
|
||||
配置端口的路径开销值:
|
||||
#figure(image("step3.png",format: "png",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口路径开销")
|
||||
|
||||
]
|
||||
=== 使能STP破除环路
|
||||
#para[
|
||||
- 将与PC机相连的端口设置为边缘端口。配置LSW2:
|
||||
#figure(image("step5.png",format: "png",fit:"stretch",width: 70%),caption: "配置LSW2边缘端口")
|
||||
配置LSW3的g0/0/1口为边缘端口,并启用BPDU保护功能:
|
||||
#figure(image("step6.png",format: "png",fit:"stretch",width: 70%),caption: "配置LSW3边缘端口并启用BPDU保护")
|
||||
- 设备全局使能STP:
|
||||
#figure(image("step7.png",format: "png",fit:"stretch",width: 30%),caption: "全局使能STP")
|
||||
]
|
||||
== 实验结果验证
|
||||
=== 查看各交换机端口状态
|
||||
#para[
|
||||
配置完成后,查看各个交换机的端口状态,确认生成树协议已经生效。
|
||||
在LSW1上执行display stp brief命令,查看端口状态和端口的保护类型,结果如下:
|
||||
#figure(image("lsw1dis.jpg",format: "jpg",fit:"stretch",width: 75%),caption: "查看LSW1的STP状态")
|
||||
@ -215,13 +198,10 @@
|
||||
在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*。
|
||||
]
|
||||
=== 查看网络连通性
|
||||
#para[
|
||||
在319寝室的PC1上执行ping命令,查看与312寝室PC2的网络连通性,结果如下:
|
||||
#figure(image("319ping312.jpg",format: "jpg",fit:"stretch",width: 70%),caption: "查看网络连通性")
|
||||
两台PC之间可以正常通信,网络连通性正常。至此,319与312寝室的学生可以在熄灯后继续通过视频研讨会进行学术讨论。
|
||||
]
|
||||
= 实验总结
|
||||
#para[
|
||||
本次实验通过配置生成树协议(STP),实现了对网络中的环路进行消除,保证了网络的稳定性和可靠性。通过实验,我掌握了生成树协议的基本概念和工作原理,学会了如何在网络设备上配置STP,理解了STP的防止环路、优化网络拓扑的功能。实验中,我通过实际操作,深入理解了STP在现代网络中的应用,提升了实践技能,为未来的网络工程职业生涯和专业认证考试打下了坚实基础。
|
||||
|
||||
BIN
2_stp/接线图.jpg
Normal file
|
After Width: | Height: | Size: 4.1 MiB |
BIN
2_stp/接线图.png
|
Before Width: | Height: | Size: 3.7 MiB |
BIN
photo_stp/{0975C600-8272-4D00-A389-E94B3FEE6B49}.png.jpg
Executable file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
photo_stp/{18DFCE58-DF30-434A-A0E8-05DAFB5E39B9}.png.jpg
Executable file
|
After Width: | Height: | Size: 272 KiB |
BIN
photo_stp/{30F63191-A3A7-4587-AAF3-5DD4F7E4FAA7}.png.jpg
Executable file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
photo_stp/{35B20A12-36C1-4360-A7D2-CCD51F892B3A}.png.jpg
Executable file
|
After Width: | Height: | Size: 35 KiB |
BIN
photo_stp/{41D1AF82-0E56-4D64-B564-52D97032A255}.png.jpg
Executable file
|
After Width: | Height: | Size: 27 KiB |
BIN
photo_stp/{43DEE3C9-E4FD-433F-8786-182D6C9FE9D5}.png.jpg
Executable file
|
After Width: | Height: | Size: 40 KiB |
BIN
photo_stp/{56E9443F-DE49-4C8B-8CD6-7CC46635F914}.png.jpg
Executable file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
photo_stp/{5911B281-E304-4DA1-AB5F-47C31DFF4193}.png.jpg
Executable file
|
After Width: | Height: | Size: 12 KiB |
BIN
photo_stp/{653BDDD9-E9A6-4D8B-8B55-86C53B2EA17F}.png.jpg
Executable file
|
After Width: | Height: | Size: 20 KiB |
BIN
photo_stp/{663CA274-F51D-4FC7-8E4D-1313E54495DE}.png.jpg
Executable file
|
After Width: | Height: | Size: 91 KiB |
BIN
photo_stp/{69E67CC3-CDE8-4CD4-B050-AEA7CA774DDB}.png.jpg
Executable file
|
After Width: | Height: | Size: 39 KiB |
BIN
photo_stp/{782F1BEA-6957-4697-A47B-96E5DF42C8B2}.png.jpg
Executable file
|
After Width: | Height: | Size: 29 KiB |
BIN
photo_stp/{7DB9C774-E750-4764-98C4-1F83966D88AA}.png.jpg
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
photo_stp/{E139E040-ECCB-469C-AA0B-9408ED7F6B70}.png.jpg
Executable file
|
After Width: | Height: | Size: 21 KiB |
BIN
photo_vlan/PXL_20250922_130436139.jpg
Normal file
|
After Width: | Height: | Size: 4.3 MiB |
BIN
photo_vlan/{00AED3B1-C3C7-4F41-A9C1-C48404091C8A}.png.jpg
Executable file
|
After Width: | Height: | Size: 84 KiB |
BIN
photo_vlan/{0D8C719B-229B-4CDE-9188-EE6A4543E02E}.png.jpg
Executable file
|
After Width: | Height: | Size: 62 KiB |
BIN
photo_vlan/{16F8336B-3049-4FC6-8B05-E7DE9BDE7C6A}.png.jpg
Executable file
|
After Width: | Height: | Size: 17 KiB |
BIN
photo_vlan/{1FC31A39-4AAD-4304-86BB-08C30BF8EA01}.png.jpg
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
photo_vlan/{4341204F-84BD-4945-A61D-CC45303CE07C}.png.jpg
Executable file
|
After Width: | Height: | Size: 17 KiB |
BIN
photo_vlan/{62BCD4B7-3ACC-491C-9BC2-C7948D6327CA}.png.jpg
Executable file
|
After Width: | Height: | Size: 103 KiB |
BIN
photo_vlan/{8BDAA04D-1AEA-4340-9CF4-8B54EDE72B8F}.png.jpg
Executable file
|
After Width: | Height: | Size: 73 KiB |
BIN
photo_vlan/{9393B566-4574-4159-B265-05D189762E0E}.png.jpg
Executable file
|
After Width: | Height: | Size: 41 KiB |
BIN
photo_vlan/{97E13FEF-B870-45CD-BD0A-A791150E9311}.png.jpg
Executable file
|
After Width: | Height: | Size: 156 KiB |
BIN
photo_vlan/{A63E2BD1-2E62-4FAE-BCB3-0303DD9A1A2E}.png.jpg
Executable file
|
After Width: | Height: | Size: 64 KiB |
BIN
photo_vlan/{ABC6D994-E220-48BC-B69A-BAD516C6931E}.png.jpg
Executable file
|
After Width: | Height: | Size: 248 KiB |
BIN
photo_vlan/{AC91FD74-0E57-4B3D-A5A1-37DF940E7911}.png.jpg
Executable file
|
After Width: | Height: | Size: 34 KiB |
BIN
photo_vlan/{D2AE92A2-5199-4B06-85B3-F826C8D452A0}.png.jpg
Executable file
|
After Width: | Height: | Size: 424 KiB |
BIN
photo_vlan/{F1D1F53F-4F75-4214-A04E-F15D4EEB407E}.png.jpg
Executable file
|
After Width: | Height: | Size: 101 KiB |