Have ideal, have ambition, know how to insist and self-discipline, believe in the near future, you will succeed!

Open wechat search [children go to school] pay attention to this is not the same programmer

  • 👉1.1 Overview of IP Addresses
  • 👉1.2 Methods for Viewing IP Addresses
  • 👉1.3 the IP address
  • 👉1.4 IP address format
  • 👉2.1 Description of IP Addresses
  • 👉3.1 Standard Subnet Mask
  • 👉3.2 Subnets
  • 👉4.1 the Ping command
  • 👉4.2 Mutual Communication
  • 👉4.3 How Can I Ensure that two IP Addresses Reside on the Same Network Segment?
  • 👉5.1 Creation Process

First, the IP address

1.1 Overview of IP Addresses

For a host connected to a network using TCP/IP, to successfully communicate with other devices on the network, TCP/IP needs to know three things: IP address, subnet mask, and default gateway.

1.2 Methods for Viewing IP Addresses

On the desktop, go to Network –> Properties and click on it to see what it looks like:

👉
BKFkbF.png
👉
BKFEE4.png
👉
BKFiuT.png

Generally speaking, we are currently using dynamic IP addresses, so there are no IP addresses to see here. Dynamic IP addresses are used to save resources. Generally, each COMPUTER is assigned a new IP address when it goes online. When the device goes offline, the IP address is assigned to other devices to prevent the offline device from occupying the IP address.

Alternatively, access the terminal and enter ipconfig -a to view the IP address of the current device

👉
BKkCid.png

1.3 the IP address

An IP address is used to distinguish a device from other devices on the network.

1.4 IP address format

10101100.00010000.00000100.00000010

To make the IP address easier to read, it is common to convert the binary to decimal, for example, the above binary to decimal.

172.16.4.2

An IP address has 4 bytes, a total of 32 bits, that is to say, a byte has 8 bits, between groups with. Separated.

binary 2 ^ ^ 7 2 ^ ^ 6 2 ^ ^ 5 2 ^ ^ 4 2 ^ 3 ^ 2 ^ ^ 2 2 ^ ^ 1 2 ^ ^ 0
The decimal system 128 64 32 16 8 4 2 1
1 0 1 0 1 1 0 0
0 0 0 1 0 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 0

A couple of special IP addresses

1 1 1 1 1 1 1 1 2 ^ ^ 8-1
0 1 1 1 1 1 1 1 2 ^ ^ 7-1
0 0 1 1 1 1 1 1 2 ^ 6 ^ 1
0 1 0 0 0 0 0 0 2 ^ ^ 6
1 0 0 0 0 0 0 0 2 ^ ^ 7
1 0 1 1 1 1 1 1 2 to the seventh to the plus 2 to the sixth to the minus 1

IP address classification

An IP address consists of a network address and a host address.

According to the STRUCTURE of IP addresses, there are five types of IP addresses: A, B, C, D, and E.

According to the specification, A, B, and C are assigned to the host for use, while C and D are reserved for special use. That is to say, only A, B, and C IP addresses are available.

IP addresses are classified according to the value of the first byte of the IP address.

👉
Bl0EpF.png
First byte range
Class A 0 ~ 127
Class B 128 ~ 191
Class C 192 ~ 223
Class D 224 ~ 239
Class E 240 ~ 255

2.1 Description of IP Addresses

  • If all host ids in the IP address are 0, it indicates the local network address.

For example, 192.168.1.1, which is a class C IP address, and whose host bits are all 0; 192.168.1.0—– Local network address, that is, network segment.

  • If the host IDS in the IP address are all 1, it indicates that the broadcast IP address is used. This special IP address cannot be assigned to users.

For example, 192.168.1.1, which is a class C IP address, and whose host bits are all 1, 192.168.1.11111111 (binary),

To decimal: 192.168.1.255 (decimal) —– Broadcast address.

Here, I believe that we all understand what is called network segment and broadcast address.

3. Subnet mask

  • An IP address consists of a network address and a host address.
  • The function of the subnet mask is as follows: To distinguish the network bit from the host bit
  • The subnet mask corresponds to the IP address. The subnet mask 1 indicates the network bit, and the subnet mask 0 indicates the host bit.

For example, IP address ==192.168.1==.1

= = 11000000.10101000.00000001. = =. 00000001

Subnet mask: 11111111.11111111.11111111.00000000

Decimal: 255.255.255.0

3.1 Standard Subnet Mask

Definition: the mask of an unsubnetted network;

For example, the subnet mask of class B network 163.40.219.7 is

11111111.11111111.00000000.00000000

In decimal notation: 2555.255.0.0

Standard subnet mask

Class A 255.0.0.0
Class B 255.255.0.0
Class C 255.255.255.0

3.2 Subnets

For example, the IP address is 10.6.24.20 and the subnet mask is 255.255.240.0

👉
B1VSJO.png

Therefore, the subnet number is 10.6.16.0

Verify the subnet mask

4.1 the Ping command

The ping command is used to check whether the network is smooth. The principle is that all the machines on the network have unique IP addresses. If we send a data packet to the destination IP address, the destination will return a data packet of the same size.

4.2 Mutual Communication

If the IP addresses of the hosts connected to the same switch are on the same network segment, they can communicate with each other and ping through each other.

4.3 How Can I Ensure that two IP Addresses Reside on the Same Network Segment?

Pc1:192.168.1.1

​ 255.255.255.0

Pc2:192.168.2.1

​ 255.255.255.0

Convert the different bits of the two IP addresses into binary bits and compare them one by one to make the network bits equal

Pc1:192.168.00000001.00000001

Pc2:192.168.00000010.00000001

Mask: 255.255.11111100.00000000

Namely: 255.255.252.0

5. IP address subnets

For example: some company has 3 departments, headquarters, office and branch, 3 departments node number differ not big, if you are the network administrator of this company, this company applied for a C class network only, how should you divide?

Analysis of the

Class C address 218.75.16.0/24 Can accommodate 254 hosts

5.1 Creation Process

Subnet: Borrow one digit

= = 218.75.16. = = 00000000/24

= = 218.75.16.0 = = 0000000/25

After borrowing one digit, you can divide two subnets

First subnet: 218.75.16.00000000/25

Network number: 218.75.16.00000000

The first IP address is 218.75.16.00000001

Last IP address: 218.75.16.01111110

Broadcast address: 218.75.16.01111111

Second subnet: 218.75.16.10000000/25

Network number: 218.75.16.10000000

The first IP address is 218.75.16.10000001

Last IP address: 218.75.16.11111110

Broadcast address: 218.75.16.11111111

The subnet masks of the two subnets are 255.255.255.10000000 == 255.255.255.128

Through the above analysis, we should be able to understand that one can only be divided into two subnets, so two can be divided into four subnets. If you understand the two subnets, I believe it is not difficult to divide four subnets for you!!

If you don’t understand anything about this article, you can put it in the comments section, or you can send me a message!

The last

This share ends here, these are the content learned before, in the IP address is relatively basic, now I put these basic knowledge out and share with you, I hope my knowledge to share, can be helpful to you.

The more you know, the more you don’t know. See you next time for more exciting content!