当前位置:网站首页>一篇文章学会子网划分
一篇文章学会子网划分
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地址利用率。

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






边栏推荐
- 2202 - production de CV
- Start of u-boot_ Armboot analysis (II)
- Day 3 of jsbom and DOM learning
- 同花顺开证券账户怎么样?到底安不安全呢
- scala中的隐式转换和隐式参数讲解与实践
- Opencv source code compilation
- 2202-简历制作
- 36 krypton's debut | "osogena" won nearly ten million angel rounds of financing. The original DLR scientists of German Aerospace Research and development system modeling and simulation CAE software PA
- Automatically obtain the position offset of member variables inside the structure
- Ast, really fragrant
猜你喜欢

Zhengzhou University of light industry -- development and sharing of harmonyos pet health system

Basic operations of dict and set

Video tracker error troubleshooting
![[kubernetes guide ④] pod quick start](/img/ed/e016d2469ee29a387238dc3b5ebbd6.png)
[kubernetes guide ④] pod quick start

SAP QM qp03 displays an inspection plan with multiple specs inspection features

Examination questions and online simulation examination for safety management personnel of hazardous chemical business units in 2022

Industry reshuffle, a large number of programmers are going to lose their jobs? How can we break the current workplace dilemma

CST learning: four element array design of circular patch antenna (III) array formation and parallel excitation

Opencv source code compilation

AWS lambda: how to store secrets to external APIs- AWS Lambda: How to store secret to external API?
随机推荐
2202 - production de CV
Using baserecyclerviewadapterhelper to implement tree structure
Comprehensive analysis of C array
M_8:设计消息队列存储消息数据的 MySQL 表格
Memory address mapping of u-boot
2022 operation of simulated examination platform for hoisting machinery command certificate
Tsinghua University image source will cause tensorflow GPU installation failure
OSM地图本地发布-如何生成各省市矢量地图
CS for mobile security [nethunter]
测试平台系列(97) 完善执行case部分
NCF 的Dapr应用实例的运行
Face detection: mtcnn
Video tracker error troubleshooting
Actual combat | inductance element positioning -- detailed explanation of Halcon and opencv implementation (with source code)
How does idea switch the interface to Chinese
[SciPy optimization tutorial] v. quick solution of univariate function optimization
Accelerating with Dali modules
Introduction to message oriented middleware (message queue)
Message queue directory
Introduction to business rules service on SAP Business Technology Platform (BTP)