当前位置:网站首页>IP编址概述
IP编址概述
2022-06-11 23:57:00 【MLuhuihui】
1.IP地址构成
IP地址(IPv4)一个有32位,把没4位转换成十进制,用.连接,这种表示形式就是IP地址的点分十进制IP地址形式。
比如,IP地址233.1.1.1,其中,IP地址的高比特位,表示的是网络号,低比特位表示的是主机号:

把网络号相同的IP地址划分成一个子网,这时,一个子网下的IP地址的网络号相同,但是主机号不能相同,各个主机之间通讯可以不跨越路由器进行通讯。有了这样一个编址策略,路由器在路由转发时,路由转发表就不用去记录具体某一个主机的地址了,只需要去记录每一个IP子网的地址。
2.IP地址分类
IP地址根据最高位的不同,可以划分为如下的ABCDE共5类:

其中,DE类地址日常生活中不是很常见。A类地址,前8位作为网络号,也就是说A类子网划分相对较少,但是每一个子网的设备数会很多,C类地址刚好相反。
查询自己的网络IP地址,发现,我主机的IP地址前8位是172,也就是说是B类地址。我的主机给树莓派分配的IP地址,前8位是192,也就是说是C类地址。
除此之外,还有一些很特殊的IP地址,在使用中需要注意(学到这里,有点醍醐灌顶的感觉)

首先是全0的IP地址,这种IP地址适用于:我要使用TCP/IP协议发送数据,但是我没有分配到IP地址,这时候就能将其设置为全0,这种情况可以发送数据,但是不能接受。其他几种类似。
除此之外,还有一种特殊的IP地址,被称为私有IP地址:

私有地址只用于内部网络,在公共互联网上是无效的。值得注意的是,这些地址是只能在内部使用,因此,这些地址是可以重复使用的。原来我的主机WLAN地址和主机分配给树莓派的IP地址都是私有地址!
3.子网划分
上述内容中讲到,我们通过划分IP地址,将IP分为了5类,通过IP地址的高位确定网络号,网络号相同的IP,为一个子网。
但是,在实际的应用中,我们会发现一个问题,就是比如使用AB类地址时,网络号占用位数少,主机号占用位数多,使得子网中的主机数可能会十分庞大,为了解决这个问题,需要对子网进行划分。
子网的划分,需要借用到一定位数的主机号,被称之为子网号,不同的子网号,代表这源子网划分成的不同的小的子网。

那么,我们,我们怎么确定有没有划分子网呢,又划分了多少个子网呢?这就需要通过子网掩码了实现了:

也就是死,主机号有多少个高位被站位成了1,就说明子网号是多少位的,比如B类子网的子网掩码为:11111111.11111111.11100000.00000000,其中,高3位被占用了。

边栏推荐
- NFS quotas:Cannot register service: RPC: Authentication error
- Pad printing process flow and application precautions
- SF14 | supertrend "super trend" indicator magic change and upgrade (source code)
- 04 automatic learning rate - learning notes - lihongyi's in-depth learning 2021
- Share a treasure website necessary for new media operation for free
- (counting class +dp) acwing 900 Integer partition
- Lake Shore - supervaritemp low temperature thermostat
- loading
- 明德扬FPGA开发板XILINX-K7核心板Kintex7 XC7K325 410T工业级
- 删除收货地址【项目 商城】
猜你喜欢

Procédures d'introduction et d'installation de sonarqube

C language leetcode deleting duplicate items in an ordered array

HMS core shows the latest open capabilities in mwc2022, helping developers build high-quality applications

Are you still struggling with the gold content of PMP

WALLYS Qualcomm-Atheros-QCA9882-2T2R-MIMO-802.11ac-Mini-PCIe-WiFi 6E-Module-5G-high-power

【JUC系列】Executor框架之概览

Flex flexible layout tutorial and understanding of the main axis cross axis: Grammar

Chisel environment setup (win10 + vscode)

How many steps does it take for C language to become Fibonacci number

(linear DP | monotone queue) acwing 895 Longest ascending subsequence
随机推荐
mysql5和mysql8同时安装
Pre resolution and scope
Class. Getresource() and class Getresourceasstream() method
Mingdeyang FPGA development board xilinx-k7 core board kinex7k325 410t industrial grade
CD流程
【juc学习之路第6天】并发计算器与线程随机因子
Graph and graph traversal
SF14 | supertrend "super trend" indicator magic change and upgrade (source code)
DPT-FSNET: DUAL-PATH TRANSFORMER BASED FULL-BAND AND SUB-BAND FUSION NETWORK FOR SPEECH ENHANCEMENT
C language leetcode deleting duplicate items in an ordered array
Display product details [project mall]
2022 618笔记本选购指北
(dp) acwing 899. Edit distance
PHP mkdir(): Permission denied上传文件会把文件夹权限改为411权限
Lake Shore—SuperTran 连续流低温恒温器系统
Lake Shore—SuperTran-VP 连续流低温恒温器系统
Mingdeyang ADC series development board-ad9653 daughter board multi-channel high resolution and high sampling rate
我的创作纪念日
MySQL some simple commands
Handwritten simple promise