50 Computer Networks MCQs with Answers

  • Last Updated : 23 Feb, 2022

Question 1
Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many times each packet has to visit the network layer and the data link layer during a transmission from S to D. gatecs20136
A
Network layer – 4 times and Data link layer – 4 times
B
Network layer – 4 times and Data link layer – 3 times
C
Network layer – 4 times and Data link layer – 6 times
D
Network layer – 2 times and Data link layer – 6 times
Network Layer    50 Computer Networks MCQs with Answers    
Discuss it


Question 1 Explanation: 
Router is a network layer device. See the following diagram : Figure6_1 So every packet passes twice through data link layer of every intermediate router.
Question 2
The protocol data unit (PDU) for the application layer in the Internet stack is
A
Segment
B
Datagram
C
Message
D
Frame
Application Layer    50 Computer Networks MCQs with Answers    
Discuss it


Question 2 Explanation: 
The Protocol Data Unit  is the unit of communication at a particular layer.
 The Layer 1 (Physical Layer) PDU is the bit or, more generally, symbol 
 The Layer 2 (Data Link Layer) PDU is the frame.
 The Layer 3 (Network Layer) PDU is the packet.
 The Layer 4 (Transport Layer) PDU is the segment
              for TCP or the datagram for UDP.
 The Layer 5 (Application Layer) PDU is the data or message.
Question 3
Consider a source computer(S) transmitting a file of size 106 bits to a destination computer(D)over a network of two routers (R1 and R2) and three links(L1, L2, and L3). L1connects S to R1; L2 connects R1 to R2; and L3 connects R2 to D.Let each link be of length 100 km. Assume signals travel over each link at a speed of 108 meters per second.Assume that the link bandwidth on each link is 1Mbps. Let the file be broken down into 1000 packets each of size 1000 bits. Find the total sum of transmission and propagation delays in transmitting the file from S to D?
A
1005 ms
B
1010 ms
C
3000 ms
D
3003 ms
GATE CS 2012    Network Layer    50 Computer Networks MCQs with Answers    
Discuss it


Question 4
Consider a network with five nodes, N1 to N5, as shown below. GATECS2011Q51 The network uses a Distance Vector Routing protocol. Once the routes have stabilized, the distance vectors at different nodes are as following. N1: (0, 1, 7, 8, 4) N2: (1, 0, 6, 7, 3) N3: (7, 6, 0, 2, 6) N4: (8, 7, 2, 0, 4) N5: (4, 3, 6, 4, 0) Each distance vector is the distance of the best known path at the instance to nodes, N1 to N5, where the distance to itself is 0. Also, all links are symmetric and the cost is identical in both directions. In each round, all nodes exchange their distance vectors with their respective neighbors. Then all nodes update their distance vectors. In between two rounds, any change in cost of a link will cause the two incident nodes to change only that entry in their distance vectors. 52. The cost of link N2-N3 reduces to 2(in both directions). After the next round of updates, what will be the new distance vector at node, N3.
A
(3, 2, 0, 2, 5)
B
(3, 2, 0, 2, 6)
C
(7, 2, 0, 2, 5)
D
(7, 2, 0, 2, 6)
GATE CS 2011    Network Layer    50 Computer Networks MCQs with Answers    
Discuss it


Question 4 Explanation: 
Question 5
Consider the data given in above question. Suppose the weights of all unused links in the previous question are changed to 2 and the distance vector algorithm is used again until all routing tables stabilize. How many links will now remain unused?
A
0
B
1
C
2
D
3
GATE CS 2010    Network Layer    50 Computer Networks MCQs with Answers    
Discuss it


Question 5 Explanation: 
Question 6
What is the maximum size of data that the application layer can pass on to the TCP layer below?
A
A
B
B
C
C
D
D
GATE CS 2008    Application Layer    50 Computer Networks MCQs with Answers    
Discuss it


Question 6 Explanation: 
The default TCP Maximum Segment Size is 536. Where a host wishes to set the maximum segment size to a value other than the default, the maximum segment size is specified as a TCP option, initially in the TCP SYN packet during the TCP handshake. Because the maximum segment size parameter is controlled by a TCP option, a host can change the value in any later segment.
Question 7
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 ______.
A
1
B
2
C
3
D
5
GATE-CS-2014-(Set-3)    Network Layer    50 Computer Networks MCQs with Answers    
Discuss it


Question 7 Explanation: 
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.
Question 8
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. which one of the following statements is true?
A
C1 and C2 both assume they are on the same network
B
C2 assumes C1 is on same network, but C1 assumes C2 is on a different network
C
C1 assumes C2 is on same network, but C2 assumes C1 is on a different network
D
C1 and C2 both assume they are on different networks.
GATE-CS-2006    Network Layer    50 Computer Networks MCQs with Answers    
Discuss it


Question 8 Explanation: 
Question 9
Suppose that everyone in a group of N people wants to communicate secretly with the N–1 others using symmetric key cryptographic system. The communication between any two persons should not be decodable by the others in the group. The number of keys required in the system as a whole to satisfy the confidentiality requirement is
A
2N
B
N(N – 1)
C
N(N – 1)/2
D
(N – 1)2
GATE-CS-2015 (Set 1)    Network Security    50 Computer Networks MCQs with Answers    
Discuss it


Question 9 Explanation: 
In Symmetric Key Cryptography, access of key is with both the parties. It implies every person needs to communicate N-1 other users using different keys i.e 1+2+3...N-2+N-1 This is like number of edges needed in a complete graph with N vertices is N(N-1)/2. Answer is therefore C
Question 10

Consider the following routing table at an IP router "Q51" For each IP address in Group-I identify the correct choice of the next hop from Group-II using the entries from the routing table above.

   List-I               List-II
A. 128.96.171.92     1. Interface 0
B. 128.96.167.151    2. Interface 1
C. 128.96.163.121    3. R2
D. 128.96.165.121    4. R3
                     5. R4
Codes:
     A B C D
(a)  1 3 5 4
(b)  1 4 2 5
(c)  2 3 4 5
(d)  2 3 5 4
A

a

B

b

C

c

D

d

GATE-CS-2015 (Set 2)    IP Addressing    50 Computer Networks MCQs with Answers    
Discuss it


Question 10 Explanation: 

Taking the 1st IP Address: 128.96.171.92

Bitwise AND between 128.96.171.92 and 255.255.254.0 we get the subnet ID as follows:25525511111110012896101010119212896101010100

∴ Subnet ID = 128.96.170.0
∴ 128.96.171.92 will forward to interface 0

Taking the 2nd IP Address: 128.96.167.151

Bitwise AND between 128.96.167.151 and 255.255.254.0 we get, 255255111111100128961010011115112896101001100

∴ Subnet ID = 128.96.166.0
∴ 128.96.167.151 will forward to interface R2

Taking the 3rd IP Address: 128.96.163.151

Bitwise AND between 128.96.167.151 and 255.255.254.0 we get, 255255111111100128961010001115112896101000100

∴ Subnet ID = 128.96.162.0 (Doesn’t match with any given interface)

Now, Bitwise AND between 128.96.167.151 and 255.255.252.0 we get, 255255111111000128961010001115112896101000000

∴ Subnet ID = 128.96.160.0 (Doesn’t match with any given interface)
∴ 128.96.163.151 will forward to default interface R4

Taking the last IP Address: 128.96.164.121

Bitwise AND between 128.96.164.121 and 255.255.254.0 we get, 255255111111100128961010010012112896101001000

∴ Subnet ID = 128.96.164.0
∴ 128.96.167.151 will forward to interface R3

∴ Option (A) is the correct answer.

There are 50 questions to complete.
My Personal Notes arrow_drop_up