当前位置:网站首页>一篇文章学会子网划分
一篇文章学会子网划分
2022-06-12 23:47:00 【孙不坚1208】
IP地址与子网划分
临近期末,复习计算机网络,一篇文章教你搞懂子网划分。
基本概念
根据TCP/IP协议,连接在Internet上的每个设备都必须有一个全球唯一的IP地址(网络层使用的逻辑地址) 32位的二进制数。
一般用点分十进制表示:每8位一组,转换成十进制,用"."隔开
含义:网络号+主机号
32(bit)位的二进制数:

点分十进制:每8位转换成一个十进制数,用.隔开

IP地址含义:

IP地址的自然分类
| IP地址类型 | 二进制固定 最高位 | 第一字节 十进制范围 | 二进制 网络号 | 二进制 主机号 |
|---|---|---|---|---|
| A类 | 0 | 0~127 | 8位 | 24位 |
| B类 | 1 | 128~191 | 16位 | 16位 |
| C类 | 110 | 192~223 | 24位 | 8位 |
| D类 | 1110 | 224~239 | 组播使用 | |
| E类 | 11110 | 240~255 | 保留试验使用 |
特殊IP地址
网络地址: 网络地址用于表示设备所在网络本身。网络号部分不 变,主机号部分为全“0”(二进制)的IP地址称为网络地址。如主机129.5.1.1(B类)所在网络的网络地址是129.5.0.0。
广播地址: 广播地址用于向同一网络中的所有设备进行广播。网 络号部分不变,而主机号部分为全“1”(二进制)的IP地址称 为广播地址。如主机 129.5.1.1 ( B 类 ) 所 在 网 络 的 广 播 地 址 就 是 129.5.255.255。
环回地址: 网络中设备地址不能以十进制的127作为开头,127开 头的地址保留给系统作诊断用,称为环回地址。如用指令: ping 127.0.0.1 测试本地网卡是否正常工作(回路测试)
题目:判断以下IP地址的分类
10.2.1.1 128.63.2.100 201.222.5.64 192.6.141.2 256.241.201.10
| IP地址 | 类别 | 网络地址 | 广播地址 |
|---|---|---|---|
| 10.2.1.1 | A | 10.0.0.0 | 10.255.255.255 |
| 128.63.2.100 | B | 128.63.0.0 | 128.63.255.255 |
| 201.222.5.64 | C | 201.222.5.0 | 201.222.5.255 |
| 192.6.141.2 | C | 192.6.141.0 | 192.6.141.255 |
256.241.201.10 不存在
子网掩码
- 子网掩码:用于识别IP地址中的网络号的位数
- 2种表示方法:
- 32位二进制数字,在子网掩码中,对应于网络号部分用二进制“1”表示,主机号部分用二进制“0”表示。如IP地址 1.1.1.1 的子网掩码是255.0.0.0,表示这个地址的前8位是网络号。
- 网络后缀法,即“IP地址/网络号位数” ,如138.96.0.1/18表 示该IP地址所在网络的网络号18位,主机号14位。

- 一个网络,主机号有x位,则这个网络可以分配给主机的IP地址有多少个?
- 该网络共包含2的x次方个地址,去除网络地址和广播地址,可分配给主机的IP地址是2的x次方-2个
- 例如,一个C类网络,可分配给主机的IP地址为2的8次方-2=254个
子网划分(题目实战)
划分子网的原因: 提高IP地址利用率。

子网划分的核心思想: 网络号不变,借用部分主机号来产生新的网络。






边栏推荐
- 测试平台系列(97) 完善执行case部分
- Printf segment error (core dump): a problem caused by formatted output
- SAP Business Technology Platform (BTP) workflow function introduction
- So, what is the difference between e.target and e.currenttarget?
- 2022 operation of simulated examination platform for hoisting machinery command certificate
- Operation of simulation test platform for G3 boiler water treatment test questions in 2022
- SAP 业务技术平台(BTP) 上的 Business Rules Service 使用介绍
- 如何利用华为云容灾解决方案替代灾备一体机
- SAP QM qp03 displays an inspection plan with multiple specs inspection features
- 支持Canvas的Leaflet.Path.DashFlow动态流向线
猜你喜欢

2022 operation of simulated examination platform for hoisting machinery command certificate
![Buuctf-[ciscn 2019 preliminary]love math](/img/56/dbe7fc1d5a55551153e3df39810856.jpg)
Buuctf-[ciscn 2019 preliminary]love math

Case sharing of online real queuing system reconfiguration -- practical part

VS2015 DLIB 1916 USER_ ERROR__ inconsistent_ build_ configuration__ see_ dlib_ faq_ 1 USER_ ERROR__ inconsiste

Start of u-boot S analysis (III)

【Matlab】三维曲线与三维曲面

Heilongjiang Branch and Liaoning Branch of PostgreSQL Chinese community have been established!
![[North Asia data recovery] data recovery cases in which the partitions disappear and the partitions are inaccessible after the server reinstalls the system](/img/a9/7726139037860a5f880667cec4b6c2.jpg)
[North Asia data recovery] data recovery cases in which the partitions disappear and the partitions are inaccessible after the server reinstalls the system
![[opencv learning] use the Tesseract OCR movement to recognize numbers](/img/ed/92e5261c9abda4e79d58e9404d3aee.jpg)
[opencv learning] use the Tesseract OCR movement to recognize numbers

2022年危险化学品经营单位安全管理人员考试试题及在线模拟考试
随机推荐
CV—BaseLine总结(从AlexNet到SENet的发展历程)
Hongmeng starts
How to publish OSM maps locally and customize the mapping
KConfig
[redis sentinel] failed listening on port 26379 (TCP) & sentinel mode no response problem solved
OSM map local publishing - how to generate vector maps of provinces and cities
RT thread quick start - experience RT thread
Record 5 - the serial port of stm32f411ceu6 realizes the sending and receiving of fixed length data and variable length data
Cherry Blossom powder Dudu
移动安全必备之CS呢【NETHUNTER】
cookie
leaflet中如何通过透明度控制layerGroup的显示隐藏
H5時代leaflet中還在用DivIcon?
启牛帮开通的股票账户是安全可信的吗?
Message queue directory
[opencv learning] perspective transformation matrix
[SciPy optimization tutorial] v. quick solution of univariate function optimization
Enterprise wechat H5_ Authentication, PC website, enterprise wechat scanning code, authorized login
Comprehensive analysis of C array
Tsinghua University image source will cause tensorflow GPU installation failure