# Network Layer

• Last Updated : 02 Dec, 2021

 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. 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 : So every packet passes twice through data link layer of every intermediate router.
 Question 2
In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of total length is 400 and the fragment offset value is 300. The position of the datagram, the sequence numbers of the first and the last bytes of the payload, respectively are
 A Last fragment, 2400 and 2789 B First fragment, 2400 and 2759 C Last fragment, 2400 and 2759 D Middle fragment, 300 and 689
GATE CS 2013    Network Layer
Discuss it

Question 2 Explanation:
M = 0 indicates that this packet is the last packet among all fragments of original packet. So the answer is either A or C. It is given that HLEN field is 10. Header length is number of 32 bit words. So header length = 10 * 4 = 40 Also, given that total length = 400. Total length indicates total length of the packet including header. So, packet length excluding header = 400 - 40 = 360 Last byte address = 2400 + 360 - 1 = 2759 (Because numbering starts from 0)
 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 3 Explanation:
 Question 4
Consider a network with five nodes, N1 to N5, as shown below. 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 same data as given in previous question. After the update in the previous question, the link N1-N2 goes down. N2 will reflect this change immediately in its distance vector as cost, infinite. After the NEXT ROUND of update, what will be cost to N1 in the distance vector of N3?
 A 3 B 9 C 10 D Infinite
GATE CS 2011    Network Layer
Discuss it

Question 5 Explanation:
 Question 6
One of the header fields in an IP datagram is the Time to Live(TTL)field.Which of the following statements best explains the need for this field?
 A It can be used to prioritize packets B It can be used to reduce delays C It can be used to optimize throughput D It can be used to prevent packet looping
GATE CS 2010    Network Layer
Discuss it

Question 6 Explanation:
Time to Live can be thought as an upper bound on the time that an IP datagram can exist in the network. The purpose of the TTL field is to avoid a situation in which an undeliverable datagram keeps circulating.
 Question 7
Consider a network with 6 routers R1 to R6 connected with links having weights as shown in the following diagram: All the routers use the distance vector based routing algorithm to update their routing tables. Each router starts with its routing table initialized to contain an entry for each neighbour with the weight of the respective connecting link. After all the routing tables stabilize, how many links in the network will never be used for carrying any data?
 A 4 B 3 C 2 D 1
GATE CS 2010    Network Layer
Discuss it

Question 7 Explanation:
 Question 8
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 8 Explanation:
 Question 9
For which one of the following reasons does Internet Protocol (IP) use the timeto- live (TTL) field in the IP datagram header
 A Ensure packets reach destination within that time B Discard packets that reach later than that time C Prevent packets from looping indefinitely D Limit the time for which a packet gets queued in intermediate routers.
GATE-CS-2006    Network Layer
Discuss it

Question 9 Explanation:
following are lines from wikipedia Time to live (TTL) or hop limit is a mechanism that limits the lifespan or lifetime of data in a computer or network. TTL may be implemented as a counter or timestamp attached to or embedded in the data. Once the prescribed event count or timespan has elapsed, data is discarded. In computer networking, TTL prevents a data packet from circulating indefinitely.
 Question 10
Consider the following three statements about link state and distance vector routing protocols, for a large network with 500 network nodes and 4000 links.
```[S1] The computational overhead in link state protocols
is higher than in distance vector protocols.
[S2] A distance vector protocol (with split horizon)
avoids persistent routing loops, but not a link
state protocol.
[S3] After a topology change, a link state protocol
will converge faster than a distance vector
protocol.```
Which one of the following is correct about S1, S2, and S3 ?
 A S1, S2, and S3 are all true. B S1, S2, and S3 are all false. C S1 and S2 are true, but S3 is false D S1 and S3 are true, but S2 is false
GATE-CS-2014-(Set-1)    Network Layer
Discuss it

Question 10 Explanation:
```Link-state:
Every node collects complete graph structure
Each computes shortest paths from it
Each generates own routing table

Distance-vector
No one has copy of graph
Nodes construct their own tables iteratively
Each sends information about its table to neighbors ```
Source: http://www.cs.cmu.edu/~srini/15-441/S05/lectures/10-Routing.ppt
```[S1] The computational overhead in link state protocols
is higher than in distance vector protocols.
[S2] A distance vector protocol (with split horizon)
avoids persistent routing loops, but not a link
state protocol.
[S3] After a topology change, a link state protocol
will converge faster than a distance vector
protocol.```
S1 is clearly true as in Link State all nodes compute shortest path for whole network graph. S3 is also true as Distance Vector protocol has count to infinity problem and converges slower. S2 is false. In distance vector protocol, split horizon with poison reverse reduces the chance of forming loops and uses a maximum number of hops to counter the 'count-to-infinity' problem. These measures avoid the formation of routing loops in some, but not all, cases
There are 88 questions to complete.
My Personal Notes arrow_drop_up