The relationship between subnet mask and IP address: 1. Subnet mask is used to determine whether the IP addresses of two computers belong to the same subnet. That is, subnet mask and IP address can Determine the relationship between unique addresses; 2. Perform binary conversion on the subnet mask and IP address and perform the AND algorithm, which is the only external address; 3. The subnet mask can be used to distinguish the network address and the host address.
The operating environment of this tutorial: Windows 10 system, DELL G3 computer.
What is the relationship between subnet mask and ip address
IP address
IP is 32 bits Binary data, usually expressed in dotted decimal notation. An IP address is a logical address that is used to identify each host in the network. IP is unique, that is, the IP of each machine is unique in the world.
To achieve network communication between computers, they must have a legal IP address. IP address = network address, host address, (also known as: host number and network number) The structure of the IP address allows us to conveniently address on the Internet. The IP address is usually represented more intuitively by four decimal numbers separated by dots. Each number ranges from 0 to 255. For example, the IP address of a certain host is: 128.20.4.1 In a local area network, an IP address is also required. , Generally, the IP address of the internal network starts with 192.168, so it is easy to distinguish the IP addresses of the public network and the internal network.
Subnet mask
The subnet mask is used to determine whether the IP addresses of any two computers belong to the same subnet. . The simplest understanding is that after the AND operation of the respective IP addresses and subnet masks of the two computers, the results are the same, which means that the two computers are on the same subnet and can communicate directly.
Relationship
The two are combined to determine the relationship of the unique address.
Convert the two to binary and perform the AND algorithm, which is your unique external address. For example, in a LAN, after performing the AND algorithm on the IP and mask of each host, the address all the same. This is your only external address.
Subnet address includes network address, host address and broadcast address.
The subnet mask is used to distinguish the network address and the host address.
For example, the subnet is 192.168.1.0, and the subnet mask is 255.255.255.0. Network address: 192.168.1.0, this address is used in the router’s routing table.
Host address: 192.168.1.1 to 192.168.1.254, used to identify different hosts; broadcast address: 192.168.1.255, used to send messages to all host devices in the network segment.
Mask: 255 is expressed in binary as 8 1s, 11111111, 3 255 is expressed in binary as 24 1s, corresponding to the network address part of the IP address: 192.168.1, this part is for all on this network The hosts in the segment are all the same, and the last 0 of the mask corresponds to the 8 binary 0s. This part is different for different hosts, and corresponds to 1~254 in this network segment.
IP address and mask use binary AND operation to obtain the network part and host part of the IP address.
For more related knowledge, please visit the FAQ column!
The above is the detailed content of What is the relationship between subnet mask and ip address?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.