Sei sulla pagina 1di 5

Test 2 Questions to be used

Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router’s routing table has the
following entries:
Prefix Output Interface Identifier
131.16.0.0/12 3
131.28.0.0/14 5
131.19.0.0/16 2
131.22.0.0/15 1
The identifier of the output interface on which this packet will be forwarded is ______.

Ans: 1

In this question, we need to find out Netmask for each entry and BITWISE AND with given packet
address, whichever equals the Netid, is the ans. Ex. 1st entry in table: 131.16.0.0/12. its MASK is first
12 bits of network(they are all 1) and remaining 20 bits of host(they are all 0). so MASK is 255.240.0.0
AND 131.23.151.76 = 131.16.0.0. Last entry is 131.22.0.0/15 MASK--->255.254.0.0 AND
131.23.151.76 = 131.22.0.0. Two ans coming interfaces 1,3. Longest Prefix Matching is used to
decide among two. When one destination address matches more than one forwarding table entry.
The most specific of the matching table entries is used as the interface. The interface 1 has the
longest matching prefix with the input IP address. Therefore 1 is chosen.

An IP router with a Maximum Transmission Unit (MTU) of 1500 bytes has received an IP packet of
size 4404 bytes with an IP header of length 20 bytes. The values of the relevant fields in the header of
the third IP fragment generated by the router for this packet are

ans: MF bit: 0, Datagram Length: 1444; Offset: 370

Number of packet fragments = ⌈ (total size of packet)/(MTU) ⌉

= ⌈ 4404/1500 ⌉

= ⌈ 2.936 ⌉

= 3

So Datagram with data 4404 byte fragmented into 3 fragments.

The first frame carries bytes 0 to 1479 (because MTU is 1500 bytes and HLEN is 20 byte so the total
bytes in fragments is maximum 1500-20=1478). the offset for this datagram is 0/8 = 0. The second
fragment carries byte 1480 to 2959. The offset for this datagram is 1480/8 = 185.finally the third
fragment carries byte 2960 to 4404.the offset is 370.and for all fragments except last one the M bit is
1.so in the third bit M is 0..

Two computers C1 and C2 are configured as follows. C1 has IP address 203.197.2.53 and netmask
255.255.128.0. C2 has IP address 203.197.75.201 and netmask 255.255.192.0. C1 assumes C2 is on
same network, but C2 assumes C1 is on a different network. Why?

Network Id of C1 = bitwise '&' of IP of C1 and subnet mask of C1

= (203.197.2.53) & (255.255.128.0)

= 203.197.0.0
C1 sees network ID of C2 as bitwise '&' of IP of C2 and subnet mask of C1

= (203.197.75.201) & (255.255.128.0)


= 203.197.0.0

which is same as Network Id of C1.

Network Id of C2 = bitwise '&' of IP of C2 and subnet mask of C2

= (203.197.75.201) & (255.255.192.0)

= 203.197.64.0

C2 sees network ID of C1 as bitwise '&' of IP of C1 and subnet mask of C2

= (203.197.2.53) & (255.255.192.0)

= 203.197.0.0

which is different from Network Id of C2.

If a Company require 60 hosts then What is the best possible subnet mask?

255.255.255.192

Number of host = 2 ^ n - 2 , where n is number of host bits. 2^n - 2 = 60 Solving for n, n is


approximate equal 6, so 6 host bits are enough . So desired subnet mask is
11111111.11111111.11111111.11000000 255.255.255.192

In class C , if subnet mask is 255.255.255.224 then calculates number of subnet?

Default subnet mask of class C is 255.255.255.0. In subnetting Number of bits are borrowed from
host bits. Given Subnet mask 11111111.11111111.11111111.11100000 4 bits are borrowed form
host bits as default subnet mask is 11111111.11111111.11111111.00000000 Number of Subnets =
2^n -2 , n is number of bits borrowed from host bits i.e 3 = 6 subnets possible.

A subnet has been assigned a subnet mask of 255.255.255.192. What is the maximum number of
hosts that can belong to this subnet?

62
A company has a class C network address of 204.204.204.0. It wishes to have three subnets, one
with 100 hosts and two with 50 hosts each. Which one of the following options represents a feasible
set of subnet address/subnet mask pairs?

Now, let's come back to the question: Here, company has class C address of
204.204.204.0(11001100.11001100.11001100.00000000), 1-24 bits are identifying the network. So,
network has IP addresses from 204.204.204.0 to 204.204.204.255. ->Subnetting is a practice in which
we can divide the network in two or more parts. For this we will have to borrow few bits from the hosts
part. -> In subnet mask, all network + subnetwork bits are 1 and host bits are 0.
Option (A)

204.204.204.128/255.255.255.192

204.204.204.0/255.255.255.128

204.204.204.64/255.255.255.128

1) 11001100.11001100.11001100.10000000/11111111.11111111.11111111.11000000 Network bits-


26 (as 26 bits are 1 in the subnet mask) so sub-network id = 204.204.204.128 (refer(2)) 6 bits '0' in
subnet mask,i.e. 64(i.e. 2^6) -2 = 62 hosts (refer (1) ) 2)
11001100.11001100.11001100.00000000/11111111.11111111.11111111.10000000 Network bits-25
(as 25 bits are 1 in the subnet mask) so sub-network id = 204.204.204.0 (refer(2)) 7 bits '0' in subnet
mask,i.e. 128(i.e.2^7) -2 =126 hosts (refer (1) ) 3)
11001100.11001100.11001100.01000000/11111111.11111111.11111111.10000000 Network bits-25
(as 25 bits are 1 in the subnet mask) so sub-network id = 204.204.204.0 ( refer(2)) 7 bits '0' in subnet
mask,i.e. 128(i.e.2^7) -2 = 126 hosts (refer (1) ) Though the networks are divided into subnets
containing 62,126,126 hosts which satisfy our minimum criteria of 50,50,100. But, two subnets have
same network ID thus,they are not different.Thus,this division is only of two subnets but we need 3 ,so
A option is incorrect.
Option (B)

204.204.204.0/255.255.255.192

204.204.204.192/255.255.255.128

204.204.204.64/255.255.255.128

1) 11001100.11001100.11001100.00000000/11111111.11111111.11111111.11000000 Network bits-


26 (as 26 bits are 1 in the subnet mask) so sub-network id = 204.204.204.0 (refer(2)) 6 bits '0' in
subnet mask,i.e. 64(i.e. 2^6)-2=62 hosts (refer (1)) 2)
11001100.11001100.11001100.11000000/11111111.11111111.11111111.10000000 Network bits-25
(as 25 bits are 1 in the subnet mask) so sub-network id = 204.204.204.128 (refer(2)) 7 bits '0' in
subnet mask,i.e. 128(i.e.2^7)-2=126 hosts (refer (1)) 3)
11001100.11001100.11001100.01000000/11111111.11111111.11111111.10000000 Network bits-25
(as 25 bits are 1 in the subnet mask) so sub-network id = 204.204.204.0 (refer(2)) 7 bits '0' in subnet
mask,i.e. 128(i.e.2^7)-2=126 hosts (refer (1)) Though the networks are divided into subnets
containing 62,126,126 hosts which satisfy our minimum criteria of 50,50,100. But, two subnets have
same network ID thus,they are not different.Thus,this division is only of two subnets.
Option (C)

204.204.204.128/255.255.255.128

204.204.204.192/255.255.255.192

204.204.204.224/255.255.255.192

1) 11001100.11001100.11001100.10000000/11111111.11111111.11111111.10000000 Network bits-


25 (as 25 bits are 1 in the subnet mask) so sub-network id == 204.204.204.128 (refer(2)) 7 bits '0' in
subnet mask,i.e. 128(i.e. 2^7) -2 =126 hosts (refer 1) 2)
11001100.11001100.11001100.11000000/11111111.11111111.11111111.11000000 Network bits-26
(as 25 bits are 1 in the subnet mask) so sub-network id == 204.204.204.192 (refer(2)) 6 bits '0' in
subnet mask,i.e. 64(i.e.2^6)-2=62 hosts(refer 1) 3)
11001100.11001100.11001100.11110000/11111111.11111111.11111111.11000000 Network bits-26
(as 26 bits are 1 in the subnet mask) so sub-network id == 204.204.204.192 (refer (2)) 6 bits '0' in
subnet mask,i.e. 64(i.e.2^6) -2=62 hosts (refer 1) Though the networks are divided into subnets
containing 62,62,126 hosts which satisfy our minimum criteria of 50,50,100. But, two subnets have
same network ID thus,they are not different.Thus,this division is only of two subnets.
Option (D)

204.204.204.128/255.255.255.128

204.204.204.64/255.255.255.192

204.204.204.0/255.255.255.192

1) 11001100.11001100.11001100.10000000/11111111.11111111.11111111.10000000 --> Network


bits-25 (as 25 bits are 1 in the subnet mask) so sub-network id == 204.204.204.128 (refer(2)) 7 bits '0'
in subnet mask,i.e. 128(i.e. 2^7)-2=126 hosts (refer(1)) 2)
11001100.11001100.11001100.01000000/11111111.11111111.11111111.11000000 --> Network
bits-26 (as 25 bits are 1 in the subnet mask) so sub-network id == 204.204.204.64 (refer(2)) 6 bits '0'
in subnet mask,i.e. 64(i.e.2^6)-2=62 hosts (refer(1)) 3)
11001100.11001100.11001100.00000000/11111111.11111111.11111111.11000000 --> Network
bits-26 (as 26 bits are 1 in the subnet mask) so sub-network id == 204.204.204.0 (refer(2)) 6 bits '0' in
subnet mask,i.e. 64(i.e.2^6)-2=62 host bits (refer(1)) This satisfies the minimum criteria of 50,50 and
100 hosts and all subnet IDs are different .Thus,option D is correct. This explanation is provided
by Shashank Shanker.

An IP datagram of size 1000 bytes arrives at a router. The router has to forward this packet on a link
whose MTU (maximum transmission unit) is 100 bytes. Assume that the size of the IP header is 20
bytes. The number of fragments that the IP datagram will be divided into for transmission is :

ans:13

MTU = 100 bytes Size of IP header = 20 bytes So, size of data that can be transmitted in one
fragment = 100 - 20 = 80 bytes Size of data to be transmitted = Size of datagram - size of header =
1000 - 20 = 980 bytes Now, we have a datagram of size 1000 bytes. So, we need ceil(980/80) = 13
fragments. Thus, there will be 13 fragments of the datagram. So, D is the correct choice.

Host X has IP address 192.168.1.97 and is connected through two routers R1 and R2 to another host
Y with IP address 192.168.1.80. Router R1 has IP addresses 192.168.1.135 and 192.168.1.110. R2
has IP addresses 192.168.1.67 and 192.168.1.155. The netmask used in the network is
255.255.255.224.
Given the information above, how many distinct subnets are guaranteed to already exist in the
network?

ans: 3

Given IP addresses are of Class C


default Mask for class C = 24
Here given mask is 11 bits ( 11111111 11111111 11111111 11100000)
subnet ID: 3 bits
existing subnets: 011, 010 and 100