forked from StevenBaby/onix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
779413b
commit 9182ce2
Showing
7 changed files
with
255 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# ARP 缓存 | ||
|
||
缓存 IP -> MAC 地址的映射关系; | ||
|
||
## 子网掩码 | ||
|
||
Classless Inter-Domain Routing(CIDR) 无类别域间路由,定义在 RFC4632 [^rfc4632]; | ||
|
||
互联网的机器都有一个唯一的 IP 地址,但是 IP 地址被分为两个部分,前面的部分称为 网络部分,后面的部分称为主机部分,这两部分通过子网掩码标记,子网掩码的 32 位分成了两部分,高位全为 1,低位全为 0; | ||
|
||
比如对于常见的子网掩码:`255.255.255.0`,其二进制为 `11111111_11111111_11111111_00000000`,表示如果两个 IP 地址的前三个字节(高 24 位)如果相等,则两 IP 在同一个局域网中,发包时可以直接发送。比如:`192.168.111.11` 和 `192.168.111.22`;由于子网掩码的前面(高位)全为 1,所以很多时候子网掩码可以表示成 1 的数量,与 IP 地址合并在一起表示成 `192.168.111.11/24`。 | ||
|
||
## 参考 | ||
|
||
- <https://en.wikipedia.org/wiki/Subnetwork> | ||
|
||
[^rfc4632]: <https://datatracker.ietf.org/doc/html/rfc4632> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters