0% found this document useful (0 votes)
2 views6 pages

Problem - CN

Uploaded by

Dhanya Ben
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Problem - CN

Uploaded by

Dhanya Ben
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

COMPUTER NETWORK

PROBLEM

1. Find the subnetwork address for the following

IP Address: [Link]
Subnet Mask: [Link]

Step 1: Convert to Binary

Decima Binary
l
192 11000000
168 10101000
10 00001010
25 00011001

IP Address: 11000000.10101000.00001010.00011001

Subnet Mask:

Decima Binary
l
255 11111111
255 11111111
255 11111111
0 00000000

11111111.11111111.11111111.00000000

Step 2: Perform AND Operation

IP Address : 11000000.10101000.00001010.00011001
Subnet Mask : 11111111.11111111.11111111.00000000
---------------------------------------------------------------------------
Subnet Address : 11000000.10101000.00001010.00000000

Step 3: Convert Back to Decimal

11000000 = 192
10101000 = 168
00001010 = 10
00000000 = 0

Final Subnetwork Address

[Link]
2. Determine the Hamming Code for the binary sequence 1001001

In Hamming Code, parity bits are always placed at positions that are powers of 2.

Step 1: Number of Data Bits

Data bits = 1001001

M= 7

Find number of parity bits r using:


r
2 ≥ m+ r +1
 m = number of data bits
 r = number of parity bits
 +1 = used for error detection position

Check values

Try r=1,2,3,4

r = 3 → 23=8<11 ❌
r = 4 → 24 =16 ≥12 ✅

Try r = 4

2⁴ = 16
m + r + 1 = 7 + 4 + 1 = 12

16 ≥ 12 ✅

Now the condition is satisfied.

Therefore, r = 4 parity bits

20,21,22,23,...

Parity bit positions = 1, 2, 4, 8


3. Calculate the number of host and subnets

Formula

Subnets = 2^(given mask − default mask)

Hosts = 2^(32 − given mask) − 2

Compare with Class Ranges (Remember)

Class First Octet Range Default Subnet Mask


Class A 1 – 126 [Link] (/8)
Class B 128 – 191 [Link] (/16)
Class C 192 – 223 [Link] (/24)
Class D 224 – 239 Multicast
Class E 240 – 255 Experimental

Step 1 : Know Total Bits in IP Address

IPV4 has 32 bit

These bits are divided into: Network bits + Host bits

Example: /24 - means 24 network bits.

Step 2: Find Host Bits

Formula:

Host bits = 32 − Network bits


Host bits = 32 − 24 = 8

Step 3: Calculate Number of Hosts

Formula: number of hosts = 2^(host bits) – 2

Example: 2^8 – 2
= 256 − 2
= 254 hosts

Step 4: Calculate Number of Subnets

Subnet bits = Given mask − Default mask


Default masks:

Class Default Mask


Class A /8
Class B /16
Class C /24

Formula:

Number of subnets = 2^(subnet bits)

Example

IP Address:

[Link] /16

Step 1: Identify class

122 → Class A

Default mask = /8

Step 2: Subnet bits

16 − 8 = 8

Step 3: Subnets

2^8 = 256 subnets

Step 4: Hosts

Host bits = 32 − 16 = 16
2^16 − 2 = 65534 hosts
4. Calculate the number of host and subnets corresponding to the address
[Link]/16

Remember

CIDR Subnet Mask


/8 - [Link]
/16 - [Link]
/24 - [Link]

Given the IP address

[Link]/16

Step 1: Identify the Subnet Mask

/16 means 16 bits are used for network

/16 means first 16 bits are 1.

Subnet mask: [Link]

11111111.11111111.00000000.00000000

Step 2: Find the Class

First number = 122

Class Range
Class A 1 – 126

So this is Class A.

Default mask of Class A: /8

Step 3: Find Subnet Bits

We are using /16, but default was /8.

Extra bits used for subnet:

16 − 8 = 8

So 8 bits are used for subnetting.


Step 4: Number of Subnets

Formula:

Number of subnets = 2^(subnet bits)

2^8
= 256

Number of subnets = 256

Step 5: Number of Hosts (IPV4 has 32 bits)

Total bits in IP address = 32

Network bits = 16

Remaining bits for hosts: 32 − 16 = 16

Formula:

Hosts = 2^(host bits) − 2

= 2^16 − 2
= 65536 − 2
= 65534

Hosts per subnet = 65,534

You might also like