Subnet Masking

 





Subnet masking is a technique used in computer networking to divide an IP address into two parts: network address and host address. It's essentially a way to define which portion of an IP address belongs to the network and which portion belongs to the individual devices (hosts) on that network.

 

Let's break it down with an example:

 

Suppose you have an IP address: 192.168.1.0. This is an IPv4 address, which is divided into four octets (each part separated by a dot), where each octet can have a value from 0 to 255.

 

Now, let's say you want to create subnets for your network. You decide to use a subnet mask of 255.255.255.0.

 

In binary, the subnet mask 255.255.255.0 translates to:

 

11111111.11111111.11111111.00000000

 

Here's how subnet masking works:

 

- Each "1" in the subnet mask represents a bit that belongs to the network portion of the IP address.

- Each "0" represents a bit that belongs to the host portion.

 

So, in this subnet mask:

- The first three octets (24 bits) are dedicated to the network.

- The last octet (8 bits) is reserved for addressing hosts on the network.

 

Let's apply this subnet mask to our example IP address, 192.168.1.0:

 

IP Address:    11000000.10101000.00000001.00000000

Subnet Mask: 11111111.11111111.11111111.00000000

 

Network Address: 11000000.10101000.00000001.00000000

 

In this case, the network address portion is 192.168.1, and the host portion is 0.

 

So, in this example:

- The network address is 192.168.1.0

- The host range would be from 192.168.1.1 to 192.168.1.254 (excluding the network address and the broadcast address).

 

Using subnet masking, you can effectively organize and manage your network by creating multiple subnets, each with its own unique range of IP addresses. This helps in improving network performance, security, and efficiency.

 

 

A subnet mask is a tool used in computer networking to divide a large network into smaller, more manageable sections called subnets. It's like having different neighborhoods within a city, all connected to the same overall infrastructure but with their own local organization.

Here's how it works:

·        IP address: Every device on a network has a unique IP address, which acts like its identification code. An IP address is a 32-bit number, typically written in four parts separated by dots, like this: 192.168.1.100.

·        Subnet mask: This is also a 32-bit number, but it works differently. It figuratively "masks" certain bits of the IP address to differentiate between the network part and the host (device) part of the address. The subnet mask uses ones (1s) to identify the network portion and zeros (0s) for the host portion.

·        Example: Let's say you have a network with the IP address 192.168.1.100 and a subnet mask of 255.255.255.0. Here's how the subnet mask helps identify the network and host parts:

o   Subnet mask (255.255.255.0): In binary format, this translates to 11111111.11111111.11111111.00000000. The ones (1s) in the first three sections indicate the network address bits.

o   IP address (192.168.1.100): Converted to binary, it's 11000000.10101000.00000001.01100100. Aligning the IP address with the subnet mask, the first three sections (network part) match the ones (1s) in the subnet mask.

·        Result: By comparing the IP address and subnet mask, we can see that 192.168.1 is the network address (all devices on that network share this part), and the remaining 100 identifies the specific host (device) within the network.

Subnet masks allow for efficient network management by creating subnets with a controlled number of devices. This reduces congestion, improves security, and makes troubleshooting easier. There's also a more concise way to represent subnet masks called CIDR notation (Classless Inter-Domain Routing), but that's a topic for another day.

 

 

A subnet mask is a fundamental concept in networking that plays a crucial role in dividing IP addresses into distinct parts. Let’s explore the details:

  1. Purpose of Subnet Mask:
    • A subnet mask is a 32-bit number that masks an IP address, effectively dividing it into two components:
      • Network Address: The part of the IP address that identifies the network.
      • Host Address: The part that identifies a specific device (host) within that network.
    • By using subnet masks, we can create logical groups of hosts within a network, which enhances security and performance.
  2. Binary Representation:
    • A subnet mask consists of four bytes (32 bits), often expressed in dotted-decimal notation.
    • For example, consider the subnet mask: 11111111 11111111 11111111 00000000
      • In more readable form: 255.255.255.0
    • Each byte represents eight bits, with values corresponding to powers of two (e.g., 2^7, 2^6, …, 2^0).
  3. Valid Subnet Masks:
    • A valid subnet mask must meet specific criteria:
      • The leftmost bits must be set to 1 (indicating the extended network portion).
      • The rightmost bits must be set to 0 (representing the host portion).
    • Example of a valid subnet mask: 11111111 11111111 11111111 00000000
  4. Applying Subnet Masks:
    • Subnet masks are always used in conjunction with IP addresses.
    • When applied to an IP address, the subnet mask splits it into:
      • Extended Network Address: Combining the network address and subnet number.
      • Host Address: Identifying the specific host within that subnet.
  5. Real-World Example:
    • Imagine a small business using the 192.168.1.0 network for its internal hosts.
    • The human resources department wants a restricted part of this network for sensitive data.
    • By applying subnetting, we can achieve this segmentation effectively.

In summary, subnet masks allow us to organize network traffic, improve security, and optimize performance by dividing IP addresses into meaningful parts. 😊

For more in-depth information, you can refer to the following sources:

 




Example:

ip: 

192.168.10.0/27   

                                                                                                                                        

  find out

a. block size

b.number of subnet

c. number of valid host 

d.valid subnet id   

e. first valid host    

f.broad cast id  

 

solution:

To find out the details you've asked for, let's break down each step:

 

Given IP: 192.168.10.0/27

 

a. Block Size:

To find the block size, we look at the subnet mask. In this case, the subnet mask is /27, which means the subnet mask is 255.255.255.224. The last octet (8 bits) of the subnet mask is 11100000 in binary, which equals 224 in decimal.

 

The block size can be calculated as 2^(32 - subnet mask). So, 32 - 27 = 5, and 2^5 = 32.

 

So, the block size is 32.

 

b. Number of Subnets:

The number of subnets is calculated using the formula 2^(new bits). In this case, the subnet mask has 27 bits (32 - 27 = 5 bits were borrowed for subnetting).

 

So, the number of subnets is 2^5 = 32 subnets.

 

c. Number of Valid Hosts:

To find the number of valid hosts per subnet, we need to subtract 2 from the block size. This is because the first address in the subnet is the network address, and the last address is the broadcast address, leaving the rest for hosts.

 

So, the number of valid hosts per subnet is 32 - 2 = 30 hosts.

 

d. Valid Subnet IDs:

The valid subnet IDs are multiples of the block size starting from 0.

 

So, the valid subnet IDs are:

0

32

64

...

and so on.

 

e. First Valid Host:

The first valid host in each subnet is the subnet ID plus one.

 

So, for the first subnet, the first valid host would be 192.168.10.1.

For the second subnet, it would be 192.168.10.33.

And so on.

 

f. Broadcast ID:

The broadcast ID is the last address in the subnet.

 

So, for the first subnet, the broadcast ID would be 192.168.10.31.

For the second subnet, it would be 192.168.10.63.

And so on.

 

These steps allow us to break down and understand the subnetting of the given IP address effectively.


here's a table showing the subnet ID, first valid host, last valid host, and broadcast ID for each subnet from 0 to 224:

 

 

Each row corresponds to a subnet within the range of 0 to 224, with the Subnet ID representing the network address, First Valid Host being the first usable IP address within the subnet, Last Valid Host being the last usable IP address, and Broadcast ID being the broadcast address for that subnet.






Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.