Understand the meaning of an IPv4 address

Source: Internet
Author: User

The network cannot work without an address: as long as you send something, you need to specify where and where the thing is to be sent. To be an efficient network engineer or administrator, You need to fully understand the IP Address: You need to be able to think on your own. If some problems occur, it is likely that some addresses are incorrectly allocated. It is very important for heroes and common people to quickly find out where the fault is located. It takes a long time for ordinary people to fix this problem. Before the next article introduces subnets, I would like to give a full introduction to IP addresses in the original format. This is very important for understanding subnets.
IPv4 address and 32-bit number
The IP address is only a 32-bit binary number. However, they are important binary numbers: You need to know how to handle these numbers. When processing the subnet mask, new network administrators generally confuse the subnet mask they do not remember. The sum of all these subnet masks is the boundary between moving the address part of a "network" and representing the part of a "host. Once you have adapted to this way of thinking about IP addresses and subnet masks, you have mastered the IP address method.
Binary is very simple. In binary, the number is only 0 and 1. A 32-bit digital has 32 0 and 1. We all use decimal numbers. In decimal notation, each position in a number can be any number between 0 and 9. In binary, each position is either 0 or 1. The following is the 255.255.255.0 address in binary format.
11111111.111111.1111111111.00000000
For convenience, network engineers generally divide an IP address into four eight-bit fields, or eight-bit bytes. In an 8-digit number, if all the bytes are set to 1, the number is equal to 255. In the above address, 11111111 represents 255, 00000000 represents 0.
The binary function is based on a second. Each byte represents a different quadratic. From the left-hand end, the most meaningful digits are composed of the following columns:

2Power 232 ... 27 26 25 24 23 22 21 20
Decimal 4,294,967,296 ... 128 64 32 16 8 4 2 1

The result is addition. That is to say, if all the bytes remain unchanged, you can simply add a power value of 2 to each position. For example, if we have an 8-digit 11111111, we can simply add: 27 + 2 6 +
2 5 + 2 4 + 2 3 + 2 2 + 2 1 + 2 0 = 255

Now we try to understand an extraordinary example: 11110000

We can see that four of the above eight digits are "fixed ". Add the 2's power to these positions. The result is 27 + 26 + 2 5 + 2 4 = 240.

This is simple. If you can convert a binary number to a decimal number, you can easily guess the subnet mask and network address. We will introduce this question in the next article.

Now, the focus is on the 32-bit IPv4 address itself. There are some different types that need to be understood. All IP addresses can be in the range of 0.0.0.0 to 255.255.255.255. However, some addresses have special purposes.

Loopback ):

Packets that do not leave the host (that is, these packets are not transmitted through the external network interface ). Example: 127.0.0.1

Unicast address:

Specifies the packet sent to an IP address. Example: 2.2.2.2

Multicast address:

The data packet that is replicated by the router and finally forwarded by the multicast routing mechanism. Example: 226.0.0.2

Limited broadcast:

One broadcast packet is sent to each host, which is limited to a local subnet. Example: 255.255.255.255

Targeted broadcast:

Packets sent to a specific subnet are then broadcast. For example, if we are not in this subnet, the address used is 1.1.1.255.

There are also some special IP addresses, including private and multicast addresses. The address range between 224.0.0.0 and 239.255.255.255 is reserved for multicast. On the Internet, any address that falls below this range may become the target of the attack, unless it is the address reserved for RFC 1918 and allocated for some other special purposes. These 1918 addresses are dedicated addresses, which means that the internet router will not send these addresses. The address range includes:

• 10.0.0.0-10.20.255.255

• 172.16.0.0-172.31.255.255

• 192.168.0.0-192.168.255.255

These IP addresses can be assigned to many local computers. However, before these computers access the Internet, these addresses must be translated into addresses that can be globally routed. This work is usually done by Network Address Translation (NAT. 1918 the address is not the only reserved address space. However, these addresses are defined as "local sites ". Multicast also has a reserved address range. This address range is not connected to the Internet: 224.0.0.0 to 224.0.0.255 is the address of the multicast "Local Connection.

To provide the necessary background knowledge for the next article in this lecture, we need to confirm that everyone understands the concept of a local subnet. Once we assign a valid address to a computer, this computer can talk to the local network if the subnet mask is set correctly. The subnet mask tells the operating system which IP address is located on the local subnet and which IP address is not located on the local subnet. The IP address we want to talk to is located in the local subnet, so the operating system can directly talk to it without using a router. In other words, the operating system can use the ARP Protocol to obtain the physical address of the target system and start a conversation. The IP address and subnet mask settings are very simple for a common 24-bit network. The standard 255.255.255.0 subnet mask indicates that the first three eight bytes are the network address, and the last part is reserved for the host. For example, a computer is assigned an IP address of 10.0.0.1 and a subnet mask of 255.255.255.0 (if you write in binary format, it is 24 bits ), this computer can talk to anyone from 10.0.0.1 to 10.0.0.255.

Make sure to digest all the content here, because next we will introduce how to set subnets using CIDR (classless Inter-Domain Routing.

Summary

• The IP address is only a 32-bit number. The subnet mask is just a "lid" that can slide up or down the IP address byte to create a larger or smaller network.

• The Network part of an IP address tells the host about its local subnet, and the local subnet then tells the host who it can directly talk.

• One-Way broadcast data packets are sent to one computer, and broadcast data packets are sent to many computers.(

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.