You are on page 1of 23

ASSIGNMENT-3 STD ID – 1168891

Q1)
To convert IP addresses from dotted-decimal notation to binary notation, you can represent each
decimal number in its 8-bit binary form. Here are the conversions for the provided IP addresses:

a. 114.34.2.8

114 in binary: 01110010

34 in binary: 00100010

2 in binary: 00000010

8 in binary: 00001000

Hence the Binary representation of given number is : 01110010.00100010.00000010.00001000

b. 129.14.6.8

129 in binary: 10000001

14 in binary: 00001110

6 in binary: 00000110

8 in binary: 00001000

Hence the Binary representation of given number is: 10000001.00001110.00000110.00001000

c. 208.34.54.12

208 in binary: 11010000

34 in binary: 00100010

54 in binary: 00110110

12 in binary: 00001100

Hence the Binary representation of given number is: 11010000.00100010.00110110.00001100


d. 238.34.2.1

238 in binary: 11101110

34 in binary: 00100010

2 in binary: 00000010

1 in binary: 00000001

Hence the Binary representation of given number is: 11101110.00100010.00000010.00000001

These are the binary representations of the given IP addresses.

Q2)
To convert IP addresses from hexadecimal notation to binary notation, you need to represent each
hexadecimal digit as its 4-bit binary equivalent. Here are the conversions for the provided hexadecimal IP
addresses:

a. 0x1347FEAB

1 in binary: 0001

3 in binary: 0011

4 in binary: 0100

7 in binary: 0111

F in binary: 1111

E in binary: 1110

A in binary: 1010

B in binary: 1011

Hence the Binary representation of given number is: 00010011010001111111111010101011

b. 0xAB234102
A in binary: 1010

B in binary: 1011

2 in binary: 0010

3 in binary: 0011

4 in binary: 0100

1 in binary: 0001

0 in binary: 0000

2 in binary: 0010

Hence the Binary representation of given number is: 10101011001000110010000000000010

c. 0x0123A2BE

0 in binary: 0000

1 in binary: 0001

2 in binary: 0010

3 in binary: 0011

A in binary: 1010

2 in binary: 0010

B in binary: 1011

E in binary: 1110

Hence the Binary representation of given number is: 00000001001000111010101010111110

d. 0x00001111

0 in binary: 0000

0 in binary: 0000

0 in binary: 0000

0 in binary: 0000

1 in binary: 0001
1 in binary: 0001

1 in binary: 0001

1 in binary: 0001

Hence the Binary representation of given number is: 00000000000000010001000100010001

These are the binary representations of the given hexadecimal IP addresses. Note that the "0x" prefix is
used to indicate that the numbers are in hexadecimal notation and should be ignored in the binary
conversion

Q3)
IP Address: 01111111 11110000 01100111 01111101
Divide the binary number into 4 sets of 8 bits each.
Convert each set of 8 bits to its decimal equivalent.
The sets in decimal form are: 127, 240, 103, and 125.
Combine them with dots to get the dotted-decimal notation: 127.240.103.125

IP Address: 10101111 11000000 11111000 00011101


Divide the binary number into 4 sets of 8 bits each.
Convert each set of 8 bits to its decimal equivalent.
The sets in decimal form are: 175, 192, 248, and 29.
Combine them with dots to get the dotted-decimal notation: 175.192.248.29

IP Address: 11011111 10110000 00011111 01011101


Divide the binary number into 4 sets of 8 bits each.
Convert each set of 8 bits to its decimal equivalent.
The sets in decimal form are: 223, 176, 31, and 93.
Combine them with dots to get the dotted-decimal notation: 223.176.31.93
IP Address: 11101111 11110111 11000111 00011101
Divide the binary number into 4 sets of 8 bits each.
Convert each set of 8 bits to its decimal equivalent.
The sets in decimal form are: 239, 247, 199, and 29.
Combine them with dots to get the dotted-decimal notation: 239.247.199.29

Q4)
To determine the class of an IP address, We need to examine the first few bits of
the binary representation of the address. The class is determined by the leading
bits in the binary address. Here are the classes for the provided binary IP
addresses:

11110111 11110011 10000111 11011101

The first 4 bits (1111) indicate Class E, which is reserved and not used for regular
IP addresses.
10101111 11000000 11110000 00011101

The first 4 bits (1010) indicate Class A.


11011111 10110000 00011111 01011101

The first 4 bits (1101) indicate Class D, which is reserved for multicast groups.
11101111 11110111 11000111 00011101
The first 4 bits (1110) indicate Class E, which is reserved and not used for regular
IP addresses.
So, for the given IP addresses:

The second address belongs to Class A.


The third address belongs to Class D (reserved for multicast groups).
The first and fourth addresses belong to Class E, which is reserved and not used
for regular IP addresses.

Q5)
To perform a bitwise NOT operation on each of these IP addresses, we need to
convert each decimal number in the IP address to its binary representation and
then apply the NOT operation to each binary digit. Here are the results:

NOT (22.14.70.34):
Binary Representation: 00010110.00001110.01000110.00100010
NOT Operation: 11101001.11110001.10111001.11011101

NOT (145.36.12.20):
Binary Representation: 10010001.00100100.00001100.00010100
NOT Operation: 01101110.11011011.11110011.11101011

NOT (200.7.2.0):
Binary Representation: 11001000.00000111.00000010.00000000
NOT Operation: 00110111.11111000.11111101.11111111
NOT (11.20.255.255):
Binary Representation: 00001011.00010100.11111111.11111111
NOT Operation: 11110100.11101011.00000000.00000000

Q6)
To perform bitwise OR operations on these IP addresses, WE NEED TO
convert them to binary notation and then apply the OR operation bit by
bit.

Let's perform the bitwise OR operations for the Given IP addresses:

(22.14.70.34) OR (255.255.0.0)

Convert the IP addresses to binary:


22.14.70.34 in binary: 00010110.00001110.01000110.00100010
255.255.0.0 in binary: 11111111.11111111.00000000.00000000
Perform the bitwise OR operation:
Result: 11111111.11111111.01000110.00100010
Convert the result back to decimal: 255.255.70.34
(12.11.60.12) OR (255.0.0.Q)
It's not possible to perform this operation because "Q" is not a valid
binary digit.
(14.110.160.12) OR (255.200.140.0)

Convert the IP addresses to binary:


14.110.160.12 in binary: 00001110.01101110.10100000.00001100
255.200.140.0 in binary: 11111111.11001000.10001100.00000000
Perform the bitwise OR operation:
Result: 11111111.11101110.10101100.00001100
Convert the result back to decimal: 255.238.172.12
(28.14.40.100) OR (255.128.100.Q)

It's not possible to perform this operation because "Q" is not a valid
binary digit.

Q7)
To determine the subnet address and the last address in a Class B subnet given
the IP address and subnet mask, follow these steps:

Convert the IP address and subnet mask to binary form.

IP Address: 131.134.112.66 in binary is:


10000011.10000110.01110000.01000010
Subnet Mask: 255.255.224.0 in binary is:
11111111.11111111.11100000.00000000

Perform a bitwise AND operation between the IP address and the subnet mask to
find the subnet address:

Subnet Address = IP Address AND Subnet Mask

Subnet Address in binary:


10000011.10000110.01100000.00000000

Convert the binary subnet address back to decimal form:

Subnet Address in decimal:


131.134.96.0

So, the subnet address is 131.134.96.0.

To find the last address, consider that the subnet address represents the first
address in the subnet. The last address in the subnet is the highest address within
the range.

In a Class B subnet with a subnet mask of 255.255.224.0 (or /19 in CIDR notation),
the total number of possible addresses in the subnet is 2^13 = 8192 addresses.
However, the first and last addresses are reserved, leaving 8190 usable addresses.
So, to find the last address, add 8190 to the subnet address:

Last Address = Subnet Address + 8190

Last Address in decimal:


131.134.127.255

The first address (subnet address) is 131.134.96.0, and the last address is
131.134.127.255.

Q8)
To calculate the subnet mask for each of the given scenarios, we need to
determine how many bits are borrowed for subnetting.

24 Subnets in Class A:
To create 24 subnets, we need to borrow enough bits from the host portion of the
Class A address to accommodate 24 subnets. Since 2^3 = 8 and 2^4 = 16, you'll
need 4 bits for subnetting to have more than 24 subnets.

Class A default subnet mask: 255.0.0.0 (8 bits for the network portion)

To create 24 subnets, we need to change the subnet mask to include 4 bits for
subnetting:

Subnet Mask: 255.240.0.0 (The first 4 bits of the second octet are set to 1,
indicating the subnet portion).
256 Subnets in Class B:
To create 256 subnets, we need to borrow enough bits from the host portion of
the Class B address to accommodate 256 subnets. Since 2^8 = 256, we'll need 8
bits for subnetting.

Class B default subnet mask: 255.255.0.0 (16 bits for the network portion)

To create 256 subnets, we need to change the subnet mask to include 8 bits for
subnetting:

Subnet Mask: 255.255.255.0 (The last octet is all 1s, indicating the subnet
portion).

32 Subnets in Class C:
To create 32 subnets, we need to borrow enough bits from the host portion of the
Class C address to accommodate 32 subnets. Since 2^5 = 32, we'll need 5 bits for
subnetting.

Class C default subnet mask: 255.255.255.0 (24 bits for the network portion)

To create 32 subnets, we need to change the subnet mask to include 5 bits for
subnetting:

Subnet Mask: 255.255.255.224 (The last 3 bits of the last octet are set to 1,
indicating the subnet portion).
4 Subnets in Class C:
To create 4 subnets, we need to borrow enough bits from the host portion of the
Class C address to accommodate 4 subnets. Since 2^2 = 4, we'll need 2 bits for
subnetting.

Class C default subnet mask: 255.255.255.0 (24 bits for the network portion)

To create 4 subnets, we need to change the subnet mask to include 2 bits for
subnetting:

Subnet Mask: 255.255.255.192 (The last 2 bits of the last octet are set to 1,
indicating the subnet portion).

These subnet masks will allow us to create the specified number of subnets in
each class.

Q9)
To find the first address (network address) and the last address (limited
broadcast address) in the given block of IP addresses (182.44.82.16/26), we need
to determine the network address and the range of addresses within the /26
subnet.

A /26 subnet means that the first 26 bits of the address are the network portion,
and the remaining bits are for hosts. In this case, the first 26 bits are fixed, and we
have 6 bits for host addresses within this subnet.

Let's calculate the network address and the range of host addresses:
Network Address:
The network address can be obtained by setting all host bits to 0 within the /26
subnet.

IP Address: 182.44.82.16 in binary:


10110110.00101100.01010010.0001 0000

Since this is a /26 subnet, the host bits (the last 6 bits) are all 0:

Network Address: 182.44.82.16

Last Address (Limited Broadcast Address):


The last address in the subnet is used for the limited broadcast address. To find it,
set all host bits to 1 within the /26 subnet.

IP Address: 182.44.82.16 in binary:


10110110.00101100.01010010.0001 0000

Set all host bits to 1:

Limited Broadcast Address: 182.44.82.63

So, in the block of addresses represented by 182.44.82.16/26, the first address


(network address) is 182.44.82.16, and the last address (limited broadcast
address) is 182.44.82.63.
Q10)

Find the subnet mask:


To create 32 subnets, we need to borrow enough bits for subnetting. In this case,
we need to borrow 5 bits because 2^5 = 32.

The original subnet mask for /24 is 255.255.255.0 in dotted-decimal notation. To


create 32 subnets, change the subnet mask to include the borrowed 5 bits:

Subnet Mask for 32 Subnets: 255.255.255.248 in dotted-decimal notation (or /29


in CIDR notation).

Find the number of addresses in each subnet:


With a subnet mask of /29, each subnet will have 2^3 = 8 addresses.

Find the first and last address in the first subnet (subnet 1):

Subnet Address: 211.17.180.0 (Network Address)


First Usable Address: 211.17.180.1
Last Usable Address: 211.17.180.6
Broadcast Address: 211.17.180.7 (Limited Broadcast)
Find the first and last address in the last subnet (subnet 32):

Subnet Address: 211.17.180.248 (Network Address)


First Usable Address: 211.17.180.249
Last Usable Address: 211.17.180.254
Broadcast Address: 211.17.180.255 (Limited Broadcast)
Hence,
Subnet Mask for 32 Subnets: 255.255.255.248 or /29
Number of Addresses in Each Subnet: 8
First Address in the First Subnet: 211.17.180.0
Last Address in the First Subnet: 211.17.180.7
First Address in the Last Subnet (Subnet 32): 211.17.180.248
Last Address in the Last Subnet (Subnet 32): 211.17.180.255
Each subnet will have 8 addresses, and we have successfully divided the
original /24 block into 32 subnets as requested.

Q11)
To find the range of addresses in each of the provided IP address blocks with
their corresponding subnet masks, we need to identify the network address, first
usable address, last usable address, and the broadcast address for each block.
Let's calculate the ranges for each block:

123.56.77.32/29:

Subnet Mask: 255.255.255.248 (/29 in CIDR notation)


Number of Addresses in the Subnet: 2^3 = 8 addresses
Subnet Increment: 256 - 248 = 8
Calculations:

Network Address: 123.56.77.32 (base address)


First Usable Address: 123.56.77.33
Last Usable Address: 123.56.77.38
Broadcast Address: 123.56.77.39
Range: 123.56.77.32 - 123.56.77.39

200.17.21.128/27:

Subnet Mask: 255.255.255.224 (/27 in CIDR notation)


Number of Addresses in the Subnet: 2^5 = 32 addresses
Subnet Increment: 256 - 224 = 32
Calculations:

Network Address: 200.17.21.128 (base address)


First Usable Address: 200.17.21.129
Last Usable Address: 200.17.21.158
Broadcast Address: 200.17.21.159
Range: 200.17.21.128 - 200.17.21.159

17.34.16.0/23:

Subnet Mask: 255.255.254.0 (/23 in CIDR notation)


Number of Addresses in the Subnet: 2^9 = 512 addresses
Subnet Increment: 256 - 254 = 2
Calculations:
Network Address: 17.34.16.0 (base address)
First Usable Address: 17.34.16.1
Last Usable Address: 17.34.17.254
Broadcast Address: 17.34.17.255
Range: 17.34.16.0 - 17.34.17.255

180.34.64.64/30:

Subnet Mask: 255.255.255.252 (/30 in CIDR notation)


Number of Addresses in the Subnet: 2^2 = 4 addresses
Subnet Increment: 256 - 252 = 4
Calculations:

Network Address: 180.34.64.64 (base address)


First Usable Address: 180.34.64.65
Last Usable Address: 180.34.64.66
Broadcast Address: 180.34.64.67
Range: 180.34.64.64 - 180.34.64.67

These are the ranges of addresses for each of the provided IP address blocks with
their corresponding subnet masks.
Q12)
Yes, in classless addressing (CIDR), we can find the prefix length (subnet mask)
when we know the first address and the number of addresses in the block. To find
the prefix length, we need to calculate how many bits are required to represent
the range of addresses in the block.

Find the Range of Addresses:


Subtract the first address from the last address in the block to find the total
number of addresses in the block.
Determine how many bits are required to represent the number of addresses
found in step 1. You can do this by finding the smallest power of 2 that is equal to
or greater than the number of addresses. The number of bits required will be the
exponent in the power of 2.

Find the Prefix Length:


The prefix length is the number of bits required from step 2. It represents the
subnet mask in CIDR notation.

Example:
Let us consider we have a block of addresses, and we know the first address is
192.168.1.0 and there are 32 addresses in the block.

Find the Range of Addresses:

First Address: 192.168.1.0


Last Address: Since there are 32 addresses, the last address is 192.168.1.31.
Calculate the Number of Bits Required:
To represent 32 addresses, we need at least 5 bits (since 2^5 = 32).

Find the Prefix Length:


The prefix length is 32 - 5 = 27 bits.

So, the prefix length for this block of addresses is /27 in CIDR notation, and the
subnet mask would be 255.255.255.224 in dotted-decimal notation.

In summary, you can find the prefix length in classless addressing when you know
the first address and the number of addresses in the block by calculating how
many bits are required to represent the address range.

Q13)
To distribute the block of addresses 150.80.0.0/16 to the ISP's 2600 customers,
taking into account the requirements of each customer group, we can design
subblocks as follows:

First Group (200 Medium-Size Businesses):

Each business needs approximately 128 addresses.


To accommodate 200 businesses, you would need 200 * 128 = 25,600 addresses.
Allocate a /15 block (150.80.0.0/15) for this group.
This provides 32,768 addresses (2^15) in total.
Addresses available after allocation: 32,768 - 25,600 = 7,168 addresses.
Second Group (400 Small Businesses):
Each small business needs approximately 16 addresses.
To accommodate 400 small businesses, you would need 400 * 16 = 6,400
addresses.
Allocate a /16 block (150.80.128.0/16) for this group.
This provides 65,536 addresses (2^16) in total.
Addresses available after allocation: 65,536 - 6,400 = 59,136 addresses.
Third Group (2000 Households):

Each household needs approximately 4 addresses.


To accommodate 2000 households, you would need 2000 * 4 = 8,000 addresses.
Allocate a /19 block (150.80.192.0/19) for this group.
This provides 8,192 addresses (2^19) in total.
Addresses available after allocation: 8,192 - 8,000 = 192 addresses.
So, here are the subblocks and their slash notation:

First Group: 150.80.0.0/15


Second Group: 150.80.128.0/16
Third Group: 150.80.192.0/19
After allocating addresses to these groups, we still have 7,168 + 59,136 + 192 =
66,496 addresses available in the original /16 block (150.80.0.0/16).

Q14)
To distribute the block of addresses 120.60.4.0/20 to 100 organizations, with
each organization receiving only 8 addresses, we can design subblocks as follows:
Allocate a /28 Block for Each Organization:
Each organization receives 8 addresses, which can be represented with a /28
subnet.
A /28 subnet provides 16 addresses (2^4), with 14 usable addresses after
considering the network and broadcast addresses.
Allocate a /28 block for each organization.
Now, calculate the number of /28 blocks needed for 100 organizations:

100 organizations * 1 /28 block per organization = 100 /28 blocks

To calculate the slash notation for each subblock, we need to determine the
starting address for each block, which increases sequentially. Starting with
120.60.4.0/20, you can allocate as follows:

Organization 1: 120.60.4.0/28
Organization 2: 120.60.4.16/28
Organization 3: 120.60.4.32/28
...
Organization 100: 120.60.4.384/28
After allocating addresses to these 100 organizations, we have used 100 * /28
blocks, which equals a /23 block (100 * 16 = 1600 addresses). So, the remaining
addresses in the original /20 block are:

Remaining Addresses = Total Addresses in /20 - Addresses Used in /23


Remaining Addresses = 2^(32-20) - 2^(32-23)
Remaining Addresses = 2^12 - 2^9
Remaining Addresses = 4096 - 512
Remaining Addresses = 3584 addresses

So, we have 3,584 addresses still available in the original /20 block (120.60.4.0/20)
after allocating addresses to the 100 organizations.

Q15)
No, the ISP does not need subnetting in this case. Subnetting is typically used to
divide a larger block of IP addresses into smaller subnets to efficiently manage and
allocate addresses to different network segments or customers.

In your scenario, the ISP already has a block of 1024 addresses, which is exactly
the number of addresses needed for 1024 customers. Since there is a one-to-one
correspondence between the number of available addresses and the number of
customers, there is no need for further subdivision through subnetting.

Subnetting becomes necessary when we want to allocate addresses to different


segments of your network, each with its own subnet, or when we have more
addresses than customers and want to optimize address allocation and usage. In
this case, the ISP already has a perfectly sized block of addresses for its customer
base, so subnetting is not required. Each customer can be assigned a unique IP
address from the existing block.

You might also like