- The IP address identifies a device on a network, and can be public or private.
- The direction MAC It is unique to each device and serves for its physical identification.
- The network mask determines which part of the IP belongs to the network and which part to the device.
- Dividing networks using subnets optimizes traffic and improves security.
Surely you have heard more than once about the IP address, the MAC address or the network mask, especially when talking about the Internet, Wi-Fi networks or even when configuring a routerAlthough these terms sound complicated, they're actually more familiar than they seem, and once you understand how they work, they can help you better understand how your devices connect to the network.
In this article we explain clearly and completely what role each of these elements plays within a network, how they interrelate and why they are essential for any device, be it your mobile, your Smart TV or your computer, can access the Internet or communicate with other devices on the same local network. To delve deeper into the topic, you can read about the network detection in windows 10.
What is an IP address?
La IP (Internet Protocol) address It is the unique identifier that allows each device to connect and communicate within a network. It acts as a license plate. There are two main types:
- public IP: It is the one assigned to you by your Internet provider and the one displayed when you connect to web pages.
- Private IP: It is the one assigned within your local network, for example, between your router and the connected devices at home.
All IP addresses are made up of 4 numerical blocks separated by periods., and each block can range from 0 to 255. For example: 192.168.1.1. These addresses can be assigned manually (fixed or static IP), or dynamically using a DHCP server. It is also important to understand how devices relate to each other on networks, which you can learn in How to avoid automatic connections on Wi-Fi networks.
What is a MAC address?
La MAC (Media Access Control) address It is a unique physical identifier that each device's network card incorporates, whether it's Ethernet or Wi-Fi. While the IP address can change or depend on the network you're connected to, The MAC is always the same, since it comes from the factory with the device.
Is composed of 12 hexadecimal characters grouped in six pairs, such as 00:1E:C2:9E:28:6B. The first three indicate the device manufacturer, and the remaining three identify the model or serial number. This makes network management easier, as detailed in applications to manage social networks.
What is the network mask or subnet mask?
La net mask o subnet mask It indicates which part of the IP address identifies the network and which part identifies the device (host). It acts like a magnifying glass, allowing us to separate IP addresses into two halves: the network portion and the host portion.
For example, in an IP of type 192.168.123.132 and a mask 255.255.255.0:
- 192.168.123 It is the fixed part: the network.
- 132 It is the variable part: the device within that network.
This differentiation is essential for an operating system or router to know if another device is within the same local network or if it must send the information to the outsideTo make this management easier, it is useful to calculate the subnets, something you can do with online tools, such as those explained in subnet calculators.
How are IP, MAC and Netmask related?
These three elements work together to ensure connectivity within a network. The IP address logically identifies the device, the mask defines its network, and the MAC address physically identifies it..
When a device wants to send data, it first uses the IP address to locate the destination. It then analyzes, using the network mask, whether that destination is on the same network. If it is, the MAC address is used to communicate directly. If it isn't, the traffic is redirected through the router or gateway to the Internet or an external network. This saves unnecessary traffic and optimizes performance. You can learn more about networks in general in our article on the history of social media before Facebook.
Types of IP addresses: classes and ranges
IP addresses are classified into different categories: classes according to their size and use. The most commons are:
Class A
- Range of the first octet: of 0 to 127
- Default mask: 255.0.0.0
- Use: large companies, allows millions of devices per network
Class B
- Range of the first octet: of 128 to 191
- Default mask: 255.255.0.0
- Use: medium-sized networks (hospitals, universities)
C class
- Range of the first octet: of 192 to 223
- Default mask: 255.255.255.0
- Use: small networks, such as homes or offices
Variable Length Masks (VLSM)
The technique of Variable-length subnets (VLSM) allows the use of more flexible masks. With VLSM we can divide a large network into several smaller ones, adapting them to the number of devices needed.
For example, instead of using a mask of 255.255.255.0 for your entire network, you can have one subnet with a mask of 255.255.255.128 (for 126 hosts) and another with a mask of 255.255.255.192 (for 62 hosts), depending on your needs.
This has several advantages:
- Optimizes the use of available IP addresses.
- Minimize traffic between segments.
- Facilitates network control and management.
How do I find out my IP address and subnet mask?
The way to find this information depends on the device you're using. Below, we summarize it for the most common systems:
Windows
- press Win + R, type “cmd” and press Enter.
- In symbol of the system, writes ipconfig / all.
- You will see information about your network, including IP address, subnet mask and more.
MacOS
- Go to System Preferences → Network.
- Select your connection (Wi-Fi or Ethernet), press Advanced.
- In the TCP / IP you will find the data.
iOS
- Go to Settings → Wi-Fi.
- Tap the “i” icon next to your network.
- Displays the IP address and subnet mask.
Android
- Go to Settings → WiFi.
- Select your current network and enter advanced settings.
- There you will find your IP and mask.
What is a subnet mask used for?
The main function of a mask is determine if a device is on the same network as another. But it also has other key uses:
- Optimize traffic: prevents data from leaving to external networks if the destination is on the same network.
- Improve security: allows you to segment networks and isolate departments, teams or devices.
- Allows you to create subnets: ideal for dividing a large network into smaller, more manageable networks.
Practical example: network division with masks
Let's say you have a Class C network with an IP address of 192.168.1.0 and a mask of 255.255.255.0. This allows you to have up to 254 devices.
If you need to split it into two subnets, you can change it to a 2 (/255.255.255.128) mask. You'll then have:
- Subnet 1: of 192.168.1.0 to 192.168.1.127
- Subnet 2: of 192.168.1.128 to 192.168.1.255
Each subnet will have 126 hosts available, since one IP is reserved for the network and another for broadcast.
Subnet Calculators
If you don't want to do the calculations by hand, you can use one of the many online subnet calculatorsThese tools tell you how many hosts you can have per subnet based on the mask, available IP range, broadcast address, etc.
Understanding how IP addresses, MAC addresses, and network masks relate to each other is key if you want to understand how the internet works behind the scenes. These concepts allow devices to communicate with each other and seamlessly access the content we search for every day. Being aware of how networks are organized is also essential to keeping your connection secure, fast, and optimized.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.