Network layer. IP Addressing Part 1.pptx

MujtabaVlogs 19 views 166 slides Sep 24, 2024
Slide 1
Slide 1 of 166
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118
Slide 119
119
Slide 120
120
Slide 121
121
Slide 122
122
Slide 123
123
Slide 124
124
Slide 125
125
Slide 126
126
Slide 127
127
Slide 128
128
Slide 129
129
Slide 130
130
Slide 131
131
Slide 132
132
Slide 133
133
Slide 134
134
Slide 135
135
Slide 136
136
Slide 137
137
Slide 138
138
Slide 139
139
Slide 140
140
Slide 141
141
Slide 142
142
Slide 143
143
Slide 144
144
Slide 145
145
Slide 146
146
Slide 147
147
Slide 148
148
Slide 149
149
Slide 150
150
Slide 151
151
Slide 152
152
Slide 153
153
Slide 154
154
Slide 155
155
Slide 156
156
Slide 157
157
Slide 158
158
Slide 159
159
Slide 160
160
Slide 161
161
Slide 162
162
Slide 163
163
Slide 164
164
Slide 165
165
Slide 166
166

About This Presentation

Computer Networks


Slide Content

Network layer: “data plane” roadmap Network layer: overview data plane control plane What ’s inside a router input ports, switching, output ports buffer management, scheduling IP: the Internet Protocol datagram format addressing network address translation IPv6 Generalized Forwarding, SDN match+action OpenFlow: match+action in action Middleboxes Network Layer: 4- 1

Network Layer: Internet host, router network layer functions: IP protocol datagram format addressing packet handling conventions ICMP protocol error reporting router “ signaling” transport layer: TCP, UDP link layer physical layer network layer forwarding table Path-selection algorithms: implemented in routing protocols (OSPF, BGP) SDN controller Network Layer: 4- 2

IP Datagram format ver length 32 bits payload data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live source IP address head. len type of service flgs fragment offset upper layer destination IP address options (if any) IP protocol version number header length(bytes) upper layer protocol (e.g., TCP or UDP) total datagram length (bytes) “type” of service: diffserv (0:5) ECN (6:7) fragmentation/ reassembly TTL: remaining max hops (decremented at each router) 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead for TCP+IP overhead e.g., timestamp, record route taken 32-bit source IP address 32-bit destination IP address header checksum Maximum length: 64K bytes Typically: 1500 bytes or less Network Layer: 4- 5

IP Header… Version: Specifies the IP protocol version (IPv4 or IPv6). Header Length: Indicates the size of the header (in 32-bit words). Type of Service ( ToS ): Defines quality of service parameters. Total Length: Indicates the entire packet size (header + data). Identification: Helps reassemble fragmented packets. Flags: Control fragmentation behavior (e.g., fragmentation and reassembly). Fragment Offset: Identifies a fragment's position in the original packet. Time-to-Live (TTL): Limits a packet's lifespan to prevent infinite loops. Protocol: Specifies the higher-layer protocol (TCP, UDP, ICMP, etc.). Header Checksum: Ensures header integrity during transmission. Source IP Address: Originating IP address. Destination IP Address: Recipient IP address.

IP Addressing

OBJECTIVES: To introduce the concept of an address space in general and the address space of IPv4 in particular. To discuss the classful architecture and the blocks of addresses available in each class. To discuss the idea of hierarchical addressing and how it has been implemented in classful addressing. To explain subnetting and super-netting. To discuss classless addressing, that has been devised to solve the problems in classful addressing. To discuss some special blocks and some special addresses in each block. To discuss NAT technology and show how it can be used to alleviate of address depletion.

Outline Introduction Classful Addressing Classless Addressing Special Addresses NAT

INTRODUCTION The identifier used in the IP/Network layer of the TCP/IP protocol suite to identify each device connected to the Internet is called the Internet address or IP address. An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a host or a router to the Internet; an IP address is the address of the interface.

An IPv4 address is 32 bits long. The IPv4 addresses are unique and universal.

Address Space An address space is the total number of addresses used by the protocol. If a protocol uses b bits to define an address, the address space is 2 b because each bit can have two different values (0 or 1). IPv4 uses 32-bits to make address space.

How many ? For IPv4, this pool is 32-bits (232) in size and contains 4,294,967,296 IPv4 addresses. The IPv6 address space is 128-bits (2128) in size, containing 340,282,366,920,938,463,463,374,607,431,768,211,456 IPv6 addresses

Notation There are three common notations to show an IPv4 address: binary notation (base 2) dotted-decimal notation (base 256)(0 to 255) hexadecimal notation (base 16)

Binary Notation: Base 2 an IPv4 address is displayed as 32 bits 01110101 10010101 00011101 11101010

Dotted-Decimal Notation: Base 256 To make the IPv4 address more compact and easier to read, an IPv4 address is usually written in decimal form with a decimal point (dot) separating the bytes

18. 17 Figure 18.16: Three different notations in IPv4 addressing

Change the following IP addresses from binary notation to dotted-decimal notation. a. 10000001 00001011 00001011 11101111 b . 11000001 10000011 00011011 11111111 c. 11100111 11011011 10001011 01101111 d. 11111001 10011011 11111011 00001111 Example 1

Change the following IP addresses from binary notation to dotted-decimal notation. a. 10000001 00001011 00001011 11101111 b . 11000001 10000011 00011011 11111111 c. 11100111 11011011 10001011 01101111 d. 11111001 10011011 11111011 00001111 Example 1

Change the following IP addresses from binary notation to dotted-decimal notation. a. 10000001 00001011 00001011 11101111 b . 11000001 10000011 00011011 11111111 c. 11100111 11011011 10001011 01101111 d. 11111001 10011011 11111011 00001111 Example 1 Solution We replace each group of 8 bits with its equivalent decimal number and add dots for separation: a. 129.11.11.239 b. 193.131.27.255 c. 231.219.139.111 d. 249.155.251.15

Change the following IP addresses from dotted-decimal notation to binary notation. a. 111.56.45.78 b. 221.34.7.82 c. 241.8.56.12 d. 75.45.34.78 Example 2

Change the following IP addresses from dotted-decimal notation to binary notation. a. 111.56.45.78 b. 221.34.7.82 c. 241.8.56.12 d. 75.45.34.78 Example 2 Solution We replace each decimal number with its binary equivalent: a. 01101111 00111000 00101101 01001110 b. 11011101 00100010 00000111 01010010 c. 11110001 00001000 00111000 00001100 d. 01001011 00101101 00100010 01001110

Change the following IP addresses from binary notation to hexadecimal notation. a. 10000001 00001011 00001011 11101111 b. 11000001 10000011 00011011 11111111 Example 3

Change the following IP addresses from binary notation to hexadecimal notation. a. 10000001 00001011 00001011 11101111 b. 11000001 10000011 00011011 11111111 Example 3 Solution We replace each group of 4 bits with its hexadecimal equivalent. Note that hexadecimal notation normally has no added spaces or dots; however, 0X (or 0x) is added at the beginning or the subscript 16 at the end to show that the number is in hexadecimal. a. 0X810B0BEF or 810B0BEF 16 b. 0XC1831BFF or C1831BFF 16

Types Of IP Address Static IP Address Static IP Address is an IP Address that once assigned to a network element always remains the same. They are configured manually. Dynamic IP Address   Dynamic IP Address is a temporarily assigned IP Address to a network element. It can be assigned to a different device if it is not in use.

Classification Of IP Addresses

CLASSFUL ADDRESSING IP addresses, when started a few decades ago, used the concept of classes. This architecture is called classful addressing. In the mid-1990s, a new architecture, called classless addressing, was introduced that supersedes the original architecture. In this section, we introduce classful addressing because it paves the way for understanding classless addressing and justifies the rationale for moving to the new architecture.

Classes The IP address space is divided into five classes: A, B, C, D, and E. Each class occupies some part of the whole address space.

Recognizing Classes To find the class of an address - in the binary notation, the first few bits ... in the dotted-decimal notation, the value of the first byte ...

Figure Finding the class of address XXX 239

Netid and Hostid IP address in classes A, B, and C is divided into Netid and Hostid . These parts are of varying lengths , depending on the class of the address.

Find the class of each address: a. 0000001 00001011 00001011 11101111 b. 110 00001 10000011 00011011 11111111 c. 10 100111 11011011 10001011 01101111 d. 1111 0011 10011011 11111011 00001111 Example 5

Find the class of each address: a. 0000001 00001011 00001011 11101111 b. 110 00001 10000011 00011011 11111111 c. 10 100111 11011011 10001011 01101111 d. 1111 0011 10011011 11111011 00001111 Example 5 Solution a. The first bit is 0. This is a class A address. b. The first 2 bits are 1; the third bit is 0. This is a class C address. c. The first bit is 0; the second bit is 1. This is a class B address. d. The first 4 bits are 1s. This is a class E address..

Find the class of each address: a. 227.12.14.87 b. 193.14.56.22 c. 14.23.120.8 d. 252.5.15.111 e. 134.11.78.56 Example 6

Find the class of each address: a. 227.12.14.87 b. 193.14.56.22 c. 14.23.120.8 d. 252.5.15.111 e. 134.11.78.56 Example 6 Solution a. The first byte is 227 (between 224 and 239); the class is D. b . The first byte is 193 (between 192 and 223); the class is C. c. The first byte is 14 (between 0 and 127); the class is A. d. The first byte is 252 (between 240 and 255); the class is E. e. The first byte is 134 (between 128 and 191); the class is B.

Classes and Blocks One problem with classful addressing Each class is divided into a fixed number of blocks with each block having a fixed size. Class A 00000000-01111111 [0 -127] Number of blocks ( Networks ) in class A is 2 7 = 128 blocks. Each block can be assigned to one organization . Each block contains 2 24 =16,777,216 addresses ( Hosts).

Figure Blocks in Class A

Subnet Mask A subnet mask is a 32-bit number (often represented in dotted decimal notation like an IP address) used to divide an IP address into network and host portions . It is made up of ones ( 1 network ) and zeroes ( ) and determines the size of the network by indicating which part of the IP address is the network portion and which part is the host portion.

Let's take an IPv4 address and its corresponding subnet mask: IPv4 Address: 100.168.1.100 Subnet Mask: 255 . . . In binary form: IPv4 Address: 01100100.10101000.00000001.01100100 Subnet Mask: 11111111. 00000000 . 00000000 . 00000000

Calculation So total number of addresses in Class A = No. of Blocks in Class A x No. of Hosts in each block of Class A = 128 x 16,777,216 = 2,147,483,648 This is 50% of the total addresses in IPv4. Calculation

Millions of class A addresses are wasted. Uses: Class A is used by organizations requiring very large size networks like Google, Bing, Yahoo etc

Class B Number of blocks in class B is 2 14 = 16,384. Each block can be assigned to one organizations. Each block contains 65,536 addresses.

Figure Blocks in Class B

Calculation Therefore total number of blocks in Class B = 2 14  = 16,384 There are 2 bytes (16 bits) for hostid in Class B so total number of host in each block = 2 16  = 65,536 So total number of addresses in Class B = No. of Blocks in Class B x No. of Hosts in each block of Class B = 16,384 x 65,536 = 1,073,741,824 This is 25% of the total addresses in IPv4. 

Many class B addresses are wasted. Note

Class C 110 00000 – 110 11111 [192  223 ] Number of blocks (Networks) in class C is 2 21 = 2,097,152. Each block contains 256 addresses (Hosts).

Not so many organizations are so small to have a class C block. Use: Class C is used by organizations requiring small to medium size networks. For example- engineering colleges, small universities, small offices etc.

Calculation Therefore total number of blocks in Class C = 2 21  = 2,097,152 There is 1 byte (8 bits) for hostid in Class C so total number of host in each block = 2 8  = 256 So total number of addresses in Class C = No. of Blocks in Class C x No. of Hosts in each block of Class C = 2,097,152 x 256 = 536,870,912 This is 12.5% of the total addresses in IPv4.

Netid 192.0.0     … Netid 192.0.1 Netid 223.255.255   Class C 192.0.0.0 to 192.0.0.255 192.0.1.0 to 192.0.1.255 223.255.255.0 to 223.255.255.255 11011111.11111111.11111111.11111111   Block 1 Block 2 Block 2,097,152

Class D 1110 0000  1110 1111 [224  239 ] Only one block of class D addresses, designed for multicasting Each address in this class is used to define one group of hosts on the Internet.

netid or hostid For a class D address,  there is no netid or hostid . All class D addresses are reserved for multicasting. In class D addresses, the first 4 bits are always 1110 (224). The remaining 28 bits are used to define multicast addresses. Class D 224.0.0.0    to    239.255.255.255 Single block of 268,435,456 addresses

Address Choice: The streaming service selects a multicast address (e.g., 239.10.10.10). Stream Sending: The server broadcasts a single video stream to the chosen multicast address, rather than individual streams per user. User Subscription: Users opt into the multicast group associated with the chosen address to receive the stream. Router Configuration: Network routers are set up to forward multicast packets only to segments where users have joined the multicast group. Stream Viewing: Devices in the multicast group receive and play the stream without needing separate streams per user.

The only block of class E addresses was reserved for future purposes. Class E 1111 0000  1111 1111 = [240  255]

netid or hostid For a class E address,  there is no netid or hostid . All class E addresses are reserved for special uses. In practical terms, Class E addresses are not utilized in traditional networking and are kept reserved for potential future uses, research, or experimental purposes that may arise within networking or related fields. Class E 240.0.0.0    to    255.255.255.255 Single block of 268,435,456 addresses

Find the class of each address: 0000001 00001011 00001011 11101111 The first bit is 0. This is a class A address. 110 00001 10000011 00011011 11111111 The first 2 bits are 1; the third bit is 0. This is a class C address. 10 100111 11011011 10001011 01101111 The first bit is 1; the second bit is 0. This is a class B address 1111 0011 10011011 11111011 00001111 The first 4 bits are 1s. This is a class E address.. Example

Find the class of each address: 227.12.14.87 b. 193.14.56.22 c. 14.23.120.8 d. 252.5.15.111 e. 134.11.78.56 Example

Example Solution a. The first byte is 227 (between 224 and 239); the class is D. b . The first byte is 193 (between 192 and 223); the class is C. c. The first byte is 14 (between 0 and 127); the class is A. d. The first byte is 252 (between 240 and 255); the class is E. e. The first byte is 134 (between 128 and 191); the class is B. Find the class of each address: a. 227.12.14.87 b. 193.14.56.22 c. 14.23.120.8 d. 252.5.15.111 e. 134.11.78.56

Two-Level Addressing When classful addressing was designed, it was assumed that the whole Internet is divided into many networks and each network connects many hosts. That is, the Internet was seen as a network of networks. A network was normally created by an organization that wanted to be connected to the Internet.

The range of addresses allocated to an organization in classful addressing was a block of addresses in Class A, B, or C.

Since all addresses in a network belonged to a single block, each address in classful addressing contains two parts: netid and hostid.

Figure Two-level addressing in classful addressing

Extracting Information in a Block Given any address in the block, we normally like to know: - the number of addresses - the first address - the last address. For this, we need to know the class of the address.

The number of addresses in the block, N = 2 32−n . To find the first address: keep the n leftmost bits and set the (32 − n) rightmost bits to 0. To find the last address: keep the n leftmost bits and set the (32 − n) rightmost bits to 1s.

Figure Information extraction in classful addressing

An address in a block is given as 73.22.17.25. Find the number of addresses in the block, the first address, and the last address. Solution 1. The number of addresses in this block is N = 2 32−n = 16,777,216. 2. To find the first address, we keep the leftmost 8 bits and set the rightmost 24 bits all to 0s. The first address is 73.0.0.0/8, in which 8 is the value of n . 3. To find the last address, we keep the leftmost 8 bits and set the rightmost 24 bits all to 1s. The last address is 73.255.255.255. Example 7

Figure Solution to Example 7

An address in a block is given as 180.8.17.9. Find the number of addresses in the block, the first address, and the last address. Solution 1. The number of addresses in this block is N = 2 32−n = 65,536. 2. To find the first address, we keep the leftmost 16 bits and set the rightmost 16 bits all to 0s. The first address is 18.8.0.0/16, in which 16 is the value of n . 3. To find the last address, we keep the leftmost 16 bits and set the rightmost 16 bits all to 1s. The last address is 18.8.255.255. Example 8

Figure Solution to Example 8

An address in a block is given as 200.11.8.45. Find the number of addresses in the block, the first address, and the last address. Solution 1. The number of addresses in this block is N = 2 32−n = 256. 2. To find the first address, we keep the leftmost 24 bits and set the rightmost 8 bits all to 0s. The first address is 200.11.8.0/24, in which 24 is the value of n . 3. To find the last address, we keep the leftmost 24 bits and set the rightmost 8 bits all to 1s. The last address is 200.11.8.255/24. Example 9

Figure Solution to Example 9

Given the network address 17.0.0.0, find the class, the block, and the range of the addresses. Example 10

Given the network address 17.0.0.0, find the class, the block, and the range of the addresses. Example 10 Solution The class is A because the first byte is between 0 and 127. The block has a netid of 17. The addresses range from 17.0.0.0 to 17.255.255.255.

Example 11 Given the network address 132.21.0.0, find the class, the block, and the range of addresses.

Example 11 Given the network address 132.21.0.0, find the class, the block, and the range of addresses. Solution The class is B, the block is 132.21, and the range is 132.21.0.0 to 132.21.255.255

Example 12 Given the network address 220.34.76.0, find the class, the block, and the range of addresses

Example 12 Given the network address 220.34.76.0, find the class, the block, and the range of addresses Solution The class is C, the block is 220.34.76, and the range of addresses is 220.34.76.0 to 220.34.76.255

Network Address - the first address of a block used in routing a packet to its destination network.

The network address is the identifier of a network. Note

Given the address 23.56.7.91, find the beginning address (network address). Example 13

Given the address 23.56.7.91, find the beginning address (network address). Example 13 Solution The default mask is 255.0.0.0, which means that only the first byte is preserved and the other 3 bytes are set to 0s. The network address is 23.0.0.0.

Given the address 132.6.17.85, find the beginning address (network address). Example 14

Given the address 132.6.17.85, find the beginning address (network address). Example 14 Solution The default mask is 255.255.0.0, which means that the first 2 bytes are preserved and the other 2 bytes are set to 0s. The network address is 132.6.0.0 .

Given the address 201.180.56.5, find the beginning address (network address). Example 15

Given the address 201.180.56.5, find the beginning address (network address). Example 15 Solution The default mask is 255.255.255.0, which means that the first 3 bytes are preserved and the last byte is set to 0. The network address is 201.180.56.0 .

Subnetting A subnet, or subnetwork, is  a network inside a network . Subnets make networks more efficient. Through subnetting, network traffic can travel a shorter distance without passing through unnecessary routers to reach its destination.

Def One goal of a subnet is  to split a large network into a grouping of smaller, interconnected networks to help minimize traffic . This way, traffic doesn't have to flow through unnecessary routs, increasing network speeds. Subnetting, the segmentation of a network address space, improves address allocation efficiency.

Class C Subnetting Tutorial Subnetting is done by taking the bit/s from host part and adding it to the network part. Consider the same  Class C  example given above. Remember, the first three octets of a  Class C network  is used to represent the network and the last octet is used to represent the host. The default format for a  Class C IPv4 address  is Network.Network.Network.Host .

To make things easy, you may remember this. If all the  bits  in the host part are "0", that represents the network id. If all the  bits  in the host part are "0" except the last  bit , it is the first usable  IPv4 address . If all the  bits  in the host part are "1" except the last  bit , it is the last usable  IPv4 address . If all the  bits  in the host part are "1", that represents the broadcast address .

Class C 1-bit subnetting tutorial Let us try to visualize the unsubnetted   Class C network  192.168.10.0 with default  subnet mask  255.255.255.0 using below image.  Network address  is 192.168.10.0, first usable IPv4 address is 192.168.10.1, second usable IPv4 address is 192.168.10.2, third usable IPv4 address is 192.168.10.3 ...... up to last usable IPv4 address 192.168.10.254 and the broadcast address 192.168.10.255.

Continue Consider the example of  Class C network  192.168.10.0 255.255.255.0, we discussed above. If we include one bit from the host part to the network part in the last octet, the default  subnet mask  of  Class C network  255.255.255.0 is changed into 255.255.255.128. The single bit that is added to the network part from the host part, in the last octet, can have two possible values. Those two possible values are either 0 or 1. That means, we can get two subnets if we do a single bit subnetting for a  Class C network .

SN No Description Binaries Decimal 1 Network Address 11000000.10101000.00001010.00000000 192.168.10.0 First IPv4 address 11000000.10101000.00001010.00000001 192.168.10.1 Last IPv4 address 11000000.10101000.00001010.01111110 192.168.10.126 Broadcast Address 11000000.10101000.00001010.01111111 192.168.10.127 2 Network Address 11000000.10101000.00001010.10000000 192.168.10.128 First IPv4 address 11000000.10101000.00001010.10000001 192.168.10.129 Last IPv4 address 11000000.10101000.00001010.11111110 192.168.10.254 Broadcast Address 11000000.10101000.00001010.11111111 192.168.10.255

Summary The network 192.168.10.0 is divided into two subnets, each subnet has 128 total  IPv4 addresses  and 126 usable  IPv4 addresses . Two  IPv4 addresses  are used in each subnet to represent the  network address  and the  directed broadcast address . The  subnet mask  for 1-bit subnetting for a  Class C network  is 255.255.255.128.

Visualization Subnet 1 has its  network address  192.168.10.0 with a  subnet mask  of 255.255.255.128. First usable IPv4 address is 192.168.10.1, second usable IPv4 address is 192.168.10.2, third usable IPv4 address is 192.168.10.3 ...... up to last usable IPv4 address 192.168.10.126 and the broadcast address 192.168.10.127. Subnet 2 has its  network address  192.168.10.128 with a  subnet mask  of 255.255.255.128. First usable IPv4 address is 192.168.10.129, second usable IPv4 address is 192.168.10.130, third usable IPv4 address is 192.168.10.131 ...... up to last usable IPv4 address 192.168.10.254 and the broadcast address 192.168.10.255.

Class C 2-bit subnetting tutorial

SN No Description Binaries Decimal 1 Network Address 11000000.10101000.00001010.00000000 192.168.10.0 First IPv4 address 11000000.10101000.00001010.00000001 192.168.10.1 Last IPv4 address 11000000.10101000.00001010.00111110 192.168.10.62 Broadcast Address 11000000.10101000.00001010.00111111 192.168.10.63 2 Network Address 11000000.10101000.00001010.01000000 192.168.10.64 First IPv4 address 11000000.10101000.00001010.01000001 192.168.10.65 Last IPv4 address 11000000.10101000.00001010.01111110 192.168.10.126 Broadcast Address 11000000.10101000.00001010.01111111 192.168.10.127 3 Network Address 11000000.10101000.00001010.10000000 192.168.10.128 First IPv4 address 11000000.10101000.00001010.10000001 192.168.10.129 Last IPv4 address 11000000.10101000.00001010.10111110 192.168.10.190 Broadcast Address 11000000.10101000.00001010.10111111 192.168.10.191 4 Network Address 11000000.10101000.00001010.11000000 192.168.10.192 First IPv4 address 11000000.10101000.00001010.11000001 192.168.10.193 Last IPv4 address 11000000.10101000.00001010.11111110 192.168.10.254 Broadcast Address 11000000.10101000.00001010.11111111 192.168.10.255

Expl The network 192.168.10.0 is divided into four subnets, each subnet has 64 total  IPv4 addresses  and 62 usable  IPv4 addresses . Two  IPv4 addresses  are used in each subnet to represent the  network address  and the  directed broadcast address . The  subnet mask  for 2-bit subnetting for a  Class C network  is 255.255.255.192. Visualization of 2-bit subnetting of  Class C network  192.168.10.0 with  subnet mask  255.255.255.192 is given below.

Class C 3-bit subnetting tutorial If we include three bits from the host part to the network part in last octet, the default  subnet mask  of  Class C network  255.255.255.0 is changed into 255.255.255.224. The three bits added to the network part from the host part in the last octet can have eight possible values. Those eight possible values are 000, 001, 010, 011, 100, 101, 110 and 111.

SN No Description Binaries Decimal 1 Network Address 11000000.10101000.00001010.00000000 192.168.10.0 First IPv4 address 11000000.10101000.00001010.00000001 192.168.10.1 Last IPv4 address 11000000.10101000.00001010.00011110 192.168.10.30 Broadcast Address 11000000.10101000.00001010.00011111 192.168.10.31 2 Network Address 11000000.10101000.00001010.00100000 192.168.10.32 First IPv4 address 11000000.10101000.00001010.00100001 192.168.10.33 Last IPv4 address 11000000.10101000.00001010.00111110 192.168.10.62 Broadcast Address 11000000.10101000.00001010.00111111 192.168.10.63 3 Network Address 11000000.10101000.00001010.01000000 192.168.10.64 First IPv4 address 11000000.10101000.00001010.01000001 192.168.10.65 Last IPv4 address 11000000.10101000.00001010.01011110 192.168.10.94 Broadcast Address 11000000.10101000.00001010.01011111 192.168.10.95 4 Network Address 11000000.10101000.00001010.01100000 192.168.10.96 First IPv4 address 11000000.10101000.00001010.01100001 192.168.10.97 Last IPv4 address 11000000.10101000.00001010.01111110 192.168.10.126 Broadcast Address 11000000.10101000.00001010.01111111 192.168.10.127 5 Network Address 11000000.10101000.00001010.10000000 192.168.10.128 First IPv4 address 11000000.10101000.00001010.10000001 192.168.10.129 Last IPv4 address 11000000.10101000.00001010.10011110 192.168.10.158 Broadcast Address 11000000.10101000.00001010.10011111 192.168.10.159 6 Network Address 11000000.10101000.00001010.10100000 192.168.10.160 First IPv4 address 11000000.10101000.00001010.10100001 192.168.10.161 Last IPv4 address 11000000.10101000.00001010.10111110 192.168.10.190 Broadcast Address 11000000.10101000.00001010.10111111 192.168.10.191 7 Network Address 11000000.10101000.00001010.11000000 192.168.10.192 First IPv4 address 11000000.10101000.00001010.11000001 192.168.10.193 Last IPv4 address 11000000.10101000.00001010.11011110 192.168.10.222 Broadcast Address 11000000.10101000.00001010.11011111 192.168.10.223 8 Network Address 11000000.10101000.00001010.11100000 192.168.10.224 First IPv4 address 11000000.10101000.00001010.11100001 192.168.10.225 Last IPv4 address 11000000.10101000.00001010.11111110 192.168.10.254 Broadcast Address 11000000.10101000.00001010.11111111 192.168.10.255

Class C 4-bit subnetting

Subnet Bits Subnet Mask CIDR Total Subnets Usable IPs/Subnet 255.255.255.0 /24 1 254 1 255.255.255.128 /25 2 126 2 255.255.255.192 /26 4 62 3 255.255.255.224 /27 8 30 4 255.255.255.240 /28 16 14 5 255.255.255.248 /29 32 6 6 255.255.255.252 /30 64 2

Class B Let us try to visualize the unsubnetted   Class B network  172.16.0.0 with default  subnet mask  255.255.0.0 using below image.  Network address  is 172.16.0.0, first usable IPv4 address is 172.16.0.1, second usable IPv4 address is 172.16.0.2, third usable IPv4 address is 172.16.0.3 ...... up to last usable IPv4 address 172.16.255.254 and the broadcast address 172.16.255.255.

Class B Subnetting Remember, the first two octets of a  Class B network  is used to represent the network and the last two octets are used to represent a host within that network. The default format for a  Class B IPv4 address  is Network.Network.Host.Host . Let us consider an example of  Class B network  172.16.0.0 - 255.255.0.0. The  binary representation  of the above network and its  subnet mask  are shown in below table.

Component Binary Decimal Address Part 10101100.00010000.00000000.00000000 172.16.0.0 SN Mask 11111111.11111111.00000000.00000000 255.255.0.0

Points Once again, If all the  bits  in the host part are "0", that represents the  network address . If all the  bits  in the host part are "0" except the last bit, it is the first usable IPv4 address. If all the  bits  in the host part are "1" except the last bit, it is the last usable IPv4 address. If all the  bits  in the host part are "1", that represents the  directed broadcast address .

Class B 1-bit subnetting tutorial If we include one bit from the host part to the network part in the third octet, the default  subnet mask  of  Class B network  255.255.0.0 is changed into 255.255.128.0. The single bit added to network part from host part in the third octet can have two possible values in third octet, either 0 or 1. That means, we can get two subnets if we do a single bit subnetting on a  Class B network .

SN No Description Binaries Decimal 1 Network Address 10101100.00010000.00000000.00000000 172.16.0.0 First IPv4 address 10101100.00010000.00000000.00000001 172.16.0.1 Last IPv4 address 10101100.00010000.01111111.11111110 172.16.127.254 Broadcast Address 10101100.00010000.01111111.11111111 172.16.127.255 2 Network Address 10101100.00010000.10000000.00000000 172.16.128.0 First IPv4 address 10101100.00010000.10000000.00000001 172.16.128.1 Last IPv4 address 10101100.00010000.11111111.11111110 172.16.255.254 Broadcast Address 10101100.00010000.11111111.11111111 172.16.255.255

Explanation The network 172.16.0.0 is divided into two subnets, each subnet has 32,768 total IPv4 addresses and 32,766 usable  IPv4 addresses . Two  IPv4 addresses  are used in each subnet to represent the  network address  and  directed broadcast address  (first and last IPv4 addresses in a subnet block). As mentioned earlier in this lesson, you cannot use  network address  or  directed broadcast address  as the IPv4 address for devices inside your network. The  subnet mask  to use for 1-bit subnetting for a  Class B network  is 255.255.128.0. Visualization of 1-bit subnetting of  Class B network  172.16.0.0 with  subnet mask  255.255.128.0 is given below. Subnet 1 has its  network address  172.16.0.0 with a  subnet mask  of 255.255.128.0. First usable IPv4 address is 172.16.0.1, second usable IPv4 address is 172.16.0.2, third usable IPv4 address is 172.16.0.3 ...... up to last usable IPv4 address 172.16.127.254 and the broadcast address 172.16.127.255. Subnet 2 has its  network address  172.16.128.0 with a  subnet mask  of 255.255.128.0. First usable IPv4 address is 172.16.128.1, second usable IPv4 address is 172.16.128.2, third usable IPv4 address is 172.16.128.3 ...... up to last usable IPv4 address 172.16.255.254 and the broadcast address 172.16.255.255.

Class B 2-bit subnetting tutorial If we include two bits from the host part to the network part in the third octet, the default  subnet mask  of  Class B network  255.255.0.0 is changed into 255.255.192.0. The two bits added to network part from host part can have four possible values in third octet, 00, 01, 10, and 11. That means, we can get four networks if we do a 2-bit subnetting on a  Class B network

SN No Description Binaries Decimal 1 Network Address 10101100.00010000.00000000.00000000 172.16.0.0 First IPv4 address 10101100.00010000.00000000.00000001 172.16.0.1 Last IPv4 address 10101100.00010000.00111111.11111110 172.16.63.254 Broadcast Address 10101100.00010000.00111111.11111111 172.16.63.255 2 Network Address 10101100.00010000.01000000.00000000 172.16.64.0 First IPv4 address 10101100.00010000.01000000.00000001 172.16.64.1 Last IPv4 address 10101100.00010000.01111111.11111110 172.16.127.254 Broadcast Address 10101100.00010000.01111111.11111111 172.16.127.255 3 Network Address 10101100.00010000.10000000.00000000 172.16.128.0 First IPv4 address 10101100.00010000.10000000.00000001 172.16.128.1 Last IPv4 address 10101100.00010000.10111111.11111110 172.16.191.254 Broadcast Address 10101100.00010000.10111111.11111111 172.16.191.255 4 Network Address 10101100.00010000.11000000.00000000 172.16.192.0 First IPv4 address 10101100.00010000.11000000.00000001 172.16.192.1 Last IPv4 address 10101100.00010000.11111111.11111110 172.16.255.254 Broadcast Address 10101100.00010000.11111111.11111111 172.16.255.255

Class B 3-bit subnetting tutorial If we include three bits to the network part from the host part, the default  subnet mask  of  Class B network  255.255.0.0 is changed into 255.255.224.0. The three bits added to network part can have eight possible values in the third octet. Those eight possible values are 000, 001, 010, 011, 100, 101, 110 and 111. That means, we can get eight networks if we do a 3-bit subnetting on a  Class B network .

SN No Description Binaries Decimal 1 Network Address 10101100.00010000.00000000.00000000 172.16.0.0 First IPv4 address 10101100.00010000.00000000.00000001 172.16.0.1 Last IPv4 address 10101100.00010000.00011111.11111110 172.16.31.254 Broadcast Address 10101100.00010000.00011111.11111111 172.16.31.255 2 Network Address 10101100.00010000.00100000.00000000 172.16.32.0 First IPv4 address 10101100.00010000.00100000.00000001 172.16.32.1 Last IPv4 address 10101100.00010000.00111111.11111110 172.16.63.254 Broadcast Address 10101100.00010000.00111111.11111111 172.16.63.255 3 Network Address 10101100.00010000.01000000.00000000 172.16.64.0 First IPv4 address 10101100.00010000.01000000.00000001 172.16.64.1 Last IPv4 address 10101100.00010000.01011111.11111110 172.16.95.254 Broadcast Address 10101100.00010000.01011111.11111111 172.16.95.255 4 Network Address 10101100.00010000.01100000.00000000 172.16.96.0 First IPv4 address 10101100.00010000.01100000.00000001 172.16.96.1 Last IPv4 address 10101100.00010000.01111111.11111110 172.16.127.254 Broadcast Address 10101100.00010000.01111111.11111111 172.16.127.255 5 Network Address 10101100.00010000.10000000.00000000 172.16.128.0 First IPv4 address 10101100.00010000.10000000.00000001 172.16.128.1 Last IPv4 address 10101100.00010000.10011111.11111110 172.16.159.254 Broadcast Address 10101100.00010000.10011111.11111111 172.16.159.255 6 Network Address 10101100.00010000.10100000.00000000 172.16.160.0 First IPv4 address 10101100.00010000.10100000.00000001 172.16.160.1 Last IPv4 address 10101100.00010000.10111111.11111110 172.16.191.254 Broadcast Address 10101100.00010000.10111111.11111111 172.16.191.255 7 Network Address 10101100.00010000.11000000.00000000 172.16.192.0 First IPv4 address 10101100.00010000.11000000.00000001 172.16.192.1 Last IPv4 address 10101100.00010000.11011111.11111110 172.16.223.254 Broadcast Address 10101100.00010000.11011111.11111111 172.16.223.255 8 Network Address 10101100.00010000.11100000.00000000 172.16.224.0 First IPv4 address 10101100.00010000.11100000.00000001 172.16.224.1 Last IPv4 address 10101100.00010000.11111111.11111110 172.16.255.254 Broadcast Address 10101100.00010000.11111111.11111111 172.16.255.255

Class B 4-bit subnetting tutorial If we add four bits to the network part from host part in the third octet, for a  Class B network , the default  subnet mask  255.255.0.0 is changed to 255.255.240.0. The four bits added to the network part from the host part, in the third octet, can have sixteen possible values. Those sixteen possible values are 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110 and 1111.

SN No Description Binaries Decimal 1 Network Address 10101100.00010000.00000000.00000000 172.16.0.0 First IP Address 10101100.00010000.00000000.00000001 172.16.0.1 Last IP Address 10101100.00010000.00001111.11111110 172.16.15.254 Broadcast Address 10101100.00010000.00001111.11111111 172.16.15.255 2 Network Address 10101100.00010000.00010000.00000000 172.16.16.0 First IP Address 10101100.00010000.00010000.00000001 172.16.16.1 Last IP Address 10101100.00010000.00011111.11111110 172.16.31.254 Broadcast Address 10101100.00010000.00011111.11111111 172.16.31.255 3 Network Address 10101100.00010000.00100000.00000000 172.16.32.0 First IP Address 10101100.00010000.00100000.00000001 172.16.32.1 Last IP Address 10101100.00010000.00101111.11111110 172.16.47.254 Broadcast Address 10101100.00010000.00101111.11111111 172.16.47.255 4 Network Address 10101100.00010000.00110000.00000000 172.16.48.0 First IP Address 10101100.00010000.00110000.00000001 172.16.48.1 Last IP Address 10101100.00010000.00111111.11111110 172.16.63.254 Broadcast Address 10101100.00010000.00111111.11111111 172.16.63.255 5 Network Address 10101100.00010000.01000000.00000000 172.16.64.0 First IP Address 10101100.00010000.01000000.00000001 172.16.64.1 Last IP Address 10101100.00010000.01001111.11111110 172.16.79.254 Broadcast Address 10101100.00010000.01001111.11111111 172.16.79.255 6 Network Address 10101100.00010000.01010000.00000000 172.16.80.0 First IP Address 10101100.00010000.01010000.00000001 172.16.80.1 Last IP Address 10101100.00010000.01011111.11111110 172.16.95.254 Broadcast Address 10101100.00010000.01011111.11111111 172.16.95.255 7 Network Address 10101100.00010000.01100000.00000000 172.16.96.0 First IP Address 10101100.00010000.01100000.00000001 172.16.96.1 Last IP Address 10101100.00010000.01101111.11111110 172.16.111.254 Broadcast Address 10101100.00010000.01101111.11111111 172.16.111.255 8 Network Address 10101100.00010000.01110000.00000000 172.16.112.0 First IP Address 10101100.00010000.01110000.00000001 172.16.112.1 Last IP Address 10101100.00010000.01111111.11111110 172.16.127.254 Broadcast Address 10101100.00010000.01111111.11111111 172.16.127.255 9 Network Address 10101100.00010000.10000000.00000000 172.16.128.0 First IP Address 10101100.00010000.10000000.00000001 172.16.128.1 Last IP Address 10101100.00010000.10001111.11111110 172.16.143.254 Broadcast Address 10101100.00010000.10001111.11111111 172.16.143.255 10 Network Address 10101100.00010000.10010000.00000000 172.16.144.0 First IP Address 10101100.00010000.10010000.00000001 172.16.144.1 Last IP Address 10101100.00010000.10011111.11111110 172.16.159.254 Broadcast Address 10101100.00010000.10011111.11111111 172.16.159.255 11 Network Address 10101100.00010000.10100000.00000000 172.16.160.0 First IP Address 10101100.00010000.10100000.00000001 172.16.160.1 Last IP Address 10101100.00010000.10101111.11111110 172.16.175.254 Broadcast Address 10101100.00010000.10101111.11111111 172.16.175.255 12 Network Address 10101100.00010000.10110000.00000000 172.16.176.0 First IP Address 10101100.00010000.10110000.00000001 172.16.176.1 Last IP Address 10101100.00010000.10111111.11111110 172.16.191.254 Broadcast Address 10101100.00010000.10111111.11111111 172.16.191.255 13 Network Address 10101100.00010000.11000000.00000000 172.16.192.0 First IP Address 10101100.00010000.11000000.00000001 172.16.192.1 Last IP Address 10101100.00010000.11001111.11111110 172.16.207.254 Broadcast Address 10101100.00010000.11001111.11111111 172.16.207.255 14 Network Address 10101100.00010000.11010000.00000000 172.16.208.0 First IP Address 10101100.00010000.11010000.00000001 172.16.208.1 Last IP Address 10101100.00010000.11011111.11111110 172.16.223.254 Broadcast Address 10101100.00010000.11011111.11111111 172.16.223.255 15 Network Address 10101100.00010000.11100000.00000000 172.16.224.0 First IP Address 10101100.00010000.11100000.00000001 172.16.224.1 Last IP Address 10101100.00010000.11101111.11111110 172.16.239.254 Broadcast Address 10101100.00010000.11101111.11111111 172.16.239.255 16 Network Address 10101100.00010000.11110000.00000000 172.16.240.0 First IP Address 10101100.00010000.11110000.00000001 172.16.240.1 Last IP Address 10101100.00010000.11111111.11111110 172.16.255.254 Broadcast Address 10101100.00010000.11111111.11111111 172.16.255.255

Subnet Bits Subnet Mask CIDR Total Subnets Usable IP Address/Subnet 255.255.0.0 /16 1 65534 1 255.255.128.0 /17 2 32766 2 255.255.192.0 /18 4 16382 3 255.255.224.0 /19 8 8190 4 255.255.240.0 /20 16 4094 5 255.255.248.0 /21 32 2046 6 255.255.252.0 /22 64 1022 7 255.255.254.0 /23 128 510 8 255.255.255.0 /24 256 254 9 255.255.255.128 /25 512 126 10 255.255.255.192 /26 1024 62 11 255.255.255.224 /27 2048 30 12 255.255.255.240 /28 4096 14 13 255.255.255.248 /29 8192 6 14 255.255.255.252 /30 16384 2

C l ass A Let us try to visualize the unsubnetted   Class A network  10.0.0.0 with default  subnet mask  255.0.0.0 using below image.  Network address  is 10.0.0.0, first usable IPv4 address is 10.0.0.1, second usable IPv4 address is 10.0.0.2, third usable IPv4 address is 10.0.0.3 ...... up to last usable IPv4 address 10.255.255.254 and the broadcast address 10.255.255.255.

Class A Subnetting Remember, the first octet of a  Class A network  is used to represent the network and the remaining three octets are used to represent a host within that network. The default format for a  Class A IPv4 address  is Network.Host.Host.Host . Let us consider an example of  Class A network  10.0.0.0 - 255.0.0.0. The  binary representation  of the above network and its  subnet mask  are shown in below table.

Component Binary Decimal Address Part 00001010.00000000.00000000.00000000 10.0.0.0 Subnet Mask 11111111.00000000.00000000.00000000 255.0.0.0

Note Once again, If all the  bits  in the host part are "0", that represents the  network address . If all the  bits  in the host part are "0" except the last bit, it is the first usable IPv4 address. If all the  bits  in the host part are "1" except the last bit, it is the last usable IPv4 address. If all the  bits  in the host part are "1", that represents the  directed broadcast address .

Class A 1-bit subnetting tutorial If we include one bit to network part from the host part in the second octet, the default  subnet mask  of a  Class A network  255.0.0.0 is changed into 255.128.0.0. The single bit can have two values in second octet, either 0 or 1. That means, we can get two subnets if we do a single bit subnetting on a  Class A network . Please refer below image.

SN No Description Binaries Decimal 1 Network Address 00001010.00000000.00000000.00000000 10.0.0.0 First IPv4 address 00001010.00000000.00000000.00000001 10.0.0.1 Last IPv4 address 00001010.01111111.11111111.11111110 10.127.255.254 Broadcast Address 00001010.01111111.11111111.11111111 10.127.255.255 2 Network Address 00001010.10000000.00000000.00000000 10.128.0.0 First IPv4 address 00001010.10000000.00000000.00000001 10.128.0.1 Last IPv4 address 00001010.11111111.11111111.11111110 10.255.255.254 Broadcast Address 00001010.11111111.11111111.11111111 10.255.255.255

Explanation The network 10.0.0.0 is divided into two subnets, each subnet has 8,388,608 total  IPv4 Addresses  and 8,388,606 usable  IPv4 Addresses . Two  IPv4 addresses  are used in each subnet to represent the  network address  and  directed broadcast address  (first and last IPv4 addresses in a subnet block). As mentioned in previous subnetting tutorial lessons, you cannot use  network address  or  directed broadcast address  as the IPv4 address for devices inside your network. The  subnet mask  to use for 1-bit subnetting for a  Class A network  is 255.128.0.0. Visualization of 1-bit subnetting of  Class A network  10.0.0.0 with  subnet mask  255.128.0.0 is given below. Subnet 1 has its  network address  10.0.0.0 with a  subnet mask  of 255.128.0.0. First usable IPv4 address is 10.0.0.1, second usable IPv4 address is 10.0.0.2, third usable IPv4 address is 10.0.0.3 ...... up to last usable IPv4 address 10.127.255.254 and the broadcast address 10.127.255.255. Subnet 2 has its  network address  10.128.0.0 with a  subnet mask  of 255.128.0.0. First usable IPv4 address is 10.128.0.1, second usable IPv4 address is 10.128.0.2, third usable IPv4 address is 10.128.0.3 ...... up to last usable IPv4 address 10.255.255.254 and the broadcast address 10.255.255.255.

Class A 2-bit subnetting tutorial If we include two bits to the network part from the host part in the second octet, the default  subnet mask  of a  Class A network  255.0.0.0 is changed into 255.192.0.0. The two bits added to the network part from the host part can have four possible values in second octet of a  Class A network  , 00, 01, 10, and 11. That means, we can get four networks if we do a 2-bit subnetting on a  Class A network . Ths subnet mask to use for  Class A network  2-bit subnetting is 255.192.0.0. Please refer below image.

SN No Description Binaries Decimal 1 Network Address 00001010.00000000.00000000.00000000 10.0.0.0 First IPv4 address 00001010.00000000.00000000.00000001 10.0.0.1 Last IPv4 address 00001010.00111111.11111111.11111110 10.63.255.254 Broadcast Address 00001010.00111111.11111111.11111111 10.63.255.255 2 Network Address 00001010.01000000.00000000.00000000 10.64.0.0 First IPv4 address 00001010.01000000.00000000.00000001 10.64.0.1 Last IPv4 address 00001010.01111111.11111111.11111110 10.127.255.254 Broadcast Address 00001010.01111111.11111111.11111111 10.127.255.255 3 Network Address 00001010.10000000.00000000.00000000 10.128.0.0 First IPv4 address 00001010.10000000.00000000.00000001 10.128.0.1 Last IPv4 address 00001010.10111111.11111111.11111110 10.191.255.254 Broadcast Address 00001010.10111111.11111111.11111111 10.191.255.255 4 Network Address 00001010.11000000.00000000.00000000 10.192.0.0 First IPv4 address 00001010.11000000.00000000.00000001 10.192.0.1 Last IPv4 address 00001010.11111111.11111111.11111110 10.255.255.254 Broadcast Address 00001010.11111111.11111111.11111111 10.255.255.255

Continue The network 10.0.0.0 is divided into four subnets, each subnet has 4,194,304 total  IPv4 Addresses  and 4,194,302 usable  IPv4 Addresses . Two  IPv4 addresses  are used in each subnet to represent the  network address  and  directed broadcast address  (first and last IPv4 addresses in a subnet block). As mentioned in previous subnetting tutorial lessons, you cannot use  network address  or  directed broadcast address  as the IPv4 address for devices inside your network. The  subnet mask  to use for 2-bit subnetting for a  Class A network  is 255.192.0.0. Visualization of 2-bit subnetting of  Class A network  10.0.0.0 with  subnet mask  255.192.0.0 is given below.

Class A 3-bit subnetting tutorial If we include three bits to the network part from the host part in the second octet of a  Class A network , the default  subnet mask  of a  Class A network  255.0.0.0 is changed into 255.224.0.0 The three bits added to the network part from the host part in second octet can have eight possible values. Those eight possible values are 000, 001, 010, and 011, 100, 101, 110 and 111. That means, we can get eight networks if we do a 3-bit subnetting on a  Class A network  and the  subnet mask  to use for  Class A network  3-bit subnetting is 255.224.0.0. Please refer below image.

SN No Description Binaries Decimal 1 Network Address 00001010.00000000.00000000.00000000 10.0.0.0 First IPv4 address 00001010.00000000.00000000.00000001 10.0.0.1 Last IPv4 address 00001010.00011111.11111111.11111110 10.31.255.254 Broadcast Address 00001010.00011111.11111111.11111111 10.31.255.255 2 Network Address 00001010.00100000.00000000.00000000 10.32.0.0 First IPv4 address 00001010.00100000.00000000.00000001 10.32.0.1 Last IPv4 address 00001010.00111111.11111111.11111110 10.63.255.254 Broadcast Address 00001010.00111111.11111111.11111111 10.63.255.255 3 Network Address 00001010.01000000.00000000.00000000 10.64.0.0 First IPv4 address 00001010.01000000.00000000.00000001 10.64.0.1 Last IPv4 address 00001010.01011111.11111111.11111110 10.95.255.254 Broadcast Address 00001010.01011111.11111111.11111111 10.95.255.255 4 Network Address 00001010.01100000.00000000.00000000 10.96.0.0 First IPv4 address 00001010.01100000.00000000.00000001 10.96.0.1 Last IPv4 address 00001010.01111111.11111111.11111110 10.127.255.254 Broadcast Address 00001010.01111111.11111111.11111111 10.127.255.255 5 Network Address 00001010.10000000.00000000.00000000 10.128.0.0 First IPv4 address 00001010.10000000.00000000.00000001 10.128.0.1 Last IPv4 address 00001010.10011111.11111111.11111110 10.159.255.254 Broadcast Address 00001010.10011111.11111111.11111111 10.159.255.255 6 Network Address 00001010.10100000.00000000.00000000 10.160.0.0 First IPv4 address 00001010.10100000.00000000.00000001 10.160.0.1 Last IPv4 address 00001010.10111111.11111111.11111110 10.191.255.254 Broadcast Address 00001010.10111111.11111111.11111111 10.191.255.255 7 Network Address 00001010.11000000.00000000.00000000 10.192.0.0 First IPv4 address 00001010.11000000.00000000.00000001 10.192.0.1 Last IPv4 address 00001010.11011111.11111111.11111110 10.223.255.254 Broadcast Address 00001010.11011111.11111111.11111111 10.223.255.255 8 Network Address 00001010.11100000.00000000.00000000 10.224.0.0 First IPv4 address 00001010.11100000.00000000.00000001 10.224.0.1 Last IPv4 address 00001010.11111111.11111111.11111110 10.255.255.254 Broadcast Address 00001010.11111111.11111111.11111111 10.255.255.255

Continue The network 10.0.0.0 is divided into eight subnets, each subnet has 2,097,152 total  IPv4 Addresses  and 2,097,150 usable  IPv4 Addresses . Two  IPv4 addresses  are used in each subnet to represent the  network address  and  directed broadcast address  (first and last IPv4 addresses in a subnet block). As mentioned in previous subnetting tutorial lessons, you cannot use  network address  or  directed broadcast address  as the IPv4 address for devices inside your network. The  subnet mask  to use for 3-bit subnetting for a  Class A network  is 255.224.0.0. Visualization of 3-bit subnetting of  Class A network  10.0.0.0 with  subnet mask  255.224.0.0 is given below.

Class A 4-bit subnetting tutorial If we include four bits to the network part from the host part in the second octet, the default  subnet mask  of a  Class A network  255.0.0.0 is changed to 255.240.0.0. The four bits added to the network part from the host part, in the second octet, can have sixteen possible values. Those sixteen possible values are 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110 and 1111. That means, we get sixteen subnets if we do a 4-bit subnetting for a  Class A network . Please refer below image.

SN No Description Binaries Decimal 1 Network Address 00001010.00000000.00000000.00000000 10.0.0.0 First IP Address 00001010.00000000.00000000.00000001 10.0.0.1 Last IP Address 00001010.00001111.11111111.11111110 10.15.255.254 Broadcast Address 00001010.00001111.11111111.11111111 10.15.255.255 2 Network Address 00001010.00010000.00000000.00000000 10.16.0.0 First IP Address 00001010.00010000.00000000.00000001 10.16.0.1 Last IP Address 00001010.00011111.11111111.11111110 10.31.255.254 Broadcast Address 00001010.00011111.11111111.11111111 10.31.255.255 3 Network Address 00001010.00100000.00000000.00000000 10.32.0.0 First IP Address 00001010.00100000.00000000.00000001 10.32.0.1 Last IP Address 00001010.00101111.11111111.11111110 10.47.255.254 Broadcast Address 00001010.00101111.11111111.11111111 10.47.255.255 4 Network Address 00001010.00110000.00000000.00000000 10.48.0.0 First IP Address 00001010.00110000.00000000.00000001 10.48.0.1 Last IP Address 00001010.00111111.11111111.11111110 10.63.255.254 Broadcast Address 00001010.00111111.11111111.11111111 10.63.255.255 5 Network Address 00001010.01000000.00000000.00000000 10.64.0.0 First IP Address 00001010.01000000.00000000.00000001 10.64.0.1 Last IP Address 00001010.01001111.11111111.11111110 10.79.255.254 Broadcast Address 00001010.01001111.11111111.11111111 10.79.255.255 6 Network Address 00001010.01010000.00000000.00000000 10.80.0.0 First IP Address 00001010.01010000.00000000.00000001 10.80.0.1 Last IP Address 00001010.01011111.11111111.11111110 10.95.255.254 Broadcast Address 00001010.01011111.11111111.11111111 10.95.255.255 7 Network Address 00001010.01100000.00000000.00000000 10.96.0.0 First IP Address 00001010.01100000.00000000.00000001 10.96.0.1 Last IP Address 00001010.01101111.11111111.11111110 10.111.255.254 Broadcast Address 00001010.01101111.11111111.11111111 10.111.255.255 8 Network Address 00001010.01110000.00000000.00000000 10.112.0.0 First IP Address 00001010.01110000.00000000.00000001 10.112.0.1 Last IP Address 00001010.01111111.11111111.11111110 10.127.255.254 Broadcast Address 00001010.01111111.11111111.11111111 10.127.255.255 9 Network Address 00001010.10000000.00000000.00000000 10.128.0.0 First IP Address 00001010.10000000.00000000.00000001 10.128.0.1 Last IP Address 00001010.10001111.11111111.11111110 10.143.255.254 Broadcast Address 00001010.10001111.11111111.11111111 10.143.255.255 10 Network Address 00001010.10010000.00000000.00000000 10.144.0.0 First IP Address 00001010.10010000.00000000.00000001 10.144.0.1 Last IP Address 00001010.10011111.11111111.11111110 10.159.255.254 Broadcast Address 00001010.10011111.11111111.11111111 10.159.255.255 11 Network Address 00001010.10100000.00000000.00000000 10.160.0.0 First IP Address 00001010.10100000.00000000.00000001 10.160.0.1 Last IP Address 00001010.10101111.11111111.11111110 10.175.255.254 Broadcast Address 00001010.10101111.11111111.11111111 10.175.255.255 12 Network Address 00001010.10110000.00000000.00000000 10.176.0.0 First IP Address 00001010.10110000.00000000.00000001 10.176.0.1 Last IP Address 00001010.10111111.11111111.11111110 10.191.255.254 Broadcast Address 00001010.10111111.11111111.11111111 10.191.255.255 13 Network Address 00001010.11000000.00000000.00000000 10.192.0.0 First IP Address 00001010.11000000.00000000.00000001 10.192.0.1 Last IP Address 00001010.11001111.11111111.11111110 10.207.255.254 Broadcast Address 00001010.11001111.11111111.11111111 10.207.255.255 14 Network Address 00001010.11010000.00000000.00000000 10.208.0.0 First IP Address 00001010.11010000.00000000.00000001 10.208.0.1 Last IP Address 00001010.11011111.11111111.11111110 10.223.255.254 Broadcast Address 00001010.11011111.11111111.11111111 10.223.255.255 15 Network Address 00001010.11100000.00000000.00000000 10.224.0.0 First IP Address 00001010.11100000.00000000.00000001 10.224.0.1 Last IP Address 00001010.11101111.11111111.11111110 10.239.255.254 Broadcast Address 00001010.11101111.11111111.11111111 10.239.255.255 16 Network Address 00001010.11110000.00000000.00000000 10.240.0.0 First IP Address 00001010.11110000.00000000.00000001 10.240.0.1 Last IP Address 00001010.11111111.11111111.11111110 10.255.255.254 Broadcast Address 00001010.11111111.11111111.11111111 10.255.255.255

Subnet Bits Subnet Mask CIDR Total Subnets Usable IP Address/Subnet 255.0.0.0 /8 1 16777214 1 255.128.0.0 /9 2 8388606 2 255.192.0.0 /10 4 4194302 3 255.224.0.0 /11 8 2097150 4 255.240.0.0 /12 16 1048574 5 255.248.0.0 /13 32 524286 6 255.252.0.0 /14 64 262142 7 255.254.0.0 /15 128 131070 8 255.255.0.0 /16 256 65534 9 255.255.128.0 /17 512 32766 10 255.255.192.0 /18 1024 16382 11 255.255.224.0 /19 2048 8190 12 255.255.240.0 /20 4096 4094 13 255.255.248.0 /21 8192 2046 14 255.255.252.0 /22 16384 1022 15 255.255.254.0 /23 32768 510 16 255.255.255.0 /24 65536 254 17 255.255.255.128 /25 131072 126 18 255.255.255.192 /26 262144 62 19 255.255.255.224 /27 524288 30 20 255.255.255.240 /28 1048576 14 21 255.255.255.248 /29 2097152 6 22 255.255.255.252 /30 4194304 2

VLSM

VLSM Variable Length Subnet Masking (VLSM) is a way of further  subnetting  a subnet. Using Variable Length Subnet Masking (VLSM) we can allocate  IPv4 addresses  to the subnets by the exact need. Variable Length Subnet Masking (VLSM) allows us to use more than one  subnet mask  within the same network address space. If we recollect from the previous lessons, we can divide a network only into subnets with equal number of  IPv4 addresses . Variable Length Subnet Masking (VLSM) allows to create subnets from a single network with unequal number of  IPv4 addresses .

Example Example: We want to divide 192.168.10.0, which is a  Class C network , into four networks, each with unequal number of  IPv4 addresses  requirements as shown below. Subnet A : 126 IPv4 Addresses. Subnet B : 62 IPv4 Addresses. Subnet C : 30 IPv4 Addresses. Subnet D : 30 IPv4 Addresses Original Network (Network to be subnetted ) – 192.168.10.0/24

Variable Length Subnet Masking (VLSM) - First Division Divide the two networks equally with 128  IPv4 addresses  (126 usable  IPv4 addresses ) in each network using 255.255.255.128  subnet mask  (192.168.10.0/25). We will get two subnets each with 128  IPv4 addresses  (126 usable  IPv4 addresses ). 1) 192.168.10.0/25, which can be represented in  binaries  as below. 11000000.10101000.00001010.00000000 11111111.11111111.11111111.10000000 2) 192.168.10.128/25, which can be represented in  binaries  as below. 11000000.10101000.00001010.10000000 11111111.11111111.11111111.10000000

Variable Length Subnet Masking (VLSM)- Second Division Divide second subnet (192.168.10.128/25) we got from the first division again into two Networks, each with 64 IP Addresses (62 usable  IPv4 addresses ) using 255.255.255.192  subnet mask . We will get two subnets each with 64  IPv4 addresses  (62 usable  IPv4 addresses ). 1) 192.168.10.128/26, which can be represented in  binaries  as below. 11000000.10101000.00001010.10000000 11111111.11111111.11111111.11000000 2) 192.168.10.192/26 11000000.10101000.00001010.11 000000 11111111.11111111.11111111.11000000

Variable Length Subnet Masking (VLSM) - Third Division Divide 192.168.10.192/26 Network again into two Networks, each with 32  IPv4 addresses  (30 usable  IPv4 addresses ) using 255.255.255.224  subnet mask We will get two subnets each with 32  IPv4 addresses  (30 usable  IPv4 addresses ). 1) 192.168.10.192/27, which can be represented in  binaries  as below. 11000000.10101000.00001010.11000000 11111111.11111111.11111111.11100000 2) 192.168.10.224/27, which can be represented in  binaries  as below. 11000000.10101000.00001010.11100000 11111111.11111111.11111111.11100000

Summary Now we have split the 192.168.10.0/24 network into four subnets using Variable Length Subnet Masking (VLSM), with unequal number of  IPv4 addresses  as shown below. Also note that when you divide a network using Variable Length Subnet Masking (VLSM), the  subnet mask  are also different. 1) 192.168.10.0 - 255.255.255.128 (126 (128-2) usable  IPv4 addresses ) 2) 192.168.10.128 - 255.255.255.192 (62 (64-2) usable  IPv4 addresses ) 3) 192.168.10.192 - 255.255.255.224 (30 (32-2) usable  IPv4 addresses ) 4) 192.168.10.224 - 255.255.255.224 (30 (32-2) usable  IPv4 addresses )