CCNA Class 06: Concept of the IPv4 Address Subnetting

Subnetting is a process used in networking to divide a large network into smaller, more manageable subnetworks (subnets). It helps improve network organization, security, and performance by allowing for efficient IP address allocation and reducing congestion within the network. Here’s a breakdown of the key concepts and details involved in subnetting.

  1. IP Addressing Basics

    1. IP Address: An IP (Internet Protocol) address is a unique identifier assigned to each device on a network. It consists of four octets, such as 192.168.1.1

    2. IPv4 and IPv6: The most common IP version is IPv4, which uses 32-bit addresses (e.g., 192.168.1.1). IPv6 uses 128-bit addresses and is structured differently due to the larger address space.


  1. Binary and Decimal Representation

    1. IP addresses are often written in dotted-decimal form for readability (e.g., 192.168.1.1), but they are ultimately 32-bit binary numbers for processing by computers.

    2. Each octet in an IP address represents 8 bits, so 192.168.1.1 translates to binary as 11000000.10101000.00000001.00000001.


  1. Network Classes and Default Subnet Masks

In IPv4, IP addresses are divided into different classes. Each class has a default subnet mask, which defines the network and host portions of the address.

Class A: 1.0.0.0 to 126.0.0.0, default subnet mask 255.0.0.0

Class B: 128.0.0.0 to 191.255.0.0, default subnet mask 255.255.0.0

Class C: 192.0.0.0 to 223.255.255.0, default subnet mask 255.255.255.0



  1. Subnet Mask

A subnet mask is a 32-bit number that identifies the network portion of an IP address. Subnet masks are usually written in dotted-decimal format, like IP addresses (e.g., 255.255.255.0).

In binary, the subnet mask has a series of 1s followed by 0s, where the 1s identify the network portion, and the 0s identify the host portion.

Example: 255.255.255.0 is 11111111.11111111.11111111.00000000 in binary.

  1. CIDR Notation (Classless Inter-Domain Routing)

CIDR notation is a shorthand way to write IP addresses with subnet masks. For example, 192.168.1.0/24 specifies that the first 24 bits are the network portion, leaving 8 bits for hosts. /24 notation is equivalent to a 255.255.255.0 subnet mask.

CIDR allows more flexible subnetting, enabling the creation of subnets of various sizes, not limited by class boundaries.

  1. Subnetting Process

Subnetting involves borrowing bits from the host portion of an IP address to create additional subnets. The more bits borrowed, the more subnets you create but with fewer hosts per subnet.

Step 1: Determine the number of subnets needed and calculate the number of bits required to represent them.

Step 2: Calculate the new subnet mask by adding the borrowed bits to the network bits.

Step 3: Calculate the number of hosts per subnet using the remaining host bits. For example, if you start with a Class C address (192.168.1.0/24) and want 4 subnets, you would borrow 2 bits, creating 4 subnets with a new subnet mask of /26 (or 255.255.255.192).

Subnetting Example

Suppose you have an IP address 192.168.1.0 with a default subnet mask of 255.255.255.192, and you want to divide it into 4 subnets:

Step 1: Borrow 2 bits (2^2 = 4 Max Subnets).

Step 2: New subnet mask = /26, or 255.255.255.192

Step 3: Each subnet can support 2^6 - 2 = 62 hosts (since 6 bits remain for hosts, and 2 addresses are reserved).


Calculation of the Binary to Decimal Conversion using Positional Notation

Example 01: (10011011)2 = (155)10

Step 01: 

Counting Bits(n)

7

6

5

4

3

2

1

0

Binary

1

0

0

1

1

0

1

1

Formula (2n)

27

26

25

24

23

22

21

20

Decimal

128

64

32

16

8

4

2

1


Step 02:

Binary

1

0

0

1

1

0

1

1

Decimal

128

64

32

16

8

4

2

1


128

0

0

16

8

0

2

1


Step 03:

Binary

1

0

0

1

1

0

1

1

Decimal (155)10

128 + 0 + 0 + 16 + 8 + 0 + 2 + 1 = 155


IPv4 Address Subnetting Overview

Table 01: List the available CIDR Values for Class A Network

Subnet Mask

Prefix

Subnet Bits

Max Subnets

Host Bits

Max Hosts/Network

255.0.0.0

/8

0

1

24

16,777,214

255.128.0.0

/9

1

2

23

8,388,606

255.192.0.0

/10

2

4

22

4,194,302

255.224.0.0

/11

3

8

21

2,097,150

255.240.0.0

/12

4

16

20

1,048,574

255.248.0.0

/13

5

32

19

524,286

255.252.0.0

/14

6

64

18

262,142

255.254.0.0

/15

7

128

17

131,070

255.255.0.0

/16

8

256

16

65,534

255.255.128.0

/17

9

512

15

32,766

255.255.192.0

/18

10

1024

14

16,384

255.255.224.0

/19

11

2048

13

8,190

255.255.240.0

/20

12

4096

12

4,094

255.255.248.0

/21

13

8192

11

2,046

255.255.252.0

/22

14

16384

10

1,022

255.255.254.0

/23

15

32768

9

510

255.255.255.0

/24

16

65,536

8

254

255.255.255.128

/25

17

131,072

7

126

255.255.255.192

/26

18

262,144

6

62

255.255.255.224

/27

19

524,288

5

30

255.255.255.240

/28

20

1,048,576

4

14

255.255.255.248

/29

21

2,097,152

3

6

255.255.255.252

/30

22

4,194,304

2

2


Table 02: List the available CIDR Values for Class B Network

Subnet Mask

Prefix

Subnet Bits

Max Subnets

Host Bits

Max Hosts/Network

255.255.0.0

/16

0

1

16

65,534

255.255.128.0

/17

1

2

15

32,766

255.255.192.0

/18

2

4

14

16,382

255.255.224.0

/19

3

8

13

8,190

255.255.240.0

/20

4

16

12

4,094

255.255.248.0

/21

5

32

11

2,046

255.255.252.0

/22

6

64

10

1,022

255.255.254.0

/23

7

128

9

510

255.255.255.0

/24

8

256

8

254

255.255.255.128

/25

9

512

7

126

255.255.255.192

/26

10

1024

6

62

255.255.255.224

/27

11

2048

5

30

255.255.255.240

/28

12

4096

4

14

255.255.255.248

/29

13

8192

3

6

255.255.255.252

/30

14

16384

2

2



Table 03: List the available CIDR Values for Class C Network

Subnet Mask

Prefix

Subnet Bits

Max Subnets

Host Bits

Max Hosts/Network

255.255.255.0

/24

0

1

8

254

255.255.255.128

/25

1

2

7

126

255.255.255.192

/26

2

3

6

62

255.255.255.224

/27

3

8

5

30

255.255.255.240

/28

4

16

4

14

255.255.255.248

/29

5

32

3

6

255.255.255.252

/30

6

64

2

2


Practices:

1. Let's say, CIDR Prefix is  /27 for Class A IP Address. Find the Host Bits, Subnet Bits, and Subnet Mask. 

2. The Subnet Mask 255.255.254.0 for the Class B IP Address. Find the CIDR Prefix, Subnet Bits, and Host Bits.

Google Translate Integration

Comments