Update 计算机网络 - 网络层.md
重新绘制 IP 首部、分片、分类地址、ARP、ICMP、VPN、NAT、路由器结构、分组转发和 BGP 的配图;ICMP 报文类型改为表格,补充最长前缀匹配的说明,VPN 示例的地址与新图一致。
|
After Width: | Height: | Size: 139 KiB |
|
After Width: | Height: | Size: 158 KiB |
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 155 KiB |
|
After Width: | Height: | Size: 141 KiB |
|
After Width: | Height: | Size: 178 KiB |
|
After Width: | Height: | Size: 175 KiB |
|
After Width: | Height: | Size: 205 KiB |
|
After Width: | Height: | Size: 174 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 161 KiB |
@@ -38,7 +38,7 @@
|
||||
|
||||
## IP 数据报格式
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/85c05fb1-5546-4c50-9221-21f231cdc8c5.jpg" width="700"/> </div><br>
|
||||
<div align="center"> <img src="pics/ip-header.png" width="720px"/> </div><br>
|
||||
|
||||
- **版本** : 有 4(IPv4)和 6(IPv6)两个值;
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
- **片偏移** : 和标识符一起,用于发生分片的情况。片偏移的单位为 8 字节。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/23ba890e-e11c-45e2-a20c-64d217f83430.png" width="700"/> </div><br>
|
||||
<div align="center"> <img src="pics/ip-fragment.png" width="780px"/> </div><br>
|
||||
|
||||
## IP 地址编址方式
|
||||
|
||||
@@ -74,7 +74,7 @@ IP 地址的编址方式经历了三个历史阶段:
|
||||
|
||||
IP 地址 ::= {\< 网络号 \>, \< 主机号 \>}
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/cbf50eb8-22b4-4528-a2e7-d187143d57f7.png" width="500"/> </div><br>
|
||||
<div align="center"> <img src="pics/ip-classes.png" width="740px"/> </div><br>
|
||||
|
||||
### 2. 子网划分
|
||||
|
||||
@@ -104,27 +104,33 @@ CIDR 的地址掩码可以继续称为子网掩码,子网掩码首 1 长度为
|
||||
|
||||
网络层实现主机之间的通信,而链路层实现具体每段链路之间的通信。因此在通信过程中,IP 数据报的源地址和目的地址始终不变,而 MAC 地址随着链路的改变而改变。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/66192382-558b-4b05-a35d-ac4a2b1a9811.jpg" width="700"/> </div><br>
|
||||
<div align="center"> <img src="pics/arp-hops.png" width="780px"/> </div><br>
|
||||
|
||||
ARP 实现由 IP 地址得到 MAC 地址。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/b9d79a5a-e7af-499b-b989-f10483e71b8b.jpg" width="500"/> </div><br>
|
||||
|
||||
每个主机都有一个 ARP 高速缓存,里面有本局域网上的各主机和路由器的 IP 地址到 MAC 地址的映射表。
|
||||
|
||||
如果主机 A 知道主机 B 的 IP 地址,但是 ARP 高速缓存中没有该 IP 地址到 MAC 地址的映射,此时主机 A 通过广播的方式发送 ARP 请求分组,主机 B 收到该请求后会发送 ARP 响应分组给主机 A 告知其 MAC 地址,随后主机 A 向其高速缓存中写入主机 B 的 IP 地址到 MAC 地址的映射。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/8006a450-6c2f-498c-a928-c927f758b1d0.png" width="700"/> </div><br>
|
||||
<div align="center"> <img src="pics/arp-request.png" width="760px"/> </div><br>
|
||||
|
||||
## 网际控制报文协议 ICMP
|
||||
|
||||
ICMP 是为了更有效地转发 IP 数据报和提高交付成功的机会。它封装在 IP 数据报中,但是不属于高层协议。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/e3124763-f75e-46c3-ba82-341e6c98d862.jpg" width="500"/> </div><br>
|
||||
<div align="center"> <img src="pics/icmp-format.png" width="640px"/> </div><br>
|
||||
|
||||
ICMP 报文分为差错报告报文和询问报文。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/aa29cc88-7256-4399-8c7f-3cf4a6489559.png" width="600"/> </div><br>
|
||||
| 类型 | 名称 | 种类 | 用途 |
|
||||
| --- | --- | --- | --- |
|
||||
| 0 | 回送回答 | 询问 | ping 收到的回答 |
|
||||
| 3 | 终点不可达 | 差错报告 | 主机、网络或端口不可达,Traceroute 到达终点时收到端口不可达 |
|
||||
| 5 | 改变路由(重定向) | 差错报告 | 路由器告诉主机有更好的下一跳 |
|
||||
| 8 | 回送请求 | 询问 | ping 发出的请求 |
|
||||
| 11 | 时间超过 | 差错报告 | TTL 减到 0 时由路由器发出,Traceroute 靠它得到沿途的路由器 |
|
||||
| 12 | 参数问题 | 差错报告 | 首部字段的值有错 |
|
||||
| 13、14 | 时间戳请求、回答 | 询问 | 很少使用 |
|
||||
|
||||
### 1. Ping
|
||||
|
||||
@@ -155,9 +161,9 @@ Traceroute 发送的 IP 数据报封装的是无法交付的 UDP 用户数据报
|
||||
|
||||
VPN 使用公用的互联网作为本机构各专用网之间的通信载体。专用指机构内的主机只与本机构内的其它主机通信;虚拟指好像是,而实际上并不是,它有经过公用的互联网。
|
||||
|
||||
下图中,场所 A 和 B 的通信经过互联网,如果场所 A 的主机 X 要和另一个场所 B 的主机 Y 通信,IP 数据报的源地址是 10.1.0.1,目的地址是 10.2.0.3。数据报先发送到与互联网相连的路由器 R1,R1 对内部数据进行加密,然后重新加上数据报的首部,源地址是路由器 R1 的全球地址 125.1.2.3,目的地址是路由器 R2 的全球地址 194.4.5.6。路由器 R2 收到数据报后将数据部分进行解密,恢复原来的数据报,此时目的地址为 10.2.0.3,就交付给 Y。
|
||||
下图中,场所 A 和 B 的通信经过互联网,如果场所 A 的主机 X 要和另一个场所 B 的主机 Y 通信,IP 数据报的源地址是 10.1.0.5,目的地址是 10.2.0.8。数据报先发送到与互联网相连的路由器 R1,R1 对内部数据进行加密,然后重新加上数据报的首部,源地址是路由器 R1 的全球地址 203.0.113.1,目的地址是路由器 R2 的全球地址 198.51.100.2。路由器 R2 收到数据报后将数据部分进行解密,恢复原来的数据报,此时目的地址为 10.2.0.8,就交付给 Y。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/1556770b-8c01-4681-af10-46f1df69202c.jpg" width="800"/> </div><br>
|
||||
<div align="center"> <img src="pics/vpn-tunnel.png" width="780px"/> </div><br>
|
||||
|
||||
## 网络地址转换 NAT
|
||||
|
||||
@@ -165,7 +171,7 @@ VPN 使用公用的互联网作为本机构各专用网之间的通信载体。
|
||||
|
||||
在以前,NAT 将本地 IP 和全球 IP 一一对应,这种方式下拥有 n 个全球 IP 地址的专用网内最多只可以同时有 n 台主机接入互联网。为了更有效地利用全球 IP 地址,现在常用的 NAT 转换表把传输层的端口号也用上了,使得多个专用网内部的主机共用一个全球 IP 地址。使用端口号的 NAT 也叫做网络地址与端口转换 NAPT。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/2719067e-b299-4639-9065-bed6729dbf0b.png" width=""/> </div><br>
|
||||
<div align="center"> <img src="pics/nat.png" width="780px"/> </div><br>
|
||||
|
||||
## 路由器的结构
|
||||
|
||||
@@ -173,7 +179,7 @@ VPN 使用公用的互联网作为本机构各专用网之间的通信载体。
|
||||
|
||||
分组转发结构由三个部分组成:交换结构、一组输入端口和一组输出端口。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/c3369072-c740-43b0-b276-202bd1d3960d.jpg" width="600"/> </div><br>
|
||||
<div align="center"> <img src="pics/router-structure.png" width="740px"/> </div><br>
|
||||
|
||||
## 路由器分组转发流程
|
||||
|
||||
@@ -184,7 +190,9 @@ VPN 使用公用的互联网作为本机构各专用网之间的通信载体。
|
||||
- 若路由表中有一个默认路由,则把数据报传送给路由表中所指明的默认路由器;
|
||||
- 报告转发分组出错。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/1ab49e39-012b-4383-8284-26570987e3c4.jpg" width="800"/> </div><br>
|
||||
实际的路由器用最长前缀匹配统一处理以上几种情况:特定主机路由的前缀长度为 32,默认路由为 0,查找时在匹配的表项中选前缀最长的一个。
|
||||
|
||||
<div align="center"> <img src="pics/route-lookup.png" width="760px"/> </div><br>
|
||||
|
||||
## 路由选择协议
|
||||
|
||||
@@ -241,4 +249,4 @@ BGP 只能寻找一条比较好的路由,而不是最佳路由。
|
||||
|
||||
每个 AS 都必须配置 BGP 发言人,通过在两个相邻 BGP 发言人之间建立 TCP 连接来交换路由信息。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/9cd0ae20-4fb5-4017-a000-f7d3a0eb3529.png" width="600"/> </div><br>
|
||||
<div align="center"> <img src="pics/bgp.png" width="760px"/> </div><br>
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="780" height="370" viewBox="0 0 780 370">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="390" y="28" class="title">IP 地址不变,MAC 地址逐段改变</text>
|
||||
<rect x="48" y="70" width="44" height="29.92" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<rect x="52" y="74" width="36" height="21.92" rx="1.5" fill="#FFFFFF" stroke="#7FB2D6" stroke-width="0.8"/>
|
||||
<path d="M66,99.92 v5 M74,99.92 v5" stroke="#7FB2D6" stroke-width="1.4"/>
|
||||
<rect x="58" y="104.92" width="24" height="3.5" rx="1.5" fill="#7FB2D6"/>
|
||||
<text x="70" y="124" class="c b">H1</text>
|
||||
<text x="70" y="140" class="c sub mono">192.168.1.10</text>
|
||||
<circle cx="290" cy="92" r="18" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<line x1="294.5" y1="96.5" x2="302.6" y2="104.6" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="285.5" y1="87.5" x2="277.4" y2="79.4" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="294.5" y1="87.5" x2="302.6" y2="79.4" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="285.5" y1="96.5" x2="277.4" y2="104.6" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M298.6,104.6 L302.6,104.6 L302.6,100.6" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M281.4,79.4 L277.4,79.4 L277.4,83.4" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M298.5,87.5 L294.5,87.5 L294.5,83.5" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M281.5,96.5 L285.5,96.5 L285.5,100.5" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<text x="290" y="132" class="c b">R1</text>
|
||||
<circle cx="490" cy="92" r="18" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<line x1="494.5" y1="96.5" x2="502.6" y2="104.6" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="485.5" y1="87.5" x2="477.4" y2="79.4" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="494.5" y1="87.5" x2="502.6" y2="79.4" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="485.5" y1="96.5" x2="477.4" y2="104.6" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M498.6,104.6 L502.6,104.6 L502.6,100.6" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M481.4,79.4 L477.4,79.4 L477.4,83.4" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M498.5,87.5 L494.5,87.5 L494.5,83.5" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M481.5,96.5 L485.5,96.5 L485.5,100.5" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<text x="490" y="132" class="c b">R2</text>
|
||||
<rect x="688" y="70" width="44" height="29.92" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<rect x="692" y="74" width="36" height="21.92" rx="1.5" fill="#FFFFFF" stroke="#7FB2D6" stroke-width="0.8"/>
|
||||
<path d="M706,99.92 v5 M714,99.92 v5" stroke="#7FB2D6" stroke-width="1.4"/>
|
||||
<rect x="698" y="104.92" width="24" height="3.5" rx="1.5" fill="#7FB2D6"/>
|
||||
<text x="710" y="124" class="c b">H2</text>
|
||||
<text x="710" y="140" class="c sub mono">10.0.2.20</text>
|
||||
<line x1="96" y1="92" x2="268" y2="92" class="line"/>
|
||||
<text x="180" y="84" class="c sub">局域网 1</text>
|
||||
<line x1="316" y1="92" x2="468" y2="92" class="line"/>
|
||||
<text x="390" y="84" class="c sub">链路 2</text>
|
||||
<line x1="516" y1="92" x2="688" y2="92" class="line"/>
|
||||
<text x="600" y="84" class="c sub">局域网 3</text>
|
||||
<text x="258" y="112" class="sub mono e">R1-1</text>
|
||||
<text x="322" y="112" class="sub mono">R1-2</text>
|
||||
<text x="458" y="112" class="sub mono e">R2-1</text>
|
||||
<text x="522" y="112" class="sub mono">R2-2</text>
|
||||
<rect x="88" y="170" width="184" height="88" rx="6" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<text x="180" y="188" class="c sub">帧首部</text>
|
||||
<rect x="96" y="194" width="168" height="24" rx="3" fill="#E6E3FA" stroke="#B8B0DE"/>
|
||||
<text x="180" y="211" class="c sub mono" style="fill:#555">MAC H1 → R1-1</text>
|
||||
<rect x="96" y="224" width="168" height="24" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="180" y="241" class="c sub mono" style="fill:#555">IP .1.10 → 10.0.2.20</text>
|
||||
<line x1="180" y1="100" x2="180" y2="166" stroke="#BBB" stroke-dasharray="3 3"/>
|
||||
<rect x="298" y="170" width="184" height="88" rx="6" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<text x="390" y="188" class="c sub">帧首部</text>
|
||||
<rect x="306" y="194" width="168" height="24" rx="3" fill="#E6E3FA" stroke="#B8B0DE"/>
|
||||
<text x="390" y="211" class="c sub mono" style="fill:#555">MAC R1-2 → R2-1</text>
|
||||
<rect x="306" y="224" width="168" height="24" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="390" y="241" class="c sub mono" style="fill:#555">IP .1.10 → 10.0.2.20</text>
|
||||
<line x1="390" y1="100" x2="390" y2="166" stroke="#BBB" stroke-dasharray="3 3"/>
|
||||
<rect x="508" y="170" width="184" height="88" rx="6" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<text x="600" y="188" class="c sub">帧首部</text>
|
||||
<rect x="516" y="194" width="168" height="24" rx="3" fill="#E6E3FA" stroke="#B8B0DE"/>
|
||||
<text x="600" y="211" class="c sub mono" style="fill:#555">MAC R2-2 → H2</text>
|
||||
<rect x="516" y="224" width="168" height="24" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="600" y="241" class="c sub mono" style="fill:#555">IP .1.10 → 10.0.2.20</text>
|
||||
<line x1="600" y1="100" x2="600" y2="166" stroke="#BBB" stroke-dasharray="3 3"/>
|
||||
<text x="40" y="296" class="sub">淡紫色是帧首部中的 MAC 地址,每经过一段链路就换成这一段两端的地址;</text>
|
||||
<text x="40" y="314" class="sub">浅蓝色是 IP 首部中的地址,从 H1 到 H2 一直不变(.1.10 即 192.168.1.10)。</text>
|
||||
<text x="40" y="340" class="sub">H1 发送前用 ARP 查的是下一跳 R1-1 的 MAC 地址,而不是 H2 的;R1、R2 转发时也各自查下一跳。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.3 KiB |
@@ -0,0 +1,82 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="760" height="400" viewBox="0 0 760 400">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="380" y="28" class="title">ARP:A 查询 192.168.1.20 的 MAC 地址</text>
|
||||
<line x1="40" y1="196" x2="720" y2="196" stroke="#999" stroke-width="3" stroke-linecap="round"/>
|
||||
<rect x="60" y="128" width="40" height="27.2" rx="3" fill="#C6ECE9" stroke="#7DBCB7" stroke-width="1.2"/>
|
||||
<rect x="64" y="132" width="32" height="19.2" rx="1.5" fill="#FFFFFF" stroke="#7DBCB7" stroke-width="0.8"/>
|
||||
<path d="M76,155.2 v5 M84,155.2 v5" stroke="#7DBCB7" stroke-width="1.4"/>
|
||||
<rect x="68" y="160.2" width="24" height="3.5" rx="1.5" fill="#7DBCB7"/>
|
||||
<line x1="80" y1="165" x2="80" y2="196" class="line"/>
|
||||
<text x="106" y="140" class="b">A</text>
|
||||
<text x="106" y="156" class="sub mono">192.168.1.10</text>
|
||||
<rect x="240" y="128" width="40" height="27.2" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<rect x="244" y="132" width="32" height="19.2" rx="1.5" fill="#FFFFFF" stroke="#7FB2D6" stroke-width="0.8"/>
|
||||
<path d="M256,155.2 v5 M264,155.2 v5" stroke="#7FB2D6" stroke-width="1.4"/>
|
||||
<rect x="248" y="160.2" width="24" height="3.5" rx="1.5" fill="#7FB2D6"/>
|
||||
<line x1="260" y1="165" x2="260" y2="196" class="line"/>
|
||||
<text x="286" y="140" class="b">B</text>
|
||||
<text x="286" y="156" class="sub mono">192.168.1.20</text>
|
||||
<rect x="420" y="128" width="40" height="27.2" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<rect x="424" y="132" width="32" height="19.2" rx="1.5" fill="#FFFFFF" stroke="#7FB2D6" stroke-width="0.8"/>
|
||||
<path d="M436,155.2 v5 M444,155.2 v5" stroke="#7FB2D6" stroke-width="1.4"/>
|
||||
<rect x="428" y="160.2" width="24" height="3.5" rx="1.5" fill="#7FB2D6"/>
|
||||
<line x1="440" y1="165" x2="440" y2="196" class="line"/>
|
||||
<text x="466" y="140" class="b">C</text>
|
||||
<text x="466" y="156" class="sub mono">192.168.1.30</text>
|
||||
<rect x="600" y="128" width="40" height="27.2" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<rect x="604" y="132" width="32" height="19.2" rx="1.5" fill="#FFFFFF" stroke="#7FB2D6" stroke-width="0.8"/>
|
||||
<path d="M616,155.2 v5 M624,155.2 v5" stroke="#7FB2D6" stroke-width="1.4"/>
|
||||
<rect x="608" y="160.2" width="24" height="3.5" rx="1.5" fill="#7FB2D6"/>
|
||||
<line x1="620" y1="165" x2="620" y2="196" class="line"/>
|
||||
<text x="646" y="140" class="b">D</text>
|
||||
<text x="646" y="156" class="sub mono">192.168.1.40</text>
|
||||
<path d="M36,52 h288 q6,0 6,6 v40 q0,6 -6,6 H48 l-8,8 l0,-8 H36 q-6,0 -6,-6 v-40 q0,-6 6,-6 z" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1.2"/>
|
||||
<text x="42" y="72" class="sub" style="fill:#555">① 广播 ARP 请求,目的 MAC ff:ff:ff:ff:ff:ff</text>
|
||||
<text x="42" y="90" class="sub" style="fill:#555">“谁是 192.168.1.20?请告诉 192.168.1.10”</text>
|
||||
<line x1="100" y1="188" x2="250" y2="188" class="arrow "/>
|
||||
<line x1="100" y1="188" x2="430" y2="188" class="arrow "/>
|
||||
<line x1="100" y1="188" x2="610" y2="188" class="arrow "/>
|
||||
<text x="440" y="230" class="c sub">不是自己的 IP,丢弃</text>
|
||||
<text x="620" y="230" class="c sub">丢弃</text>
|
||||
<path d="M260,204 C260,262 110,262 86,206" class="arrow green"/>
|
||||
<text x="40" y="284" class="sub ok">② B 单播 ARP 响应:192.168.1.20 的 MAC 是 52:54:00:aa:00:20</text>
|
||||
<rect x="40" y="300" width="330" height="50" rx="5" fill="#C6ECE9" stroke="#7DBCB7" stroke-width="1.2"/>
|
||||
<rect x="40" y="300" width="330" height="22" rx="5" fill="#7DBCB7" opacity="0.35"/>
|
||||
<text x="205" y="315" class="c b">③ A 的 ARP 缓存</text>
|
||||
<rect x="46" y="328" width="318" height="16" rx="3" fill="#E6E3FA" stroke="#7DBCB7" stroke-width="0.6"/>
|
||||
<text x="52" y="340" class="sub mono">192.168.1.20 → 52:54:00:aa:00:20</text>
|
||||
<text x="400" y="322" class="sub">A 之后发给 192.168.1.20 的帧,</text>
|
||||
<text x="400" y="340" class="sub">直接使用缓存中的 MAC 地址;</text>
|
||||
<text x="400" y="358" class="sub">B 收到请求时也顺便记下 A 的映射。</text>
|
||||
<text x="400" y="384" class="sub">缓存项有过期时间,过期后重新查询。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
@@ -0,0 +1,99 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="760" height="420" viewBox="0 0 760 420">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="380" y="28" class="title">BGP:自治系统之间交换路由</text>
|
||||
<path d="M49.2,250 C7.4,250 11.2,205 45.4,202 C41.6,168 106.2,155 121.4,180 C144.2,162 189.8,172 178.4,202 C212.6,206 212.6,250 170.8,250 Z" fill="#F4F4F4" stroke="#C8C8C8" stroke-width="1.2"/>
|
||||
<text x="92" y="206" class="c b">AS1</text>
|
||||
<text x="92" y="222" class="c sub">内部用 OSPF</text>
|
||||
<path d="M319.2,136 C277.4,136 281.2,91 315.4,88 C311.6,54 376.2,41 391.4,66 C414.2,48 459.8,58 448.4,88 C482.6,92 482.6,136 440.8,136 Z" fill="#F4F4F4" stroke="#C8C8C8" stroke-width="1.2"/>
|
||||
<text x="380" y="84" class="c b">AS2</text>
|
||||
<text x="380" y="100" class="c sub">内部用 OSPF</text>
|
||||
<path d="M589.2,250 C547.4,250 551.2,205 585.4,202 C581.6,168 646.2,155 661.4,180 C684.2,162 729.8,172 718.4,202 C752.6,206 752.6,250 710.8,250 Z" fill="#F4F4F4" stroke="#C8C8C8" stroke-width="1.2"/>
|
||||
<text x="668" y="206" class="c b">AS3</text>
|
||||
<text x="668" y="222" class="c sub">内部用 RIP</text>
|
||||
<path d="M319.2,370 C277.4,370 281.2,325 315.4,322 C311.6,288 376.2,275 391.4,300 C414.2,282 459.8,292 448.4,322 C482.6,326 482.6,370 440.8,370 Z" fill="#F4F4F4" stroke="#C8C8C8" stroke-width="1.2"/>
|
||||
<text x="380" y="336" class="c b">AS4</text>
|
||||
<text x="380" y="352" class="c sub">内部用 OSPF</text>
|
||||
<line x1="190" y1="210" x2="380" y2="132" stroke="#B8B0DE" stroke-width="1.6" stroke-dasharray="5 4"/>
|
||||
<line x1="380" y1="132" x2="570" y2="210" stroke="#B8B0DE" stroke-width="1.6" stroke-dasharray="5 4"/>
|
||||
<line x1="190" y1="210" x2="380" y2="292" stroke="#B8B0DE" stroke-width="1.6" stroke-dasharray="5 4"/>
|
||||
<line x1="380" y1="292" x2="570" y2="210" stroke="#B8B0DE" stroke-width="1.6" stroke-dasharray="5 4"/>
|
||||
<circle cx="190" cy="210" r="13" fill="#C6ECE9" stroke="#7DBCB7" stroke-width="1.2"/>
|
||||
<line x1="193.25" y1="213.25" x2="199.1" y2="219.1" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="186.75" y1="206.75" x2="180.9" y2="200.9" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="193.25" y1="206.75" x2="199.1" y2="200.9" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="186.75" y1="213.25" x2="180.9" y2="219.1" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M195.1,219.1 L199.1,219.1 L199.1,215.1" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M184.9,200.9 L180.9,200.9 L180.9,204.9" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M197.25,206.75 L193.25,206.75 L193.25,202.75" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M182.75,213.25 L186.75,213.25 L186.75,217.25" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<circle cx="380" cy="132" r="13" fill="#C6ECE9" stroke="#7DBCB7" stroke-width="1.2"/>
|
||||
<line x1="383.25" y1="135.25" x2="389.1" y2="141.1" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="376.75" y1="128.75" x2="370.9" y2="122.9" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="383.25" y1="128.75" x2="389.1" y2="122.9" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="376.75" y1="135.25" x2="370.9" y2="141.1" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M385.1,141.1 L389.1,141.1 L389.1,137.1" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M374.9,122.9 L370.9,122.9 L370.9,126.9" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M387.25,128.75 L383.25,128.75 L383.25,124.75" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M372.75,135.25 L376.75,135.25 L376.75,139.25" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<circle cx="570" cy="210" r="13" fill="#C6ECE9" stroke="#7DBCB7" stroke-width="1.2"/>
|
||||
<line x1="573.25" y1="213.25" x2="579.1" y2="219.1" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="566.75" y1="206.75" x2="560.9" y2="200.9" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="573.25" y1="206.75" x2="579.1" y2="200.9" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="566.75" y1="213.25" x2="560.9" y2="219.1" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M575.1,219.1 L579.1,219.1 L579.1,215.1" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M564.9,200.9 L560.9,200.9 L560.9,204.9" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M577.25,206.75 L573.25,206.75 L573.25,202.75" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M562.75,213.25 L566.75,213.25 L566.75,217.25" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<circle cx="380" cy="292" r="13" fill="#C6ECE9" stroke="#7DBCB7" stroke-width="1.2"/>
|
||||
<line x1="383.25" y1="295.25" x2="389.1" y2="301.1" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="376.75" y1="288.75" x2="370.9" y2="282.9" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="383.25" y1="288.75" x2="389.1" y2="282.9" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="376.75" y1="295.25" x2="370.9" y2="301.1" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M385.1,301.1 L389.1,301.1 L389.1,297.1" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M374.9,282.9 L370.9,282.9 L370.9,286.9" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M387.25,288.75 L383.25,288.75 L383.25,284.75" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M372.75,295.25 L376.75,295.25 L376.75,299.25" fill="none" stroke="#7DBCB7" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<text x="272" y="160" class="sub e">BGP 会话(TCP 179)</text>
|
||||
<line x1="532" y1="252" x2="447" y2="289" class="arrow "/>
|
||||
<rect x="500" y="290" width="220" height="28" rx="3" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1.2"/>
|
||||
<path d="M500,291 L514,301 L528,291" fill="none" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="534" y="308" class="sub">203.0.113.0/24,路径 AS3</text>
|
||||
<text x="610" y="336" class="c sub">① AS3 通告自己的网络</text>
|
||||
<line x1="323" y1="293" x2="238" y2="257" class="arrow "/>
|
||||
<rect x="20" y="290" width="240" height="28" rx="3" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1.2"/>
|
||||
<path d="M20,291 L34,301 L48,291" fill="none" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="54" y="308" class="sub">203.0.113.0/24,路径 AS4 AS3</text>
|
||||
<text x="140" y="336" class="c sub">② AS4 把自己加到路径前面再转告</text>
|
||||
<text x="20" y="394" class="sub">浅青色是各 AS 的 BGP 发言人。AS1 从 AS4 和 AS2 都可能收到到 203.0.113.0/24 的路由,按策略和路径长度选一条;</text>
|
||||
<text x="20" y="412" class="sub">路径中出现自己的 AS 号说明有环路,直接丢弃。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.5 KiB |
@@ -0,0 +1,67 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="350" viewBox="0 0 640 350">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="320" y="28" class="title">ICMP 报文:以 ping 发出的回送请求为例</text>
|
||||
<rect x="40" y="52" width="150" height="32" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="115" y="72.5" class="c sub">IP 首部(协议 = 1)</text>
|
||||
<rect x="190" y="52" width="320" height="32" rx="3" fill="#E6E3FA" stroke="#B8B0DE"/>
|
||||
<text x="350" y="72" class="c sub" style="fill:#555">ICMP 报文</text>
|
||||
<path d="M190,86 L40,120" class="line dash"/>
|
||||
<path d="M510,86 L520,120" class="line dash"/>
|
||||
<rect x="40" y="126" width="120" height="40" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="100" y="143" class="c">类型</text>
|
||||
<text x="100" y="159" class="c sub">8(回送请求)</text>
|
||||
<rect x="160" y="126" width="120" height="40" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="220" y="143" class="c">代码</text>
|
||||
<text x="220" y="159" class="c sub mono">0</text>
|
||||
<rect x="280" y="126" width="240" height="40" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="400" y="143" class="c">检验和</text>
|
||||
<text x="400" y="159" class="c sub">16 位</text>
|
||||
<rect x="40" y="166" width="240" height="40" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="160" y="183" class="c">标识符</text>
|
||||
<text x="160" y="199" class="c sub">区分不同的 ping 进程</text>
|
||||
<rect x="280" y="166" width="240" height="40" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="400" y="183" class="c">序号</text>
|
||||
<text x="400" y="199" class="c sub">每发一个加 1</text>
|
||||
<rect x="40" y="206" width="480" height="40" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="280" y="223" class="c">数据</text>
|
||||
<text x="280" y="239" class="c sub">通常带上发送时间,用来计算往返时间</text>
|
||||
<path d="M534,128 q8,0 8,8 V140.0 q0,6 6,6 q-6,0 -6,6 V156 q0,8 -8,8" class="line"/>
|
||||
<text x="554" y="144" class="sub">所有 ICMP 报文</text>
|
||||
<text x="554" y="160" class="sub">前 4 字节相同</text>
|
||||
<path d="M534,168 q8,0 8,8 V200.0 q0,6 6,6 q-6,0 -6,6 V236 q0,8 -8,8" class="line"/>
|
||||
<text x="554" y="202" class="sub">其余部分</text>
|
||||
<text x="554" y="218" class="sub">取决于类型</text>
|
||||
<text x="40" y="280" class="sub">ICMP 封装在 IP 数据报中,但它不是传输层协议,而是网络层的一部分。</text>
|
||||
<text x="40" y="300" class="sub">目的主机返回回送回答(类型 0),标识符、序号和数据原样带回。</text>
|
||||
<text x="40" y="320" class="sub">差错报告报文的数据部分是出错数据报的 IP 首部和数据的前 8 字节,源主机据此知道是哪个报文出了错。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
@@ -0,0 +1,78 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="740" height="330" viewBox="0 0 740 330">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="370" y="28" class="title">分类的 IP 地址</text>
|
||||
<text x="73" y="60" class="sub mono">0</text>
|
||||
<text x="451" y="60" class="sub mono e">31</text>
|
||||
<text x="56" y="91" class="b e">A 类</text>
|
||||
<rect x="70" y="70" width="12" height="32" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="76" y="90.5" class="c sub mono">0</text>
|
||||
<rect x="82" y="70" width="84" height="32" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="124" y="90.5" class="c sub">网络号 7 位</text>
|
||||
<rect x="166" y="70" width="288" height="32" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="310" y="90.5" class="c sub">主机号 24 位</text>
|
||||
<text x="470" y="83" class="sub" style="fill:#555">首字节 1~126</text>
|
||||
<text x="470" y="99" class="sub">每个网络 2²⁴ − 2 台主机,例如 10.1.2.3</text>
|
||||
<text x="56" y="139" class="b e">B 类</text>
|
||||
<rect x="70" y="118" width="24" height="32" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="82" y="138.5" class="c sub mono">10</text>
|
||||
<rect x="94" y="118" width="168" height="32" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="178" y="138.5" class="c sub">网络号 14 位</text>
|
||||
<rect x="262" y="118" width="192" height="32" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="358" y="138.5" class="c sub">主机号 16 位</text>
|
||||
<text x="470" y="131" class="sub" style="fill:#555">首字节 128~191</text>
|
||||
<text x="470" y="147" class="sub">每个网络 65534 台主机,例如 172.16.5.4</text>
|
||||
<text x="56" y="187" class="b e">C 类</text>
|
||||
<rect x="70" y="166" width="36" height="32" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="88" y="186.5" class="c sub mono">110</text>
|
||||
<rect x="106" y="166" width="252" height="32" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="232" y="186.5" class="c sub">网络号 21 位</text>
|
||||
<rect x="358" y="166" width="96" height="32" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="406" y="186.5" class="c sub">主机号 8 位</text>
|
||||
<text x="470" y="179" class="sub" style="fill:#555">首字节 192~223</text>
|
||||
<text x="470" y="195" class="sub">每个网络 254 台主机,例如 192.168.1.10</text>
|
||||
<text x="56" y="235" class="b e">D 类</text>
|
||||
<rect x="70" y="214" width="48" height="32" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="94" y="234.5" class="c sub mono">1110</text>
|
||||
<rect x="118" y="214" width="336" height="32" fill="#EAE9E7" stroke="#BFBEBA" stroke-width="1"/>
|
||||
<text x="286" y="234.5" class="c sub">多播组号</text>
|
||||
<text x="470" y="227" class="sub" style="fill:#555">首字节 224~239</text>
|
||||
<text x="470" y="243" class="sub">多播地址</text>
|
||||
<text x="56" y="283" class="b e">E 类</text>
|
||||
<rect x="70" y="262" width="48" height="32" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="94" y="282.5" class="c sub mono">1111</text>
|
||||
<rect x="118" y="262" width="336" height="32" fill="#EAE9E7" stroke="#BFBEBA" stroke-width="1"/>
|
||||
<text x="286" y="282.5" class="c sub">保留</text>
|
||||
<text x="470" y="275" class="sub" style="fill:#555">首字节 240~255</text>
|
||||
<text x="470" y="291" class="sub">保留</text>
|
||||
<text x="20" y="318" class="sub">A 类中 0 开头和 127 开头的网络保留不分配,127.0.0.1 是本机回环地址。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,72 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="780" height="440" viewBox="0 0 780 440">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="390" y="28" class="title">IP 分片:UDP 发送 3000 字节,经过 MTU 为 1500 的以太网</text>
|
||||
<text x="20" y="113" class="b">原始数据报</text>
|
||||
<rect x="104" y="92" width="66" height="32" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="137" y="112.5" class="c sub">IP 首部</text>
|
||||
<rect x="170" y="92" width="560" height="32" rx="3" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<rect x="170" y="92" width="56" height="32" rx="3" fill="#E6E3FA" stroke="#B8B0DE"/>
|
||||
<text x="198" y="112" class="c sub" style="fill:#555">UDP 首部</text>
|
||||
<text x="478" y="112" class="c sub">应用数据 3000 字节</text>
|
||||
<text x="450" y="80" class="c sub">数据部分 3008 字节</text>
|
||||
<line x1="170" y1="88" x2="170" y2="132" stroke="#999" stroke-dasharray="3 3"/>
|
||||
<text x="170" y="146" class="c sub mono">0</text>
|
||||
<line x1="410" y1="88" x2="410" y2="132" stroke="#999" stroke-dasharray="3 3"/>
|
||||
<text x="410" y="146" class="c sub mono">1480</text>
|
||||
<line x1="650" y1="88" x2="650" y2="132" stroke="#999" stroke-dasharray="3 3"/>
|
||||
<text x="650" y="146" class="c sub mono">2960</text>
|
||||
<line x1="730" y1="88" x2="730" y2="132" stroke="#999" stroke-dasharray="3 3"/>
|
||||
<text x="730" y="146" class="c sub mono">3008</text>
|
||||
<line x1="170" y1="152" x2="170" y2="186" stroke="#DDD" stroke-dasharray="3 3"/>
|
||||
<rect x="104" y="186" width="66" height="30" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="137" y="205.5" class="c sub">IP 首部</text>
|
||||
<rect x="170" y="186" width="240" height="30" rx="3" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<rect x="170" y="186" width="56" height="30" rx="3" fill="#E6E3FA" stroke="#B8B0DE"/>
|
||||
<text x="198" y="205" class="c sub" style="fill:#555">UDP 首部</text>
|
||||
<text x="318" y="205" class="c sub">数据 1480 字节</text>
|
||||
<text x="104" y="234" class="sub" style="fill:#555">分片 1:总长度 1500,MF = 1,片偏移 = 0 / 8 = 0</text>
|
||||
<line x1="410" y1="152" x2="410" y2="254" stroke="#DDD" stroke-dasharray="3 3"/>
|
||||
<rect x="344" y="254" width="66" height="30" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="377" y="273.5" class="c sub">IP 首部</text>
|
||||
<rect x="410" y="254" width="240" height="30" rx="3" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<text x="530" y="273" class="c sub">数据 1480 字节</text>
|
||||
<text x="344" y="302" class="sub" style="fill:#555">分片 2:总长度 1500,MF = 1,片偏移 = 1480 / 8 = 185</text>
|
||||
<line x1="650" y1="152" x2="650" y2="322" stroke="#DDD" stroke-dasharray="3 3"/>
|
||||
<rect x="584" y="322" width="66" height="30" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="617" y="341.5" class="c sub">IP 首部</text>
|
||||
<rect x="650" y="322" width="80" height="30" rx="3" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<text x="690" y="341" class="c sub">48 字节</text>
|
||||
<text x="730" y="370" class="sub e" style="fill:#555">分片 3:总长度 68,MF = 0,片偏移 = 2960 / 8 = 370</text>
|
||||
<text x="20" y="404" class="sub">每片的数据部分最多 1500 − 20 = 1480 字节,正好是 8 的倍数。三个分片的标识相同,</text>
|
||||
<text x="20" y="422" class="sub">目的主机按标识收集分片、按片偏移排列,收齐后重组;只有第一个分片带有 UDP 首部和端口号。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
@@ -0,0 +1,89 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="440" viewBox="0 0 720 440">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="360" y="28" class="title">IPv4 首部</text>
|
||||
<text x="43" y="60" class="sub mono">0</text>
|
||||
<text x="277" y="60" class="sub mono e">15</text>
|
||||
<text x="283" y="60" class="sub mono">16</text>
|
||||
<text x="517" y="60" class="sub mono e">31</text>
|
||||
<rect x="40" y="68" width="60" height="40" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="70" y="85" class="c">版本</text>
|
||||
<text x="70" y="101" class="c sub">4 位</text>
|
||||
<rect x="100" y="68" width="60" height="40" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="130" y="85" class="c">首部长度</text>
|
||||
<text x="130" y="101" class="c sub">4 位</text>
|
||||
<rect x="160" y="68" width="120" height="40" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="220" y="85" class="c">区分服务</text>
|
||||
<text x="220" y="101" class="c sub">8 位</text>
|
||||
<rect x="280" y="68" width="240" height="40" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="400" y="85" class="c">总长度</text>
|
||||
<text x="400" y="101" class="c sub">16 位</text>
|
||||
<rect x="40" y="108" width="240" height="40" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="160" y="125" class="c">标识</text>
|
||||
<text x="160" y="141" class="c sub">16 位</text>
|
||||
<rect x="280" y="108" width="45" height="40" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="302.5" y="125" class="c">标志</text>
|
||||
<text x="302.5" y="141" class="c sub">3 位</text>
|
||||
<rect x="325" y="108" width="195" height="40" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="422.5" y="125" class="c">片偏移</text>
|
||||
<text x="422.5" y="141" class="c sub">13 位</text>
|
||||
<rect x="40" y="148" width="120" height="40" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="100" y="165" class="c">生存时间</text>
|
||||
<text x="100" y="181" class="c sub">8 位</text>
|
||||
<rect x="160" y="148" width="120" height="40" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="220" y="165" class="c">协议</text>
|
||||
<text x="220" y="181" class="c sub">8 位</text>
|
||||
<rect x="280" y="148" width="240" height="40" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="400" y="165" class="c">首部检验和</text>
|
||||
<text x="400" y="181" class="c sub">16 位</text>
|
||||
<rect x="40" y="188" width="480" height="40" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="280" y="205" class="c">源 IP 地址</text>
|
||||
<text x="280" y="221" class="c sub">32 位</text>
|
||||
<rect x="40" y="228" width="480" height="40" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="280" y="245" class="c">目的 IP 地址</text>
|
||||
<text x="280" y="261" class="c sub">32 位</text>
|
||||
<rect x="40" y="268" width="360" height="40" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="220" y="285" class="c">选项</text>
|
||||
<text x="220" y="301" class="c sub mono">长度可变</text>
|
||||
<rect x="400" y="268" width="120" height="40" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="460" y="285" class="c">填充</text>
|
||||
<text x="460" y="301" class="c sub">补齐 4 字节</text>
|
||||
<rect x="40" y="308" width="480" height="40" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="280" y="332.5" class="c sub">数据(例如 TCP 报文段、UDP 数据报)</text>
|
||||
<path d="M534,70 q8,0 8,8 V162.0 q0,6 6,6 q-6,0 -6,6 V258 q0,8 -8,8" class="line"/>
|
||||
<text x="554" y="172" class="b">固定 20 字节</text>
|
||||
<path d="M534,270 q8,0 8,8 V282.0 q0,6 6,6 q-6,0 -6,6 V298 q0,8 -8,8" class="line"/>
|
||||
<text x="554" y="292" class="sub">0~40 字节</text>
|
||||
<text x="40" y="372" class="sub">淡紫色的三个字段用于分片:标志的后两位是 DF(为 1 时不允许分片)和 MF(为 1 时后面还有分片)。</text>
|
||||
<text x="40" y="392" class="sub">首部长度以 4 字节为单位,片偏移以 8 字节为单位;总长度包括首部和数据,最大 65535 字节。</text>
|
||||
<text x="40" y="412" class="sub">协议字段指出数据部分交给谁处理:1 是 ICMP,6 是 TCP,17 是 UDP。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
@@ -0,0 +1,97 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="780" height="400" viewBox="0 0 780 400">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="390" y="28" class="title">NAPT:两台主机共用一个全球地址</text>
|
||||
<rect x="20" y="50" width="200" height="210" rx="8" class="frame"/>
|
||||
<text x="30" y="68" class="b">专用网 192.168.0.0/24</text>
|
||||
<rect x="60" y="84" width="40" height="27.2" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<rect x="64" y="88" width="32" height="19.2" rx="1.5" fill="#FFFFFF" stroke="#7FB2D6" stroke-width="0.8"/>
|
||||
<path d="M76,111.2 v5 M84,111.2 v5" stroke="#7FB2D6" stroke-width="1.4"/>
|
||||
<rect x="68" y="116.2" width="24" height="3.5" rx="1.5" fill="#7FB2D6"/>
|
||||
<text x="80" y="136" class="c b">H1</text>
|
||||
<text x="80" y="152" class="c sub mono">192.168.0.3</text>
|
||||
<rect x="60" y="172" width="40" height="27.2" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<rect x="64" y="176" width="32" height="19.2" rx="1.5" fill="#FFFFFF" stroke="#7FB2D6" stroke-width="0.8"/>
|
||||
<path d="M76,199.2 v5 M84,199.2 v5" stroke="#7FB2D6" stroke-width="1.4"/>
|
||||
<rect x="68" y="204.2" width="24" height="3.5" rx="1.5" fill="#7FB2D6"/>
|
||||
<text x="80" y="224" class="c b">H2</text>
|
||||
<text x="80" y="240" class="c sub mono">192.168.0.4</text>
|
||||
<circle cx="290" cy="160" r="20" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<line x1="295" y1="165" x2="304" y2="174" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="285" y1="155" x2="276" y2="146" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="295" y1="155" x2="304" y2="146" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="285" y1="165" x2="276" y2="174" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M300,174 L304,174 L304,170" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M280,146 L276,146 L276,150" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M299,155 L295,155 L295,151" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M281,165 L285,165 L285,169" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<text x="290" y="206" class="c b">NAT 路由器</text>
|
||||
<text x="290" y="222" class="c sub mono">203.0.113.5</text>
|
||||
<rect x="697" y="136" width="46" height="13" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<circle cx="704" cy="142.5" r="2" fill="#7FB2D6"/>
|
||||
<line x1="711" y1="142.5" x2="736" y2="142.5" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<rect x="697" y="152" width="46" height="13" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<circle cx="704" cy="158.5" r="2" fill="#7FB2D6"/>
|
||||
<line x1="711" y1="158.5" x2="736" y2="158.5" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<rect x="697" y="168" width="46" height="13" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<circle cx="704" cy="174.5" r="2" fill="#7FB2D6"/>
|
||||
<line x1="711" y1="174.5" x2="736" y2="174.5" stroke="#7FB2D6" stroke-width="1"/>
|
||||
<text x="720" y="200" class="c b">服务器</text>
|
||||
<text x="720" y="216" class="c sub mono">198.51.100.7</text>
|
||||
<line x1="102" y1="98" x2="272" y2="152" class="line"/>
|
||||
<line x1="102" y1="186" x2="272" y2="168" class="line"/>
|
||||
<line x1="310" y1="160" x2="696" y2="160" class="line"/>
|
||||
<text x="500" y="66" class="c sub">① H1 的请求经过 NAT,源地址和端口被改写</text>
|
||||
<rect x="336" y="76" width="330" height="28" rx="3" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<path d="M336,77 L350,87 L364,77" fill="none" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="370" y="94" class="sub mono">192.168.0.3:30000 → 198.51.100.7:443</text>
|
||||
<rect x="336" y="112" width="330" height="28" rx="3" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1.2"/>
|
||||
<path d="M336,113 L350,123 L364,113" fill="none" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="370" y="130" class="sub mono">203.0.113.5:40001 → 198.51.100.7:443</text>
|
||||
<rect x="20" y="280" width="330" height="70" rx="5" fill="#C6ECE9" stroke="#7DBCB7" stroke-width="1.2"/>
|
||||
<rect x="20" y="280" width="330" height="22" rx="5" fill="#7DBCB7" opacity="0.35"/>
|
||||
<text x="185" y="295" class="c b">NAPT 转换表:内部地址 ↔ 外部地址</text>
|
||||
<rect x="26" y="308" width="318" height="16" rx="3" fill="#E6E3FA" stroke="#7DBCB7" stroke-width="0.6"/>
|
||||
<text x="32" y="320" class="sub mono">192.168.0.3:30000 ↔ 203.0.113.5:40001</text>
|
||||
<rect x="26" y="328" width="318" height="16" rx="3" fill="#FFFFFF" stroke="#7DBCB7" stroke-width="0.6"/>
|
||||
<text x="32" y="340" class="sub mono">192.168.0.4:30000 ↔ 203.0.113.5:40002</text>
|
||||
<text x="500" y="196" class="c sub">② 响应按目的端口 40001 查表,改回 H1</text>
|
||||
<rect x="336" y="206" width="330" height="28" rx="3" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1.2"/>
|
||||
<path d="M336,207 L350,217 L364,207" fill="none" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="370" y="224" class="sub mono">198.51.100.7:443 → 203.0.113.5:40001</text>
|
||||
<rect x="336" y="242" width="330" height="28" rx="3" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<path d="M336,243 L350,253 L364,243" fill="none" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="370" y="260" class="sub mono">198.51.100.7:443 → 192.168.0.3:30000</text>
|
||||
<text x="380" y="306" class="sub">H1、H2 的源端口都是 30000,NAT 为它们分配</text>
|
||||
<text x="380" y="324" class="sub">不同的外部端口,响应回来时靠外部端口区分。</text>
|
||||
<text x="20" y="384" class="sub">外部主机无法主动连接 H1:转换表中没有对应的表项,除非在 NAT 上配置端口映射。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.1 KiB |
@@ -0,0 +1,71 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="760" height="340" viewBox="0 0 760 340">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="380" y="28" class="title">路由器 R0 转发分组:最长前缀匹配</text>
|
||||
<text x="40" y="58" class="b">R0 的路由表</text>
|
||||
<rect x="40" y="70" width="150" height="28" fill="#EAE9E7" stroke="#BFBEBA" stroke-width="1"/>
|
||||
<text x="115" y="88.5" class="c sub b">目的网络</text>
|
||||
<rect x="190" y="70" width="150" height="28" fill="#EAE9E7" stroke="#BFBEBA" stroke-width="1"/>
|
||||
<text x="265" y="88.5" class="c sub b">下一跳</text>
|
||||
<rect x="40" y="98" width="150" height="28" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="115" y="116.5" class="c sub mono">192.168.1.0/24</text>
|
||||
<rect x="190" y="98" width="150" height="28" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="265" y="116.5" class="c sub">直接交付(eth0)</text>
|
||||
<rect x="40" y="126" width="150" height="28" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="115" y="144.5" class="c sub mono">10.1.0.0/16</text>
|
||||
<rect x="190" y="126" width="150" height="28" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="265" y="144.5" class="c sub">R2</text>
|
||||
<rect x="40" y="154" width="150" height="28" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="115" y="172.5" class="c sub mono">10.1.4.0/22</text>
|
||||
<rect x="190" y="154" width="150" height="28" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1"/>
|
||||
<text x="265" y="172.5" class="c sub">R3</text>
|
||||
<rect x="40" y="182" width="150" height="28" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="115" y="200.5" class="c sub mono">0.0.0.0/0</text>
|
||||
<rect x="190" y="182" width="150" height="28" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1"/>
|
||||
<text x="265" y="200.5" class="c sub">R1(默认路由)</text>
|
||||
<text x="390" y="70" class="b">目的地址 10.1.5.9</text>
|
||||
<text x="390" y="98" class="sub mono">10.1.5.9</text>
|
||||
<text x="476" y="98" class="sub mono"><tspan style="fill:#766AA8">00001010.00000001.000001</tspan><tspan>01.00001001</tspan></text>
|
||||
<text x="390" y="120" class="sub mono">10.1.0.0/16</text>
|
||||
<text x="476" y="120" class="sub mono"><tspan style="fill:#766AA8">00001010.00000001</tspan><tspan>.00000000.00000000</tspan></text>
|
||||
<text x="390" y="142" class="sub mono">10.1.4.0/22</text>
|
||||
<text x="476" y="142" class="sub mono"><tspan style="fill:#766AA8">00001010.00000001.000001</tspan><tspan>00.00000000</tspan></text>
|
||||
<text x="390" y="172" class="sub" style="fill:#555">/16 和 /22 都匹配,选前缀更长的 /22,交给 R3。</text>
|
||||
<text x="390" y="210" class="b">目的地址 8.8.8.8</text>
|
||||
<text x="390" y="230" class="sub" style="fill:#555">只有默认路由 0.0.0.0/0 匹配,交给 R1。</text>
|
||||
<text x="390" y="268" class="b">目的地址 192.168.1.7</text>
|
||||
<text x="390" y="288" class="sub" style="fill:#555">在直接相连的网络中,用 ARP 查出 MAC 地址后直接交付。</text>
|
||||
<text x="40" y="244" class="sub">0.0.0.0/0 的前缀长度为 0,</text>
|
||||
<text x="40" y="262" class="sub">能匹配任何地址,只在没有</text>
|
||||
<text x="40" y="280" class="sub">其它表项匹配时才使用。</text>
|
||||
<text x="40" y="322" class="sub">没有任何表项匹配(也没有默认路由)时,丢弃分组并向源主机发送 ICMP 终点不可达报文。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,118 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="740" height="410" viewBox="0 0 740 410">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="370" y="28" class="title">路由器的结构</text>
|
||||
<rect x="180" y="46" width="380" height="96" rx="8" class="frame"/>
|
||||
<text x="190" y="64" class="b">路由选择部分(控制)</text>
|
||||
<line x1="222.5" y1="84" x2="222.5" y2="124" stroke="#7DBCB7" stroke-width="1.6"/>
|
||||
<line x1="210" y1="96.5" x2="250" y2="96.5" stroke="#7DBCB7" stroke-width="1.6"/>
|
||||
<line x1="230" y1="84" x2="230" y2="124" stroke="#7DBCB7" stroke-width="1.6"/>
|
||||
<line x1="210" y1="104" x2="250" y2="104" stroke="#7DBCB7" stroke-width="1.6"/>
|
||||
<line x1="237.5" y1="84" x2="237.5" y2="124" stroke="#7DBCB7" stroke-width="1.6"/>
|
||||
<line x1="210" y1="111.5" x2="250" y2="111.5" stroke="#7DBCB7" stroke-width="1.6"/>
|
||||
<rect x="215" y="89" width="30" height="30" rx="5" fill="#C6ECE9" stroke="#7DBCB7" stroke-width="1.2"/>
|
||||
<rect x="223.4" y="97.4" width="13.2" height="13.2" rx="2" fill="#FFFFFF" stroke="#7DBCB7" stroke-width="1"/>
|
||||
<text x="262" y="92" class="sub">路由选择处理机:运行 RIP、OSPF、BGP,</text>
|
||||
<text x="262" y="110" class="sub">与相邻路由器交换信息,计算出路由表,</text>
|
||||
<text x="262" y="128" class="sub">再生成转发表下发到各输入端口</text>
|
||||
<rect x="20" y="168" width="700" height="204" rx="8" class="frame"/>
|
||||
<text x="30" y="186" class="b">分组转发部分(数据)</text>
|
||||
<text x="100" y="212" class="c b">输入端口</text>
|
||||
<text x="185" y="212" class="c sub">转发表</text>
|
||||
<text x="620" y="212" class="c b">输出端口</text>
|
||||
<rect x="40" y="224" width="120" height="26" rx="13" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<rect x="50" y="228" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="61" y="241" class="c sub"></text>
|
||||
<rect x="76" y="228" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="87" y="241" class="c sub"></text>
|
||||
<rect x="102" y="228" width="22" height="18" rx="3" fill="none" stroke="#CCC" stroke-dasharray="3 2"/>
|
||||
<rect x="128" y="228" width="22" height="18" rx="3" fill="none" stroke="#CCC" stroke-dasharray="3 2"/>
|
||||
<rect x="172" y="227" width="26" height="20" rx="2" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<line x1="172" y1="237" x2="198" y2="237" stroke="#BBB" stroke-width="0.8"/>
|
||||
<line x1="185" y1="227" x2="185" y2="247" stroke="#BBB" stroke-width="0.8"/>
|
||||
<rect x="560" y="224" width="120" height="26" rx="13" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<rect x="570" y="228" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="581" y="241" class="c sub"></text>
|
||||
<rect x="596" y="228" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="607" y="241" class="c sub"></text>
|
||||
<rect x="622" y="228" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="633" y="241" class="c sub"></text>
|
||||
<rect x="648" y="228" width="22" height="18" rx="3" fill="none" stroke="#CCC" stroke-dasharray="3 2"/>
|
||||
<line x1="204" y1="237" x2="288" y2="292" class="arrow "/>
|
||||
<line x1="452" y1="292" x2="556" y2="237" class="arrow "/>
|
||||
<rect x="40" y="272" width="120" height="26" rx="13" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<rect x="50" y="276" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="61" y="289" class="c sub"></text>
|
||||
<rect x="76" y="276" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="87" y="289" class="c sub"></text>
|
||||
<rect x="102" y="276" width="22" height="18" rx="3" fill="none" stroke="#CCC" stroke-dasharray="3 2"/>
|
||||
<rect x="128" y="276" width="22" height="18" rx="3" fill="none" stroke="#CCC" stroke-dasharray="3 2"/>
|
||||
<rect x="172" y="275" width="26" height="20" rx="2" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<line x1="172" y1="285" x2="198" y2="285" stroke="#BBB" stroke-width="0.8"/>
|
||||
<line x1="185" y1="275" x2="185" y2="295" stroke="#BBB" stroke-width="0.8"/>
|
||||
<rect x="560" y="272" width="120" height="26" rx="13" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<rect x="570" y="276" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="581" y="289" class="c sub"></text>
|
||||
<rect x="596" y="276" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="607" y="289" class="c sub"></text>
|
||||
<rect x="622" y="276" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="633" y="289" class="c sub"></text>
|
||||
<rect x="648" y="276" width="22" height="18" rx="3" fill="none" stroke="#CCC" stroke-dasharray="3 2"/>
|
||||
<line x1="204" y1="285" x2="288" y2="292" class="arrow "/>
|
||||
<line x1="452" y1="292" x2="556" y2="285" class="arrow "/>
|
||||
<rect x="40" y="320" width="120" height="26" rx="13" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<rect x="50" y="324" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="61" y="337" class="c sub"></text>
|
||||
<rect x="76" y="324" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="87" y="337" class="c sub"></text>
|
||||
<rect x="102" y="324" width="22" height="18" rx="3" fill="none" stroke="#CCC" stroke-dasharray="3 2"/>
|
||||
<rect x="128" y="324" width="22" height="18" rx="3" fill="none" stroke="#CCC" stroke-dasharray="3 2"/>
|
||||
<rect x="172" y="323" width="26" height="20" rx="2" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<line x1="172" y1="333" x2="198" y2="333" stroke="#BBB" stroke-width="0.8"/>
|
||||
<line x1="185" y1="323" x2="185" y2="343" stroke="#BBB" stroke-width="0.8"/>
|
||||
<rect x="560" y="320" width="120" height="26" rx="13" fill="#FFFFFF" stroke="#BBBBBB" stroke-width="1.2"/>
|
||||
<rect x="570" y="324" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="581" y="337" class="c sub"></text>
|
||||
<rect x="596" y="324" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="607" y="337" class="c sub"></text>
|
||||
<rect x="622" y="324" width="22" height="18" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<text x="633" y="337" class="c sub"></text>
|
||||
<rect x="648" y="324" width="22" height="18" rx="3" fill="none" stroke="#CCC" stroke-dasharray="3 2"/>
|
||||
<line x1="204" y1="333" x2="288" y2="292" class="arrow "/>
|
||||
<line x1="452" y1="292" x2="556" y2="333" class="arrow "/>
|
||||
<rect x="290" y="250" width="160" height="84" rx="6" fill="#EAE9E7" stroke="#BFBEBA"/>
|
||||
<text x="370" y="290" class="b c">交换结构</text>
|
||||
<text x="370" y="305" class="sub c">把分组从输入端口</text>
|
||||
<text x="370" y="324" class="c sub">送到输出端口</text>
|
||||
<path d="M300,142 C300,196 250,206 202,226" class="arrow dash"/>
|
||||
<text x="40" y="396" class="sub">输入端口按目的地址查转发表,决定送往哪个输出端口;分组到达得比处理得快时就在端口排队,队列满了就丢弃。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.5 KiB |
@@ -0,0 +1,104 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="780" height="380" viewBox="0 0 780 380">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #3F3F3F; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #333; text-anchor: middle; }
|
||||
.b { font-weight: bold; }
|
||||
.c { text-anchor: middle; }
|
||||
.e { text-anchor: end; }
|
||||
.note { fill: #C0605A; }
|
||||
.ok { fill: #6A9F68; }
|
||||
.sub { font-size: 11px; fill: #6E6E6E; }
|
||||
.mono { font-family: Menlo, Consolas, monospace; }
|
||||
.arrow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#a); }
|
||||
.red { stroke: #C0605A; marker-end: url(#r); }
|
||||
.green { stroke: #6A9F68; marker-end: url(#g); }
|
||||
.dash { stroke-dasharray: 5 4; }
|
||||
.line { stroke: #555; stroke-width: 1.1; fill: none; }
|
||||
.frame { fill: none; stroke: #999; stroke-width: 1; stroke-dasharray: 4 3; }
|
||||
.shadow { fill: #DADADA; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#555"/>
|
||||
</marker>
|
||||
<marker id="r" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#C0605A"/>
|
||||
</marker>
|
||||
<marker id="g" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M1,1.5 L9.5,5 L1,8.5 z" fill="#6A9F68"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
|
||||
<text x="390" y="28" class="title">VPN 隧道:场所 A 的 X 访问场所 B 的 Y</text>
|
||||
<rect x="20" y="50" width="230" height="150" rx="8" class="frame"/>
|
||||
<text x="30" y="68" class="b">场所 A 10.1.0.0/16</text>
|
||||
<rect x="530" y="50" width="230" height="150" rx="8" class="frame"/>
|
||||
<text x="540" y="68" class="b">场所 B 10.2.0.0/16</text>
|
||||
<rect x="50" y="100" width="40" height="27.2" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<rect x="54" y="104" width="32" height="19.2" rx="1.5" fill="#FFFFFF" stroke="#7FB2D6" stroke-width="0.8"/>
|
||||
<path d="M66,127.2 v5 M74,127.2 v5" stroke="#7FB2D6" stroke-width="1.4"/>
|
||||
<rect x="58" y="132.2" width="24" height="3.5" rx="1.5" fill="#7FB2D6"/>
|
||||
<text x="70" y="152" class="c b">X</text>
|
||||
<text x="70" y="168" class="c sub mono">10.1.0.5</text>
|
||||
<rect x="690" y="100" width="40" height="27.2" rx="3" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<rect x="694" y="104" width="32" height="19.2" rx="1.5" fill="#FFFFFF" stroke="#7FB2D6" stroke-width="0.8"/>
|
||||
<path d="M706,127.2 v5 M714,127.2 v5" stroke="#7FB2D6" stroke-width="1.4"/>
|
||||
<rect x="698" y="132.2" width="24" height="3.5" rx="1.5" fill="#7FB2D6"/>
|
||||
<text x="710" y="152" class="c b">Y</text>
|
||||
<text x="710" y="168" class="c sub mono">10.2.0.8</text>
|
||||
<circle cx="200" cy="116" r="17" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<line x1="204.25" y1="120.25" x2="211.9" y2="127.9" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="195.75" y1="111.75" x2="188.1" y2="104.1" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="204.25" y1="111.75" x2="211.9" y2="104.1" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="195.75" y1="120.25" x2="188.1" y2="127.9" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M207.9,127.9 L211.9,127.9 L211.9,123.9" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M192.1,104.1 L188.1,104.1 L188.1,108.1" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M208.25,111.75 L204.25,111.75 L204.25,107.75" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M191.75,120.25 L195.75,120.25 L195.75,124.25" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<text x="200" y="152" class="c b">R1</text>
|
||||
<text x="200" y="168" class="c sub mono">203.0.113.1</text>
|
||||
<circle cx="580" cy="116" r="17" fill="#C6E4FB" stroke="#7FB2D6" stroke-width="1.2"/>
|
||||
<line x1="584.25" y1="120.25" x2="591.9" y2="127.9" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="575.75" y1="111.75" x2="568.1" y2="104.1" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="584.25" y1="111.75" x2="591.9" y2="104.1" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<line x1="575.75" y1="120.25" x2="568.1" y2="127.9" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M587.9,127.9 L591.9,127.9 L591.9,123.9" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M572.1,104.1 L568.1,104.1 L568.1,108.1" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M588.25,111.75 L584.25,111.75 L584.25,107.75" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<path d="M571.75,120.25 L575.75,120.25 L575.75,124.25" fill="none" stroke="#7FB2D6" stroke-width="1.6" stroke-linecap="round"/>
|
||||
<text x="580" y="152" class="c b">R2</text>
|
||||
<text x="580" y="168" class="c sub mono">198.51.100.2</text>
|
||||
<path d="M319.6,156 C271.2,156 275.6,111 315.2,108 C310.8,74 385.6,61 403.2,86 C429.6,68 482.4,78 469.2,108 C508.8,112 508.8,156 460.4,156 Z" fill="#F4F4F4" stroke="#C8C8C8" stroke-width="1.2"/>
|
||||
<text x="390" y="88" class="c b">互联网</text>
|
||||
<rect x="220" y="108" width="340" height="16" rx="8" fill="#E6E3FA" opacity="0.55"/>
|
||||
<text x="390" y="142" class="c sub">隧道</text>
|
||||
<line x1="94" y1="116" x2="183" y2="116" class="line"/>
|
||||
<line x1="597" y1="116" x2="686" y2="116" class="line"/>
|
||||
<rect x="20" y="236" width="190" height="56" rx="4" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<rect x="26" y="242" width="96" height="44" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="74" y="260" class="c sub mono" style="fill:#555">源 10.1.0.5</text>
|
||||
<text x="74" y="276" class="c sub mono" style="fill:#555">目的 10.2.0.8</text>
|
||||
<text x="166" y="268" class="c sub">数据</text>
|
||||
<rect x="265" y="236" width="250" height="56" rx="4" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<rect x="271" y="242" width="128" height="44" rx="3" fill="#C6ECE9" stroke="#7DBCB7"/>
|
||||
<text x="335" y="260" class="c sub mono" style="fill:#555">源 203.0.113.1</text>
|
||||
<text x="335" y="276" class="c sub mono" style="fill:#555">目的 198.51.100.2</text>
|
||||
<rect x="405" y="242" width="104" height="44" rx="3" fill="#E6E3FA" stroke="#B8B0DE"/>
|
||||
<path d="M416,260 v-4 a5,5 0 0 1 10,0 v4" fill="none" stroke="#B8B0DE" stroke-width="1.8"/>
|
||||
<rect x="413" y="260" width="16" height="12" rx="2" fill="#E6E3FA" stroke="#B8B0DE" stroke-width="1.2"/>
|
||||
<text x="437" y="260" class="sub" style="fill:#555">加密后的</text>
|
||||
<text x="437" y="276" class="sub" style="fill:#555">原数据报</text>
|
||||
<rect x="570" y="236" width="190" height="56" rx="4" fill="#FFFFFF" stroke="#BBBBBB"/>
|
||||
<rect x="576" y="242" width="96" height="44" rx="3" fill="#C6E4FB" stroke="#7FB2D6"/>
|
||||
<text x="624" y="260" class="c sub mono" style="fill:#555">源 10.1.0.5</text>
|
||||
<text x="624" y="276" class="c sub mono" style="fill:#555">目的 10.2.0.8</text>
|
||||
<text x="716" y="268" class="c sub">数据</text>
|
||||
<text x="115" y="312" class="c sub">① X 发出的数据报</text>
|
||||
<text x="390" y="312" class="c sub">② R1 加密后加上新的首部</text>
|
||||
<text x="665" y="312" class="c sub">③ R2 解密,恢复原数据报</text>
|
||||
<line x1="212" y1="264" x2="260" y2="264" class="arrow "/>
|
||||
<line x1="518" y1="264" x2="566" y2="264" class="arrow "/>
|
||||
<text x="20" y="352" class="sub">互联网上的路由器只看到 R1、R2 的全球地址,看不到专用地址和数据内容。</text>
|
||||
<text x="20" y="370" class="sub">图中的全球地址取自 RFC 5737 规定的文档示例地址段。</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.7 KiB |