subnetting and the subnet mask
原文:https://www.techopedia.com/6/28587/internet/8-steps-to-understanding-ip-subnetting/5
Step 4 - Subnetting and the Subnet Mask
To subnet a network is to create logical divisions of the network. Subnetting, therefore, involves dividing the network into smaller portions called subnets. Subnetting applies to IP addresses because this is done by borrowing bits from the host portion of the IP address. In a sense, the IP address then has three components - the network part, the subnet part and, finally, the host part.
We create a subnet by logically grabbing the last bit from the network component of the address and using it to determine the number of subnets required. In the following example, a Class C address normally has 24 bits for the network address and eight for the host, but we are going to borrow the left-most bit of the host address and declare it as identifying the subnet.

If the bit is a 0, then that will be one subnet; if the bit is a 1, that would be the second subnet. Of course, with only one borrowed bit we can only have two possible subnets. By the same token, that also reduces the number of hosts we can have on the network to 127 (but actually 125 useable addresses given all zeros and all ones are not recommended addresses), down from 255.
So how can you tell how many bits should be borrowed, or, in other words, how many subnets we want to have on our network?
The answer is with a subnet mask.
Subnet masks sound a lot scarier than they really are. All that a subnet mask does is indicate how many bits are being “borrowed” from the host component of an IP address. If you can’t remember anything about subnetting, remember this concept. It is the foundation of all subnetting.
The reason a subnet mask has this name is that it literally masks out the host bits being borrowed from the host address portion of the IP address.
In the following diagram, there is a subnet mask for a Class C address. The subnet mask is 255.255.255.128 which, when translated into bits, indicates which bits of the host part of the address will be used to determine the subnet number.

Of course, more bits borrowed means fewer individually addressable hosts that can be on the network. Sometimes, all the combinations and permutations can be confusing, so here are some tables of subnet possibilities.



Note that this combination of IP addresses and subnet masks in the charts are written as two separate values, such as Network Address = 205.112.45.60, Mask = 255.255.255.128, or as an IP address with the number of bits indicated as being used for the mask, like 205.112.45.60/25.
Subnet masks work because of the magic of Boolean logic. To best understand how a subnet mask actually does its thing, you must remember that a subnet mask is only relevant when getting to a subnet. In other words, determining what subnet an IP address lives on is the only reason for a subnet mask. It’s devices like routers and switches that make use of subnet masks.
subnetting and the subnet mask的更多相关文章
- Subnet Routing Examples
Routing Table Each row in routing table contains: Destination IP address IP address of next-hop rout ...
- Subnetting
Subnet Addressing To better utilize IP address Subnet addressing introduces another hierarchical(分层) ...
- 【转】IP协议详解之子网寻址、子网掩码、构造超网
子网寻址 1. 从两级IP地址到三级IP地址 <1>. IP地址利用率有时很低. <2>. 给每一个物理网络分配一个网络号会使路由表变得太大而使网络性能变坏. <3> ...
- [转]CIDR简介
IP Subnetting and Variable Length Subnet Masks Subnetting Basics 子网划分(subnetting)的优点: 1.减少网络流量 2.提高网 ...
- ip 子网掩码 网关 DNS
这一篇文章也很好: 原文引用于: http://www.cnblogs.com/jiqing9006/p/3365939.html 内外网ip: IP地址: IPv4地址分为A.B.C.D.E五类, ...
- IP地址、子网掩码详解
如何通过子网掩码划分网段 资料一: 一.缺省A.B.C类地址,子网掩码: 二.子网掩码的作用: code: IP地址 192.20.15.5 11000000 00010100 00001111 ...
- Internetworking
1 Introduction 所谓的InternetWorking就是将很多网络连接起来,那么在这种连接的网络下我们该如何传送封包呢? 2 IP and Routers 1 IP Datagram H ...
- CCNA 之 三 TCP/IP 及 子网划分
TCP/IP TCP/IP 协议集或协议簇 概念: 传输控制协议/IRI特网协议(TCP/IP)组是由美国国防比(DoD)所创建的,主要用来确保数据的完整性及毁灭性战争中维持通信 是有一组不同功能的协 ...
- 文件转移 互联网组成 路由器 分组交换 交换机 冲突域 网卡 数据帧的发送与接收会带来CPU开销 CPU中断 双网卡切换
https://zh.wikipedia.org/zh-cn/网段 在以太网环境中,一个网段其实也就是一个冲突域(碰撞域).同一网段中的设备共享(包括通过集线器等设备中转连接)同一物理总线,在这一总线 ...
随机推荐
- Mysql的热备份[转载]
学一点 mysql 双机异地热备份----快速理解mysql主从,主主备份原理及实践 双机热备的概念简单说一下,就是要保持两个数据库的状态自动同步.对任何一个数据库的操作都自动应用到另外一个数据库,始 ...
- vultr vps新增reserved IPs功能,保留服务器原有IP
高性价比海外vps品牌vultr vps宣布一项新功能叫“reserved IPs”,顾名思义是帮助你保留服务器IP地址,以备后用. 这个需求是因为用户经常新建.删除一个vps服务器,默认分配的是随机 ...
- 如何使用Maven的archetype快速生成一个新项目(解决生成项目目录不完整问题)
Maven的archetype Plugin可能大家都听过,但不一定都能很好地用好它.缺省地如果你使用 mvn archetype:generate 会从maven的Repository里查找所有支 ...
- <密码的实现>输入密码的时候,显示“*”,而不是显示输入内容
一开始还以为用C语言和C++不能实现输入密码的时候显示出“*”而不显示输入的内容呢!没想到偶然的机会试出了用while循环结构可以实现.以下是我整理的C语言和C++的代码,供初学者参考. 这是C语言实 ...
- Linux 服务器系统监控脚本 Shell【转】
转自: Linux 服务器系统监控脚本 Shell - 今日头条(www.toutiao.com)http://www.toutiao.com/i6373134402163048961/ 本程序在Ce ...
- H264帧内预测模式编号的编码过程
1 本文词汇约定 宏块:H264编码基本单元,16x16像素(或采样)构成 块: 由8x8像素(或采样)构成的单位 子块: 由4x4像素(或采样)构成的单位 2 帧内亮度预测模式 H264规范 ...
- DIV+CSS 让同一行的图片和文字对齐
在div+css布局中,如果一行(或一个DIV)内容中有图片和文字的话,图片和文字往往会一个在上一个在下,这是一个新手都会遇到问题,我的解决方法有三: 1.添加CSS属性:vertical-align ...
- 小谈数据库Char、VarChar、NVarChar差异
1. char 固定长度,最长n个字符. 2. varchar 最大长度为n的可变字符串. (n为某一整数,不同数据库,最大长度n不同) char和varchar区别: ...
- 学到的较复杂的 mysql 语名
需求是这样的:需要找出没有发任务的店铺是哪些.好让客服去联系他们,询问情况. 每个商家可以有N个店铺,每个店铺可以放N个任务,一个任务会生成N个任务订单,会员接到任务去完成 SELECT *FROM ...
- SQLite安装
SQLite 的一个重要的特性是零配置的,这意味着不需要复杂的安装或管理.本章将讲解 Windows.Linux 和 Mac OS X 上的安装设置. 一.在Windows上安装SQLite 访问SQ ...