Method of IP Address conversion

Source: Internet
Author: User

According to the TCP/IP protocol, IP addresses are made up of 32-bit binary numbers and are unique across the Internet.

I am also today again learned again, mainly say when giving you an IP address such as: 192.168.1.1, you can convert to binary, or give you 11000000 10101000 00000001 00000001, you can convert to 10. Well, let's go over it again. Here three methods are introduced by difficulty to easy.

One is division.

When you give this IP address 192.168.1.1, divide it into four segments, except 2, first 192÷2=96 again with 96÷2=48 48÷2=24 24÷2=12 12÷2=6 6÷2=3 3 divided by 2 in 1, and finally equals 1100000000, as long as you can do in addition to 0, The inability to do so (including the last except 1 o'clock) is 1. That 192 is 11000000,168 is 10101000,1 is 00000001.

The second is subtraction

First of all, the number of 128 64 32 16 8 4 2 1, and then when you give a number to reduce the number of the above requirements is to be reduced to the positive is not negative, subtract the number of 1, did not do subtraction of 0. 192-128=64 and 64 minus 64 is just equal to 0, that is 11000000, again, such as 50,50 only minus 32 equals 18, 18 minus 16 equals 2, 2 minus 2 equals 0, that's 00110010, and this method is more obvious than division.

If the above two are still not learned, then I will come up with the last killer, whether you have not learned before, even if you have not learned as long as you know the number you want to get--that is, using Windows with its own calculator, click on the top view-programmers. All right, now. Enter a number in point binary it will be converted automatically, decimal also the same.

Addressing rules for IP 1. Network addressing rule A, network address must be unique. B, the network identity cannot begin with the number 127. In the Class A address, the number 127 is reserved for the internal loopback function. C, the first byte of the network identity cannot be 255. Number 255 as broadcast address. D, the first byte of the network ID cannot be "0", "0" indicates that the address is a local host and cannot be routed. 2. Host addressing rule A, host identity must be unique within the same network. B, the host identity of each bit can not be "1", if all bits are "1", then the machine address is the broadcast address, not the address of the host. C, the host identity of each bit can not be "0", if each bit is "0", it means "only this network", and the network does not have any hosts.

Note : More wonderful tutorials Please pay attention to the triple computer tutorial section, triple Computer office group: 189034526 welcome you to join

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.