The relationship between IP address and subnet mask

Subnet mask is used to determine the IP address of any two computers is the same sub-network basis.

The most simple is the two computers to understand their own IP address and subnet mask for the AND operation, if the result is the same, then the two computers are in the same sub-network, direct communication can be . It's that simple.

Consider the following example:

Operational demonstration of: aa

IP address 192.168.0.1

Subnet Mask 255.255.255.0

Be converted into binary operations:

IP Address 11010000.10101000.00000000.00000001

Subnet mask 11111111.11111111.11111111.00000000

AND operation

11000000.10101000.00000000.00000000
After conversion to decimal:

192.168.0.0

Presentation of the two operations:

IP address 192.168.0.254

Subnet Mask 255.255.255.0

Be converted into binary operations:

IP Address 11010000.10101000.00000000.11111110

Subnet mask 11111111.11111111.11111111.00000000

AND operation

11000000.10101000.00000000.00000000
After conversion to decimal:

192.168.0.0

Presentation of the three operations:

IP address 192.168.0.4

Subnet Mask 255.255.255.0

Be converted into binary operations:

IP Address 11010000.10101000.00000000.00000100

Subnet mask 11111111.11111111.11111111.00000000

AND operation

11000000.10101000.00000000.00000000

After conversion to decimal:

192.168.0.0

Through the above three groups of computer IP address and subnet mask AND operation, we can see that it is the same as the result of the operation. Are 192.168.0.0

So this computer will be the same as three sub-networks computer, and then to communicate.

分类:Internet 时间:2011-08-14 人气:307
分享到:
blog comments powered by Disqus

相关文章

  • Ip address subnet mask, and the relationship between the special purpose of the IP address & description 2010-06-22

    Subnet mask is used to determine the IP address of any two computers is the same sub-network basis. The most simple is the two computers to understand their own IP address and subnet mask AND operation, if the result is the same, it indicates that th

  • Discuz 5.0 中读取纯真IP数据库函数分析 2014-02-14

    Discuz 5.0 不在使用自己的IP数据,而是使用纯真IP的数据格式, 存取纯真IP数据库稍微有点麻烦,它的存储格式比较特殊也很有趣,具体的格式分析参考下面两个链接,其他语言实现参考文章末的链接. <纯真IP数据库格式详解> 链接一:http://blog.csdn.net/heiyeshuwu/archive/2006/05/12/725675.aspx 链接二:http://lumaqq.linuxsir.org/article/qqwry_format_detail.html 纯真I

  • Router of 192.168.1.1 2010-03-19

    MAC MAC (Media Access Control, Medium Access Control ) MAC address is burning in the Network Interface Card (NIC, NIC) inside. MAC address, also known as the hardware address is 48 bits long (6 bytes), 16 hex .0-23 bit numbers assigned by the manufac

  • mysql odbc does not recognize 192.168.1.22 2011-07-14

    Today, the reverse with the power designer mysql database and found that actually can not establish 192.168.1.22 mysql odbc data source, reports: Connection Fialed: [HY000] [MySQL] [ODBC 5.1 Driver] Access denied for user 'xxx' @ '192 .168. 19.105 '(

  • Authorized to resolve Host '192 .168.1.180 'is not allowed to connect to this MySQL server 2011-04-19

    Authorized to resolve Host '192 .168.1.180 'is not allowed to connect to this MySQL server GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY' mypassword 'WITH GRANT OPTION

  • RROR 1045 (28000): Access denied for user 'root' @ '192 .168.2.12 (using password: 2011-04-21

    This is a mysql permissions not reported on a solution: 1, landing mysql, mysql-uroot-hlocalhost-p 2, use mysql (must be the library system) 3, update user set host = '%' where user = 'root'; (can be anonymous and no password will be able to clear th

  • samba configuration (from the online collection) 2010-02-17

    samba server configuration file in / etc / samba / smb.conf under the Open a terminal type: gedit / etc / samba / smb.conf can also use the vi editor. Because the file is too long, I personally can not use the East East deleted, mainly because some c

  • Linux IP set-related 2010-05-27

    Original: http://blog.sina.com.cn/s/blog_6238358c0100h1kw.html 1. Configuration file / Etc / hosts (the local host ip address mapping, you can have multiple aliases). / Etc / services (port number and the correspondence between the standard service).

  • Linux network card configuration 2011-09-10

    1 Profile / Etc / hosts (the local host ip address mapping, you can have multiple aliases). / Etc / services (port number and the correspondence between the standard service). / Etc / sysconfig / network (set host name, gateway, domain name). HOSTANM

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.175 (s). 14 q(s)