Btechwala

Chapter 1: Introduction to Computer Networks Definition of a Computer Network Importance and Applications of Networks Evolution of Networks Types of Networks (LAN, WAN, MAN, PAN) Networking Devices (Switches, Routers, Hubs) Chapter 2: Types of Networks Local Area Network (LAN) Wide Area Network (WAN) Metropolitan Area Network (MAN) Personal Area Network (PAN) Virtual Private Network (VPN) Chapter 3: Network Models OSI Model TCP/IP Model Comparison of OSI and TCP/IP Models Chapter 4: Network Topologies Introduction to Network Topologies Types of Topologies Bus Topology Star Topology Ring Topology Mesh Topology Hybrid Topology Chapter 5: IP Addressing and Subnetting What is an IP Address? IPv4 vs. IPv6 Subnetting: Basics and Importance CIDR (Classless Inter-Domain Routing) Public and Private IP Addresses Chapter 6: Network Protocols What are Protocols? TCP (Transmission Control Protocol) IP (Internet Protocol) UDP (User Datagram Protocol) FTP (File Transfer Protocol) HTTP/HTTPS (HyperText Transfer Protocol/Secure) DHCP (Dynamic Host Configuration Protocol) DNS (Domain Name System) Chapter 7: Data Transmission Techniques Analog vs Digital Data Asynchronous and Synchronous Transmission Multiplexing Frequency Division Multiplexing (FDM) Time Division Multiplexing (TDM) Error Detection and Correction Methods Chapter 8: Network Devices Network Interface Cards (NIC) Repeaters, Hubs, Switches, Bridges Routers and Gateways Modems Firewalls and Their Importance in Security Chapter 9: Wireless Networks Introduction to Wireless Communication Types of Wireless Networks Wi-Fi (Wireless Fidelity) Bluetooth Mobile Networks (3G, 4G, 5G) Satellite Communication Wireless Network Security Chapter 10: Network Security Importance of Network Security Types of Attacks Phishing Denial of Service (DoS) Man-in-the-Middle Attacks Malware (Viruses, Trojans, Ransomware) Security Protocols and Techniques SSL/TLS Firewalls Intrusion Detection and Prevention Systems (IDS/IPS) VPN and Encryption Chapter 11: Network Management and Monitoring Simple Network Management Protocol (SNMP) Remote Network Monitoring Tools for Network Monitoring (Wireshark, Nagios, etc.) Network Performance Metrics (Latency, Throughput, Bandwidth) Chapter 12: Advanced Networking Concepts Virtualization and Cloud Networking Concepts of Virtual Machines Cloud Providers (AWS, Azure) Software-Defined Networking (SDN) Advantages of SDN in Modern Networking Internet of Things (IoT) and Networking Chapter 13: Emerging Trends in Networking 5G Networks Quantum Networking Blockchain in Networking Network Automation and AI-driven Networks
hybrid topologies

What is Subnetting in Computer Network ?

In networking, subnetting refers to the process of dividing a larger network into smaller, more manageable subnetworks or subnets. This practice allows network administrators to improve network performance and security, as well as to efficiently allocate IP addresses. Subnetting is a fundamental aspect of IP networking and is essential for optimizing the use of IP addresses.

Basics of IP Addressing

Before diving into subnetting, it’s essential to understand IP addressing. An IP address (Internet Protocol address) is a unique identifier assigned to each device on a network. IP addresses are typically written in two formats:

  1. IPv4 (Internet Protocol version 4): This format uses 32-bit addresses and is expressed in dotted decimal notation, such as 192.168.1.1. IPv4 addresses are divided into four octets, each consisting of 8 bits.

  2. IPv6 (Internet Protocol version 6): This format uses 128-bit addresses and is expressed in hexadecimal notation, such as 2001:0db8:85a3:0000:0000:8a2e:0370:7334. IPv6 addresses provide a vastly larger address space compared to IPv4.

Understanding Network Classes

IPv4 addresses are divided into classes, each serving different purposes:

  • Class A: Ranges from 1.0.0.0 to 126.0.0.0 with a default subnet mask of 255.0.0.0. Class A addresses are used for very large networks.
  • Class B: Ranges from 128.0.0.0 to 191.255.0.0 with a default subnet mask of 255.255.0.0. Class B addresses are used for medium-sized networks.
  • Class C: Ranges from 192.0.0.0 to 223.255.255.0 with a default subnet mask of 255.255.255.0. Class C addresses are used for small networks.
  • Class D: Ranges from 224.0.0.0 to 239.255.255.255. This class is used for multicast addresses.
  • Class E: Ranges from 240.0.0.0 to 255.255.255.255. This class is reserved for experimental purposes.

The Need for Subnetting

Subnetting becomes necessary due to several limitations of traditional IP addressing:

  1. Address Exhaustion: As the number of devices connected to the internet and networks has increased, the pool of available IPv4 addresses has dwindled. Subnetting helps in efficiently managing the available IP address space.

  2. Network Management: Large networks can become difficult to manage. Subnetting allows the division of a large network into smaller, more manageable segments, improving overall network organization and performance.

  3. Security: Subnetting can enhance security by isolating different network segments, reducing the risk of unauthorized access and limiting the spread of network issues.

  4. Broadcast Traffic: By dividing a network into smaller subnets, broadcast traffic is confined to individual subnets, reducing the amount of broadcast traffic on the entire network and improving performance.

Subnet Masking

A subnet mask is a 32-bit number that separates the IP address into network and host portions. It defines which part of the IP address identifies the network and which part identifies the individual device (host). For example, a subnet mask of 255.255.255.0 in binary is 11111111.11111111.11111111.00000000.

In subnetting, the subnet mask helps determine the boundary between the network and host portions of an IP address. By changing the subnet mask, you can create multiple subnets within a single network.

How Subnetting Works

  1. Determine the Number of Required Subnets: The first step in subnetting is to identify how many subnets are needed. This is based on the network requirements.

  2. Calculate the Subnet Mask: The next step is to calculate the new subnet mask. This involves borrowing bits from the host portion of the IP address to create additional subnet bits.

  3. Determine Subnet Ranges: With the new subnet mask, calculate the range of IP addresses for each subnet. This involves determining the network address, the broadcast address, and the usable IP addresses within each subnet.

  4. Assign IP Addresses: Finally, assign IP addresses to devices within each subnet according to the calculated ranges.

Example of Subnetting

Let’s walk through a simple example to illustrate subnetting:

Scenario

Suppose you have been assigned the IP address 192.168.1.0/24 (a Class C network) and need to create 4 subnets.

Steps

  1. Determine the Number of Subnets: To create 4 subnets, you need to borrow 2 bits from the host portion (since 2^2 = 4).

  2. Calculate the New Subnet Mask: The default subnet mask for a Class C network is 255.255.255.0 or /24. Borrowing 2 bits for subnetting changes the subnet mask to /26 or 255.255.255.192.

  3. Determine Subnet Ranges: With a /26 subnet mask, each subnet has 64 IP addresses (2^6 = 64), but only 62 are usable (subtracting the network and broadcast addresses).

    • Subnet 1: 192.168.1.0/26

      • Network Address: 192.168.1.0
      • Broadcast Address: 192.168.1.63
      • Usable IP Range: 192.168.1.1 to 192.168.1.62
    • Subnet 2: 192.168.1.64/26

      • Network Address: 192.168.1.64
      • Broadcast Address: 192.168.1.127
      • Usable IP Range: 192.168.1.65 to 192.168.1.126
    • Subnet 3: 192.168.1.128/26

      • Network Address: 192.168.1.128
      • Broadcast Address: 192.168.1.191
      • Usable IP Range: 192.168.1.129 to 192.168.1.190
    • Subnet 4: 192.168.1.192/26

      • Network Address: 192.168.1.192
      • Broadcast Address: 192.168.1.255
      • Usable IP Range: 192.168.1.193 to 192.168.1.254
  4. Assign IP Addresses: Assign IP addresses to devices within each subnet according to the usable IP range.

Advanced Subnetting

For more complex subnetting, such as creating more subnets or handling larger address spaces, you may use Variable Length Subnet Masking (VLSM) or Classless Inter-Domain Routing (CIDR).

  • VLSM: Allows for subnets of different sizes within the same network. This is useful for optimizing IP address allocation based on specific requirements.

  • CIDR: A method that allows for more flexible subnetting by using a prefix length to denote the subnet mask. CIDR notation is expressed as a slash followed by the number of network bits (e.g., /22).

Conclusion

Subnetting is a fundamental concept in networking that enables the efficient use of IP address space and improves network management. By dividing a larger network into smaller subnets, administrators can enhance network performance, security, and address allocation. Understanding and applying subnetting principles, including subnet masks, network classes, and advanced techniques like VLSM and CIDR, is essential for effective network design and operation.

As networks continue to evolve and grow, mastering subnetting will remain a crucial skill for network professionals and administrators.

About the Author

I’m Sunil Sharma, the mind behind Btechwala, your go-to resource for all things educational. With a passion for learning and a mission to share knowledge, Btechwala was created to provide insightful, well-researched, and practical articles that cater to students, professionals, and lifelong learners.

Continue reading