Books Referred:
1. Data Communication & Networking , 4th Edition, B.A. Forouzan
2. Computer Networks, 4th Edition, Andrew S. Tanenbaum
© http://btechdu.blogspot.com/
Qus 1.What are the differences between classful
addressing and classless addressing in IPv4 ?
2
© http://btechdu.blogspot.com/
Classful addressing:
In the classful addressing system all the IP addresses that are available are
divided into the five classes A,B,C,D and E, in which class A,B and C address
are frequently used because class D is for Multicast and is rarely used and
class E is reserved and is not currently used.
Each of the IP address belongs to a particular class that's why they are
classful addresses. Earlier this addressing system did not have any name,but
when classless addressing system came into existence then it is named as
Classful addressing system.
The main disadvantage of classful addressing is that it limited the
flexibility and number of addresses that can be assigned to any device. One
of the major disadvantage of classful addressing is that it does not send
subnet information but it will send the complete network address. The
router will supply its own subnet mask based on its
locally configured subnets. As long as you have the same subnet mask and
the network is contiguous, you can use subnets of a classful network
address.
3
Classful Addressing
© http://btechdu.blogspot.com/
Classless Addressing
0 Classless Addressing: Classless addressing system is also
known as CIDR(Classless Inter-Domain Routing).Classless
addressing is a way to allocate and specify the
Internet addresses used in inter-domain routing more flexibly
than with the original system of Internet Protocol (IP) address
classes. What happened in classful addressing is that if any
company needs more than 254 host machines but far fewer than
the 65,533host addresses then the only option for the company
is to take the class B address .Now suppose company needs only
1000 IP addresses for its host computers then in this (65533-
1000=64533) IP addresses get wasted. For this reason, the
Internet was, until the arrival of CIDR, running out of address
space much more quickly than necessary. CIDR effectively solved
the problem by providing a new and more flexible way to specify
network addresses in routers. A CIDR network address looks like
this:
4
© http://btechdu.blogspot.com/
Classless Addressing
5
© http://btechdu.blogspot.com/
Qus2.List the classes in classful addressing and
define the application of each class(unicast,
multicast or reserve).
6
© http://btechdu.blogspot.com/
0 Unicast may be the saying used to go into detail connection when
a bit of data is mailed derived from one of point to the other
point.
0 Broadcast is the term used to describe communication where a
piece of information is sent from one point to all other points.
0 Multicast is the term used to describe communication where a
piece of information is sent from one or more points to a set of
other points.
Classes A, B, and C are used for unicast communication. Class D is for
multicast communication and Class E addresses are reserved for
special purposes
Qus3 : Explain why most of the addresses in class A are wasted.
Explain why a medium size or large size corporation does not want
a block of class C addresses.
Ans :
Most of the addresses in class A are wasted because a
block in class A address is too large for almost any
organization with a block size of 16,777,216.
A medium size or large size corporation does not
want a block of class C addresses because a block in
class C is probably too small for many organizations
with a block size of 256.
7
© http://btechdu.blogspot.com/
Qus 4: What is a mask in IPv4 addressing? What
is a default mask in IPv4 addressing?
Ans:
A mask is a 32-bit number made of contiguous 1’s
followed by contiguous 0’s and are used to find the
netid, hostid, first address, last address and no. of
addresses.
A default mask refers to the mask when there is no
subnetting or supernetting.
The default masks for classes A,B and C are :
8
© http://btechdu.blogspot.com/
Qus 5 : What is the address space in the
following systems ?
(a) a system with 8-bit addresses
28 = 256
(b) a system with 64- bit addresses
264 = 1.846744737 × 1019
9
© http://btechdu.blogspot.com/
Qus 6: Find the class of the following IP
addresses.
(a) 208.34.54.12
208 in binary : 11010000
As the starting bits of the 1st byte is 110, hence it
belongs to Class C.
(b) 238.34.2.1
238 in binary : 11101110
As the starting bits of the 1st byte is 1110,
hence it belongs to Class D.
10
© http://btechdu.blogspot.com/
Qus 7: Find the class of the following IP
addresses.
(a) 11011111 10110000 00011111 01011101
Since the starting bits of the 1st byte are 110, it
belongs to class C.
(b) 11101111 11110111 11000111 00011101
Since the starting bits of the 1st byte are 1110, it
belongs to class D.
11
© http://btechdu.blogspot.com/
Qus 8 : Find the netid and hostid of the
following IP address.
208.34.54.12
208 in binary : 11010000
Since the starting bits of the 1st byte are110, it belongs
to class C.
Therefore, Netid : 208.34.54.0
Hostid: 0.0.0.12
12
© http://btechdu.blogspot.com/
Qus 9 : An organisation is granted the block
16.0.0.0/8. The administrator wants to create
500 fixed-length subnets.
(a) Find the subnet mask.
Closest power of 2 to 500 is 512 = 29.
Therefore, 9 bits will be used to identify the subnet.
Hence, total bits in masking = 8+9 = 17.
(b) Find the number of addresses in each subnet.
IPv4 has 32 bit addresses. Since 17 bits are used for masking,
the remaining i.e. 32-17 = 15 bits will be used for specifying
addresses.
So, the number of addresses = 215 = 32,768 per subnet.
13
© http://btechdu.blogspot.com/
(c) Find the first and the last addresses in subnet 1.
First address : 00010000 00000000 00000000 00000000
16.0.0.0
Last address : 00010000 00000000 01111111 11111111
16.0.127.255
(d) Find the first and the last addresses in subnet 500.
500 in binary : 111110100
First address : 00010000 11111010 0000000000000000
16.250.0.0
Last address : 00010000 11111010 01111111 11111111
16.250.127.255
14
© http://btechdu.blogspot.com/
Qus 10 : A network on the Internet has a subnet
mask of 255.255.240.0. What is the maximum
number of hosts it can handle?
Ans.
Binary representation is:
11111111 1111111 11111000 00000000
0 Since there are 20 ones, the network part is 20bit
long.
0 There are a total of 32 bits, therefore host part will
have 32-20= 12bits.
2^12 hosts it can handle.
15
© http://btechdu.blogspot.com/
Qus 11 : A large number of consecutive IP addresses are available
starting at 198.16.0.0. Suppose that four organizations A,B,C and D
request 4000,2000,4000 and 8000 addresses respectively and in
that order. For each of these, give the first IP address assigned, the
last IP address assigned, and the mask in the w.x.y.z/s notation.
0 Addresses will be allocated using classless addressing.
Binary representation of 198.16.0.0 is
11000110 00010000 00000000 00000000
(a) For A: Addresses required = 4000 => 4096(212)
First Address: 11000110 00010000 00000000 00000000
198.16.0.0
Last Address: 11000110 00010000 00001111 11111111
198.16.15.255
First address in decimal is 3322937344 which is divisible by 4096.
Since first 20bits remain unchanged, 20bits represent network part and
12bits represent host part.
Therefore, Mask: 255.255.240.0/20
16
© http://btechdu.blogspot.com/
(b) For B: Addresses required= 2000=> 2048(211)
First Address: 11000110 00010000 00010000 00000000
198.16.16.0
Last Address: 11000110 00010000 00010111 11111111
198.16.23.255
First address in decimal is 3322941440 which is divisible by 2048.
Since first 21bits remain unchanged, 21bits represent network part and 11bits
represent host part. Therefore, Mask: 255.255.248.0/21
(c) For C: Addresses required= 4000=> 4096(212)
First Address: 11000110 00010000 00011000 00000000
which in decimal is 3322943488 which is not divisible by 4096. To make it
completely divisible by 4096, we add remainder to 3322943488 which gives
3322945536 which in binary is 11000110 00010000 00100000 00000000.
Therefore, the First Address is: 198.16.32.0
Last Address: 11000110 00010000 00101111 11111111
198.16.47.255
Since first 20bits remain unchanged, 20bits represent network part and 12bits
represent host part.
Therefore, Mask: 255.255.240.0/20 17
© http://btechdu.blogspot.com/
(d) For D: Addresses required=8000=>8192(213)
First Address: 11000110 00010000 00110000 00000000
which in decimal is 3322949632 which is not divisible by
8192. To make it completely divisible by 8192, we add
remainder to 3322949632 which gives 3322953728 which
in binary is 11000110 00010000 01000000 00000000.
Therefore, the First add is: 198.16.64.0
Last Address: 11000110 00010000 01011111 11111111
198.16.95.255
Since first 19 bits remain unchanged, 19 bits represent
network part and 13 bits represent host part.
Therefore, Mask: 255.255.224.0/19
18
© http://btechdu.blogspot.com/
Qus 12 : Write the following masks in slash notation (/n).
a)255.0.0.0
b)255.255.0.0
c)255.255.255.0
d)255.255.240.0
(a) Binary representation :
11111111 00000000 00000000 00000000
Since there are 8 ones, network part contains 8 bits
Therefore slash notation of given mask is
255.0.0.0/8
b) Binary representation:
11111111 11111111 00000000 00000000
Since there are 16 ones, network part contains 16 bits
Therefore slash notation of given mask is
255.255.0.0/16
19
© http://btechdu.blogspot.com/
(c)Binary representation
11111111 11111111 11111111 00000000
Since there are 24 ones, network part contains 24bits
Therefore slash notation of given mask is
255.255.255.0/24
(d) Binary representation
11111111 11111111 11110000 00000000
Since there are 20 ones, network part contains 20bits
Therefore slash notation of given mask is
255.255.240.0/20
20
© http://btechdu.blogspot.com/
Qus 13 : An ISP is granted a block of addresses starting with 150.80.0.0/16. The
ISP wants to distribute these blocks to 2600 customers as follows.
a) The first group has 200 medium-size businesses; each needs 16 addresses.
b) The second group has 400 small businesses; each needs 8 addresses.
c) The third group has 2000 households; each needs 4 addresses.
Design the subblocks and give the slash notation for each subblock. Find out how
many addresses are still available after these allocations.
Since we need to distribute these addresses to 3 groups,
4 subnets are possible
(a) Subnet 1(for Group1)
First address: 10010110 01010000 00000000 00000000/18
150.80.0.0/18
Last address: 10010110 01010000 00111111 11111111/18
150.80.63.255/18
Total addresses possible=2^14=16384
Required addresses for Group 1 =200*16=3200
Unused addresses=16384-3200=13184 …. (1) 21
© http://btechdu.blogspot.com/
(b) Subnet 2(for Group 2)
First address: 10010110 01010000 01000000 00000000/18
150.80.64.0/18
Last address: 10010110 01010000 01111111 11111111/18
150.80.127.255/18
Total addresses possible=2^14=16384
Required addresses for group2=400*8=3200
Unused addresses=16384-3200=13184 …. (2)
(c) Subnet 3(for Group3)
First address: 10010110 01010000 10000000 00000000/18
150.80.128.0/18
Last address: 10010110 01010000 10111111 11111111/18
150.80.191.0/18
Total addresses possible=2^14=16384
Required address for group3=2000*4=8000
Unused addresses=16384-8000=8384 …. (3)
22
© http://btechdu.blogspot.com/
(d) Subnet 4(unused)
First address: 10010110 01010000 11000000 000000/18
150.80.192.0/18
Last address: 10010110 01010000 11111111 11111111/18
150.80.255.255/18
Possible address(unused)=214=16384 …. (4)
Total addresses left available=(1)+(2)+(3)+(4)=51136
23
© http://btechdu.blogspot.com/
Practice Questions
24© http://btechdu.blogspot.com/
Practice Questions
25© http://btechdu.blogspot.com/
© http://btechdu.blogspot.com/

Network Layer Numericals

  • 1.
    Books Referred: 1. DataCommunication & Networking , 4th Edition, B.A. Forouzan 2. Computer Networks, 4th Edition, Andrew S. Tanenbaum © http://btechdu.blogspot.com/
  • 2.
    Qus 1.What arethe differences between classful addressing and classless addressing in IPv4 ? 2 © http://btechdu.blogspot.com/ Classful addressing: In the classful addressing system all the IP addresses that are available are divided into the five classes A,B,C,D and E, in which class A,B and C address are frequently used because class D is for Multicast and is rarely used and class E is reserved and is not currently used. Each of the IP address belongs to a particular class that's why they are classful addresses. Earlier this addressing system did not have any name,but when classless addressing system came into existence then it is named as Classful addressing system. The main disadvantage of classful addressing is that it limited the flexibility and number of addresses that can be assigned to any device. One of the major disadvantage of classful addressing is that it does not send subnet information but it will send the complete network address. The router will supply its own subnet mask based on its locally configured subnets. As long as you have the same subnet mask and the network is contiguous, you can use subnets of a classful network address.
  • 3.
  • 4.
    Classless Addressing 0 ClasslessAddressing: Classless addressing system is also known as CIDR(Classless Inter-Domain Routing).Classless addressing is a way to allocate and specify the Internet addresses used in inter-domain routing more flexibly than with the original system of Internet Protocol (IP) address classes. What happened in classful addressing is that if any company needs more than 254 host machines but far fewer than the 65,533host addresses then the only option for the company is to take the class B address .Now suppose company needs only 1000 IP addresses for its host computers then in this (65533- 1000=64533) IP addresses get wasted. For this reason, the Internet was, until the arrival of CIDR, running out of address space much more quickly than necessary. CIDR effectively solved the problem by providing a new and more flexible way to specify network addresses in routers. A CIDR network address looks like this: 4 © http://btechdu.blogspot.com/
  • 5.
  • 6.
    Qus2.List the classesin classful addressing and define the application of each class(unicast, multicast or reserve). 6 © http://btechdu.blogspot.com/ 0 Unicast may be the saying used to go into detail connection when a bit of data is mailed derived from one of point to the other point. 0 Broadcast is the term used to describe communication where a piece of information is sent from one point to all other points. 0 Multicast is the term used to describe communication where a piece of information is sent from one or more points to a set of other points. Classes A, B, and C are used for unicast communication. Class D is for multicast communication and Class E addresses are reserved for special purposes
  • 7.
    Qus3 : Explainwhy most of the addresses in class A are wasted. Explain why a medium size or large size corporation does not want a block of class C addresses. Ans : Most of the addresses in class A are wasted because a block in class A address is too large for almost any organization with a block size of 16,777,216. A medium size or large size corporation does not want a block of class C addresses because a block in class C is probably too small for many organizations with a block size of 256. 7 © http://btechdu.blogspot.com/
  • 8.
    Qus 4: Whatis a mask in IPv4 addressing? What is a default mask in IPv4 addressing? Ans: A mask is a 32-bit number made of contiguous 1’s followed by contiguous 0’s and are used to find the netid, hostid, first address, last address and no. of addresses. A default mask refers to the mask when there is no subnetting or supernetting. The default masks for classes A,B and C are : 8 © http://btechdu.blogspot.com/
  • 9.
    Qus 5 :What is the address space in the following systems ? (a) a system with 8-bit addresses 28 = 256 (b) a system with 64- bit addresses 264 = 1.846744737 × 1019 9 © http://btechdu.blogspot.com/
  • 10.
    Qus 6: Findthe class of the following IP addresses. (a) 208.34.54.12 208 in binary : 11010000 As the starting bits of the 1st byte is 110, hence it belongs to Class C. (b) 238.34.2.1 238 in binary : 11101110 As the starting bits of the 1st byte is 1110, hence it belongs to Class D. 10 © http://btechdu.blogspot.com/
  • 11.
    Qus 7: Findthe class of the following IP addresses. (a) 11011111 10110000 00011111 01011101 Since the starting bits of the 1st byte are 110, it belongs to class C. (b) 11101111 11110111 11000111 00011101 Since the starting bits of the 1st byte are 1110, it belongs to class D. 11 © http://btechdu.blogspot.com/
  • 12.
    Qus 8 :Find the netid and hostid of the following IP address. 208.34.54.12 208 in binary : 11010000 Since the starting bits of the 1st byte are110, it belongs to class C. Therefore, Netid : 208.34.54.0 Hostid: 0.0.0.12 12 © http://btechdu.blogspot.com/
  • 13.
    Qus 9 :An organisation is granted the block 16.0.0.0/8. The administrator wants to create 500 fixed-length subnets. (a) Find the subnet mask. Closest power of 2 to 500 is 512 = 29. Therefore, 9 bits will be used to identify the subnet. Hence, total bits in masking = 8+9 = 17. (b) Find the number of addresses in each subnet. IPv4 has 32 bit addresses. Since 17 bits are used for masking, the remaining i.e. 32-17 = 15 bits will be used for specifying addresses. So, the number of addresses = 215 = 32,768 per subnet. 13 © http://btechdu.blogspot.com/
  • 14.
    (c) Find thefirst and the last addresses in subnet 1. First address : 00010000 00000000 00000000 00000000 16.0.0.0 Last address : 00010000 00000000 01111111 11111111 16.0.127.255 (d) Find the first and the last addresses in subnet 500. 500 in binary : 111110100 First address : 00010000 11111010 0000000000000000 16.250.0.0 Last address : 00010000 11111010 01111111 11111111 16.250.127.255 14 © http://btechdu.blogspot.com/
  • 15.
    Qus 10 :A network on the Internet has a subnet mask of 255.255.240.0. What is the maximum number of hosts it can handle? Ans. Binary representation is: 11111111 1111111 11111000 00000000 0 Since there are 20 ones, the network part is 20bit long. 0 There are a total of 32 bits, therefore host part will have 32-20= 12bits. 2^12 hosts it can handle. 15 © http://btechdu.blogspot.com/
  • 16.
    Qus 11 :A large number of consecutive IP addresses are available starting at 198.16.0.0. Suppose that four organizations A,B,C and D request 4000,2000,4000 and 8000 addresses respectively and in that order. For each of these, give the first IP address assigned, the last IP address assigned, and the mask in the w.x.y.z/s notation. 0 Addresses will be allocated using classless addressing. Binary representation of 198.16.0.0 is 11000110 00010000 00000000 00000000 (a) For A: Addresses required = 4000 => 4096(212) First Address: 11000110 00010000 00000000 00000000 198.16.0.0 Last Address: 11000110 00010000 00001111 11111111 198.16.15.255 First address in decimal is 3322937344 which is divisible by 4096. Since first 20bits remain unchanged, 20bits represent network part and 12bits represent host part. Therefore, Mask: 255.255.240.0/20 16 © http://btechdu.blogspot.com/
  • 17.
    (b) For B:Addresses required= 2000=> 2048(211) First Address: 11000110 00010000 00010000 00000000 198.16.16.0 Last Address: 11000110 00010000 00010111 11111111 198.16.23.255 First address in decimal is 3322941440 which is divisible by 2048. Since first 21bits remain unchanged, 21bits represent network part and 11bits represent host part. Therefore, Mask: 255.255.248.0/21 (c) For C: Addresses required= 4000=> 4096(212) First Address: 11000110 00010000 00011000 00000000 which in decimal is 3322943488 which is not divisible by 4096. To make it completely divisible by 4096, we add remainder to 3322943488 which gives 3322945536 which in binary is 11000110 00010000 00100000 00000000. Therefore, the First Address is: 198.16.32.0 Last Address: 11000110 00010000 00101111 11111111 198.16.47.255 Since first 20bits remain unchanged, 20bits represent network part and 12bits represent host part. Therefore, Mask: 255.255.240.0/20 17 © http://btechdu.blogspot.com/
  • 18.
    (d) For D:Addresses required=8000=>8192(213) First Address: 11000110 00010000 00110000 00000000 which in decimal is 3322949632 which is not divisible by 8192. To make it completely divisible by 8192, we add remainder to 3322949632 which gives 3322953728 which in binary is 11000110 00010000 01000000 00000000. Therefore, the First add is: 198.16.64.0 Last Address: 11000110 00010000 01011111 11111111 198.16.95.255 Since first 19 bits remain unchanged, 19 bits represent network part and 13 bits represent host part. Therefore, Mask: 255.255.224.0/19 18 © http://btechdu.blogspot.com/
  • 19.
    Qus 12 :Write the following masks in slash notation (/n). a)255.0.0.0 b)255.255.0.0 c)255.255.255.0 d)255.255.240.0 (a) Binary representation : 11111111 00000000 00000000 00000000 Since there are 8 ones, network part contains 8 bits Therefore slash notation of given mask is 255.0.0.0/8 b) Binary representation: 11111111 11111111 00000000 00000000 Since there are 16 ones, network part contains 16 bits Therefore slash notation of given mask is 255.255.0.0/16 19 © http://btechdu.blogspot.com/
  • 20.
    (c)Binary representation 11111111 1111111111111111 00000000 Since there are 24 ones, network part contains 24bits Therefore slash notation of given mask is 255.255.255.0/24 (d) Binary representation 11111111 11111111 11110000 00000000 Since there are 20 ones, network part contains 20bits Therefore slash notation of given mask is 255.255.240.0/20 20 © http://btechdu.blogspot.com/
  • 21.
    Qus 13 :An ISP is granted a block of addresses starting with 150.80.0.0/16. The ISP wants to distribute these blocks to 2600 customers as follows. a) The first group has 200 medium-size businesses; each needs 16 addresses. b) The second group has 400 small businesses; each needs 8 addresses. c) The third group has 2000 households; each needs 4 addresses. Design the subblocks and give the slash notation for each subblock. Find out how many addresses are still available after these allocations. Since we need to distribute these addresses to 3 groups, 4 subnets are possible (a) Subnet 1(for Group1) First address: 10010110 01010000 00000000 00000000/18 150.80.0.0/18 Last address: 10010110 01010000 00111111 11111111/18 150.80.63.255/18 Total addresses possible=2^14=16384 Required addresses for Group 1 =200*16=3200 Unused addresses=16384-3200=13184 …. (1) 21 © http://btechdu.blogspot.com/
  • 22.
    (b) Subnet 2(forGroup 2) First address: 10010110 01010000 01000000 00000000/18 150.80.64.0/18 Last address: 10010110 01010000 01111111 11111111/18 150.80.127.255/18 Total addresses possible=2^14=16384 Required addresses for group2=400*8=3200 Unused addresses=16384-3200=13184 …. (2) (c) Subnet 3(for Group3) First address: 10010110 01010000 10000000 00000000/18 150.80.128.0/18 Last address: 10010110 01010000 10111111 11111111/18 150.80.191.0/18 Total addresses possible=2^14=16384 Required address for group3=2000*4=8000 Unused addresses=16384-8000=8384 …. (3) 22 © http://btechdu.blogspot.com/
  • 23.
    (d) Subnet 4(unused) Firstaddress: 10010110 01010000 11000000 000000/18 150.80.192.0/18 Last address: 10010110 01010000 11111111 11111111/18 150.80.255.255/18 Possible address(unused)=214=16384 …. (4) Total addresses left available=(1)+(2)+(3)+(4)=51136 23 © http://btechdu.blogspot.com/
  • 24.
  • 25.
  • 26.