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
GATE CS 2013    Network Layer    
Discuss it


Question 1 Explanation: 
Router is a network layer device. See the following diagram from http://www.oreillynet.com/network/2001/04/13/net_2nd_lang.html Figure6_1 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    
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    
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 CN_2010_01 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    
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.
Network Layer    GATE-CS-2006    
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
Network Layer    GATE-CS-2014-(Set-1)    
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
Question 11
Which one of the following is TRUE interior Gateway routing protocols - Routing Information Protocol (RIP) and Open Shortest Path First (OSPF)
A
RIP uses distance vector routing and OSPF uses link state routing
B
OSPF uses distance vector routing and RIP uses link state routing
C
Both RIP and OSPF use link state routing
D
Both RIP and OSPF use distance vector routing
Network Layer    GATE-CS-2014-(Set-2)    
Discuss it


Question 11 Explanation: 
Both Routing Information Protocol (RIP) and Open Shortest Path First (OSPF) are Interior Gateway Protocol, i.e., they both are used within an autonomous system. RIP is an old protocol (not used anymore) based on distance vector routing. OSPF is based Link State Routing.
Question 12
An IP machine Q has a path to another IP machine H via three IP routers R1, R2, and R3.
Q—R1—R2—R3—H 
H acts as an HTTP server, and Q connects to H via HTTP and downloads a file. Session layer encryption is used, with DES as the shared key encryption protocol. Consider the following four pieces of information:
[I1] The URL of the file downloaded by Q
[I2] The TCP port numbers at Q and H
[I3] The IP addresses of Q and H
[I4] The link layer addresses of Q and H 
Which of I1, I2, I3, and I4 can an intruder learn through sniffing at R2 alone?
A
Only I1 and I2
B
Only I1
C
Only I2 and I3
D
Only I3 and I4
Network Layer    GATE-CS-2014-(Set-2)    
Discuss it


Question 12 Explanation: 
An Intruder can’t learn [I1] through sniffing at R2 because 
URLs and Download are functioned at Application layer of OSI Model.

An Intruder can learn [I2] through sniffing at R2 because
Port Numbers are encapsulated in the payload field of IP Datagram.

An Intruder can learn [I3] through sniffing at R2 because IP 
Addresses and Routers are functioned at network layer of OSI Model.

An Intruder can’t learn [I4] through sniffing at R2 because 
it is related to Data Link Layer of OSI Model.
Question 13
Host A (on TCP/IP v4 network A) sends an IP datagram D to host B (also on TCP/IP v4 network B). Assume that no error occurred during the transmission of D. When D reaches B, which of the following IP header field(s) may be different from that of the original datagram D?
(i) TTL 
(ii) Checksum 
(iii) Fragment Offset
A
(i) only
B
(i) and (ii) only
C
(ii) and (iii) only
D
(i), (ii) and (iii)
Network Layer    GATE-CS-2014-(Set-3)    
Discuss it


Question 13 Explanation: 
All (i), (ii) and (iii) are changed: (i) TTL is decremented at every hop. So TTL is different from orginal value (ii) Since TTL changes, the Checksum of the packet also changes. (iii) A packet is fragmented if it has a size greater than the Maximum Transmission Unit (MTU) of the network. There may be intermediate networks that may change fragment offset by fragmenting the packet.
Question 14
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
Network Layer    GATE-CS-2014-(Set-3)    
Discuss it


Question 14 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 15
Every host in an IPv4 network has a 1-second resolution real-time clock with battery backup. Each host needs to generate up to 1000 unique identifiers per second. Assume that each host has a globally unique IPv4 address. Design a 50-bit globally unique ID for this purpose. After what period (in seconds) will the identifiers generated by a host wrap around?
A
128
B
64
C
256
D
512
Network Layer    GATE-CS-2014-(Set-3)    
Discuss it


Question 15 Explanation: 
Wrap-around time is nothing but in how many seconds will all the hosts generate all IDs possible. (i.e. TOTAL_IDS / NO. OF IDS PER SEC). Total IDs possible with 50-bit is 2^50. One host generating 1000 identifiers per sec. So all hosts will generate 2^32 * 1000 ----> 2^32 * 2^10-----> 2^42 unique IDs. If we Divide them, we get answer (i.e. 2^50/2^42=2^8)
Question 16
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
A
MF bit: 0, Datagram Length: 1444; Offset: 370
B
MF bit: 1, Datagram Length: 1424; Offset: 185
C
MF bit: 1, Datagram Length: 1500; Offset: 37
D
MF bit: 0, Datagram Length: 1424; Offset: 2960
Network Layer    GATE-CS-2014-(Set-3)    
Discuss it


Question 16 Explanation: 
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..
Question 17
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.
Network Layer    GATE-CS-2006    
Discuss it


Question 17 Explanation: 
Question 18
Station A needs to send a message consisting of 9 packets to Station B using a sliding window (window size 3) and go-back-n error control strategy. All packets are ready and immediately available for transmission. If every 5th packet that A transmits gets lost (but no acks from B ever get lost), then what is the number of packets that A will transmit for sending the message to B?
A
12
B
14
C
16
D
18
Network Layer    GATE-CS-2006    
Discuss it


Question 18 Explanation: 
Question 19
The address resolution protocol (ARP) is used for
A
Finding the IP address from the DNS
B
Finding the IP address of the default gateway
C
Finding the IP address that corresponds to a MAC address
D
Finding the MAC address that corresponds to an IP address
Network Layer    GATE-CS-2005    
Discuss it


Question 19 Explanation: 
When a packet is passed to the data link layer from network layer IP address of the sender , MAC address of the sender and the gateway of the network is attached. The MAC address of the sender is known to the sender but not the MAC address of the gateway .So ARP (Address Resolution Protocol) request is generated with the IP address of the gateway and is broadcasted ,everyone except the gateway discards it and gateway sends it’s MAC address. sh_24 Reference: http://www.louiewong.com/archives/196?LMCL=pchYgb&LMCL=U7nEDo&LMCL=An2_DF&LMCL=pchYgb&LMCL=An2_DF Address Resolution Protocol (ARP) is a request and reply protocol used to find MAC address from IP address. This solution is contributed by Shashank Shanker khare.
Question 20
In a packet switching network, packets are routed from source to destination along a single path having two intermediate nodes. If the message size is 24 bytes and each packet contains a header of 3 bytes, then the optimum packet size is:
A
4
B
6
C
7
D
9
Network Layer    GATE-CS-2005    
Discuss it


Question 20 Explanation: 
Dividing a message into packets may decrease the transmission time due to parallelism as shown in the following figure. But after a certain limit reducing the packet size may increase the transmission time also. Following figure shows the situation given in question. Let transmission time to transfer 1 byte for all nodes be t. The first packet will take time = (packet size)*3*t. After the first packet reaches the destination, remaining packets will take time equal to (packet size)*t due to parallelism.
If we use 4 bytes as packet size, there will be 24 packets
Total Transmission time = Time taken by first packet + 
                          Time taken by remaining packets 
                       = 3*4*t + 23*4*t = 104t

If we use 6 bytes as packet size, there will be 8 packets
Total Transmission time = 3*6*t + 7*6*t = 60t

If we use 7 bytes as packet size, there will be 6 packets
Total Transmission time = 3*7*t + 5*7*t = 56t

If we use 9 bytes as packet size, there will be 4 packets
Total Transmission time = 3*9*t + 3*9*t = 54t
Source: question 2 of http://www.geeksforgeeks.org/computer-networks-set-6/ Related Articles: Circuit Switching Vs Packet Switching
Question 21
The routing table of a router is shown below:
 Destination     Sub net mask 	     Interface
 128.75.43.0 	 255.255.255.0 	        Eth0
 128.75.43.0 	 255.255.255.128 	Eth1
 192.12.17.5 	 255.255.255.255 	Eth3
 default 	  	                Eth2
On which interfaces will the router forward packets addressed to destinations 128.75.43.16 and 192.12.17.10 respectively?
A
Eth1 and Eth2
B
Eth0 and Eth2
C
Eth0 and Eth3
D
Eth1 and Eth3
Network Layer    GATE-CS-2004    
Discuss it


Question 21 Explanation: 
To find the interface, we need to do AND of incoming IP address and Subnet mask. Compare the result of AND with the destination. Note that if there is a match between multiple Destinations, then we need to select the destination with longest length subnet mask. 128.75.43.16, matches with 128.75.43.0 and 128.75.43.0, the packet is forwarded to Eth1 as length of subnet mask in Eth11 is more. If a result is not matching with any of the given destinations then the packet is forwarded to the default interface (here Eth2). Therefore the packet's addressed to 192.12.17.10 will be forwarded to Eth2.
Question 22
Consider three IP networks A, B and C. Host HA in network A sends messages each containing 180 bytes of application data to a host HC in network C. The TCP layer prefixes a 20 byte header to the message. This passes through an intermediate net­work B. The maximum packet size, including 20 byte IP header, in each network is A : 1000 bytes B : 100 bytes C : 1000 bytes The network A and B are connected through a 1 Mbps link, while B and C are connected by a 512 Kbps link (bps = bits per second). GATECS2004Q56 Assuming that the packets are correctly delivered, how many bytes, including headers, are delivered to the IP layer at the destination for one application message, in the best case ? Consider only data packets.
A
200
B
220
C
240
D
260
Network Layer    GATE-CS-2004    
Discuss it


Question 22 Explanation: 
Network B receives 220 bytes of data (180 bytes of application layer data + 20 bytes of TCP header + 20 bytes of IP header) from network A. As maximum packet size of network B is 100 bytes (data of 80 bytes + 20 bytes IP header), for network B, out of 220 Bytes, 200 bytes would be of data or payload (180 bytes of application layer data + 20 bytes of TCP header) and 20 bytes of IP header. Network B now removes the 20 bytes header. Out of 200 bytes of data, it uses 80 bytes of data. Thus 1st packet leaving B would be of 100 bytes (Data: 80 bytes, IP header: 20 bytes). Now we have 120 bytes of data remaining. Thus the 2nd packet leaving B would be of 100 bytes (Data: 80 bytes, IP header: 20 bytes). Now we have 40 bytes of data remaining. Thus the 3rd packet leaving B would be of 60 bytes (Data: 40 bytes, IP header: 20 bytes). Hence, total of 100 + 100 + 60 bytes = 260 bytes would be received by the destination. Thanks to Sohil Ladhani for providing this explanation.
Question 23
Consider three IP networks A, B and C. Host HA in network A sends messages each containing 180 bytes of application data to a host HC in network C. The TCP layer prefixes a 20 byte header to the message. This passes through an intermediate net­work B. The maximum packet size, including 20 byte IP header, in each network is A : 1000 bytes B : 100 bytes C : 1000 bytes The network A and B are connected through a 1 Mbps link, while B and C are connected by a 512 Kbps link (bps = bits per second). GATECS2004Q56 What is the rate at which application data is transferred to host HC? Ignore errors, acknowledgements, and other overheads.
A
325.5 Kbps
B
354.5 Kbps
C
409.6 Kbps
D
512.0 Kbps
Network Layer    GATE-CS-2004    
Discuss it


Question 23 Explanation: 
Host C receives 260 bytes of data (including headers) out of which 180 bytes is of application data. Thus the efficiency is 180/260 = 0.6923. Thus the rate at which application data is transferred to host C would be 0.6923 * 512 Kbps = 354.45 Kbps. ( How host C receives 260 bytes of data is shown here: http://geeksquiz.com/gate-gate-cs-2004-question-56/
Question 24
Which of the following assertions is FALSE about the Internet Protocol (IP) ?
A
It is possible for a computer to have multiple IP addresses
B
IP packets from the same source to the same destination can take different routes in the network
C
IP ensures that a packet is discarded if it is unable to reach its destination within a given number of hops
D
The packet source cannot set the route of an outgoing packets; the route is determined only by the routing tables in the routers on the way
Network Layer    GATE-CS-2003    
Discuss it


Question 24 Explanation: 
See following liens from http://en.wikipedia.org/wiki/Source_routing In computer networking, source routing allows a sender of a packet to partially or completely specify the route the packet takes through the network. In the Internet Protocol, two header options are available which are rarely used: "strict source and record route" (SSRR) and "loose source and record route" (LSRR). Because of security concerns, packets marked LSRR are frequently blocked on the Internet. If not blocked, LSRR can allow an attacker to spoof its address but still successfully receive response packets.
Question 25
Routers forward a packet using forwarding table entries. The network address of incoming packet may match multiple entries. How routers resolve this?
A
Forward it the the router whose entry matches with the longest prefix of incoming packet
B
Forward the packet to all routers whose network addresses match.
C
Discard the packet.
D
Forward it the the router whose entry matches with the longest suffix of incoming packet
Network Layer    GATE-CS-2015 (Mock Test)    
Discuss it


Question 25 Explanation: 
The network addresses of different entries may overlap in forwarding table. Routers forward the incoming packet to the router which hash the longest prefix matching with the incoming packet.
Question 26
Consider the following routing table of a router.
GATE CN1
Consider the following three IP addresses.
GATE CN
How are the packets with above three destination IP addresses are forwarded?
A
1->D, 2->B, 3->B
B
1->D, 2->B, 3->D
C
1->B, 2->D, 3->D
D
1->D, 2->D, 3->D
Network Layer    GATE-CS-2015 (Mock Test)    
Discuss it


Question 26 Explanation: 
Question 27
Which one of the following fields of an IP header is NOT modified by a typical IP router?
A
Checksum
B
Source address
C
Time to Live (TTL)
D
Length
Network Layer    GATE-CS-2015 (Set 1)    
Discuss it


Question 27 Explanation: 
Length and checksum can be modified when IP fragmentation happens. Time To Live is reduced by every router on the route to destination. Only Source Address is what IP address can not change SO B is the answer.
Question 28
In the network 200.10.11.144/27, the fourth octet (in decimal) of the last IP address of the network which can be assigned to a host is ________
A
158
B
255
C
222
D
223
Network Layer    GATE-CS-2015 (Set 3)    
Discuss it


Question 28 Explanation: 
The last or fourth octet of network address is 144 
144 in binary is 10010000.

The first three bits of this octal are fixed as 100, 
the remaining bits can get maximum value as 11111.  
So the maximum possible last octal IP address is 
10011111 which is 159.

The question seems to by asking about host address. The
address with all 1s in host part is broadcast address 
and can't be assigned to a host. So the maximum possible 
last octal in a host IP is 10011110 which is 158.

The maximum possible network address that can be assigned 
is 200.10.11.158/31 which has last octet as 158.
Question 29
If a Company require 60 hosts then What is the best possible subnet mask?
A
255.255.255.0
B
255.255.255.192
C
255.255.225.224
D
225.225.255.240
Network Layer    
Discuss it


Question 29 Explanation: 
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
Question 30
In class C , if subnet mask is 255.255.255.224 then calculates number of subnet?
A
6
B
8
C
4
D
None of the Above
Network Layer    
Discuss it


Question 30 Explanation: 
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.
Question 31
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?
A
14
B
30
C
62
D
126
Network Layer    GATE-IT-2004    
Discuss it


Question 32
A host is connected to a Department network which is part of a University network. The University network, in turn, is part of the Internet. The largest network in which the Ethernet address of the host is unique is:  
A
the subnet to which the host belongs
B
the Department network
C
the University network
D
the Internet
Network Layer    GATE-IT-2004    
Discuss it


Question 32 Explanation: 
Ethernet address is basically the MAC address, which is supposed to be unique to a NIC. Thus it is unique over the Internet. Related Articles: MAC Address
Question 33
In TCP, a unique sequence number is assigned to each
A
byte
B
word
C
segment
D
message
Network Layer    GATE-IT-2004    
Discuss it


Question 33 Explanation: 
Since we all know that the TCP is one of the 7 layers of OSI reference model. It has the basic responsibility to provide a reliable, end-to- end two way data transmission in the form of bytes to the application that uses it. In making the byte stream transmission to be reliable TCP provides every byte a unique sequence number. The TCP header has the a sequence number field, which indicates the position of the first byte in the TCP data field in the data stream. This explanation has been contributed by Namita Singh
Question 34
Which of the following objects can be used in expressions and scriplets in JSP (Java Server Pages) without explicitly declaring them?    
A
session and request only
B
request and response only
C
response and session only
D
session, request and response
Network Layer    GATE-IT-2004    
Discuss it


Question 34 Explanation: 

JSP provides certain implicit objects which are accessed using standard variables and are automatically available for use in our JSP without writing any extra code. We can directly use them within Scriptlet without initializing and declaring them.
Request : It encapsulates the request coming from the Client and being processed by the JSP. It is passed to the JSP by the container as a parameter of the jspService( ) method.
Session : Session are created automatically, and a new session is available even when there is no incoming session unless we have used a session = ”false” attribute in the page directive.   Response : It is used to reply to the client(browser) with either some data or redirect to some other page
 
Thus, option (D) is correct.
 
Please comment below if you find anything wrong in the above post.
Question 35
In the TCP/IP protocol suite, which one of the following is NOT part of the IP header?
A
Fragment Offset
B
Source IP address
C
Destination IP address
D
Destination port number
Network Layer    GATE-IT-2004    
Discuss it


Question 35 Explanation: 
The IP header format is depicted in the figure below: ip-header-format From the above figure it is quite clear that the destination port number is the field absent from the IP header. This explanation has been contributed by Namita Singh. Read the following to learn more on IPv4 datagram: Network Layer and IPv4 Datagram Header
Question 36
Suppose that the maximum transmit window size for a TCP connection is 12000 bytes. Each packet consists of 2000 bytes. At some point of time, the connection is in slow-start phase with a current transmit window of 4000 bytes. Subsequently, the transmitter receives two acknowledgements. Assume that no packets are lost and there are no time-outs. What is the maximum possible value of the current transmit window?
A
4000 bytes
B
8000 bytes
C
10000 bytes
D
12000 bytes
Network Layer    GATE-IT-2004    
Discuss it


Question 36 Explanation: 
net_04_88 Image Source : http://becomethesolution.com/blogs/path-mtu-determine-mismatching-maximum-transmission-unit-across-links

In the figure shown above MTU (Maximum Transmission Unit) contains IP header, TCP header and the payload or the TCP MSS (maximum segment size)

In slow start phase transmission of the packets in TCP for every ACK( acknowledgement packet) received, the sender of the data increases the current transmitted window size by the MSS( Maximum Segment Size).

According to the question given every packet consists of 2000 bytes = maximum segment size.

So, after 2 ACKs received the current window size will now be increased by

4000+ 2000+2000

= 8000 bytes

 

 This solution is contributed by Namita Singh.

Question 37
Traceroute reports a possible route that is taken by packets moving from some host A to some other host B. Which of the following options represents the technique used by traceroute to identify these hosts  
A
By progressively querying routers about the next router on the path to B using ICMP packets, starting with the first router
B
By requiring each router to append the address to the ICMP packet as it is forwarded to B. The list of all routers en-route to B is returned by B in an ICMP reply packet
C
By ensuring that an ICMP reply packet is returned to A by each router en-route to B, in the ascending order of their hop distance from A
D
By locally computing the shortest path from A to B
Network Layer    Gate IT 2005    
Discuss it


Question 37 Explanation: 
traceroute tracks the route packets taken from an IP network on their way to a given host. It utilizes the IP protocol's time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host.
Question 38
Count to infinity is a problem associated with
A
link state routing protocol.
B
distance vector routing protocol
C
DNS while resolving host name.
D
TCP for congestion control.
Network Layer    Gate IT 2005    
Discuss it


Question 38 Explanation: 
Networks using distance-vector routing are susceptible to loops and issues with count to infinity. Problems can happen with your routing protocol when a link or a router fails.
Question 39
In a communication network, a packet of length L bits takes link L1 with a probability of p1or link L2 with a probability of p2. Link L1 and L2 have bit error probability of b1 and b2respectively. The probability that the packet will be received without error via either L1 or L2 is  
A
(1 - b1)Lp1 + (1 - b2)Lp2
B
[1 - (b1 + b2)L]p1p2
C
(1 - b1)L (1 - b2)Lp1p2
D
1 - (b1Lp1 + b2Lp2)
Network Layer    Gate IT 2005    
Discuss it


Question 39 Explanation: 

Number of bits in a packet = L bits
Probability of link 'l1' = p1 Bit error probability for link 'l1' = b1 No bit error probability for link 'l1' = (1 - b1)
Probability of link 'l2' = p2 Bit error probability for link 'l2' = b2 No bit error probability for link 'l2' = (1 - b2)
Link 'l1' and 'l2' are mutually exclusive. Thus, probability that the packet will be received without error = (1 - b1)Lp1 + (1 - b2)Lp2
 
Thus, option (A) is correct.
 
Please comment below if you find anything wrong in the above post.
Question 40
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?  
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
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
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
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
Network Layer    Gate IT 2005    
Discuss it


Question 40 Explanation: 
  Background Reading: IP address is used to uniquely identify a host.
->Address range
 Class A	1.0.0.1 to 126.255.255.254
 Class B	128.1.0.1 to 191.255.255.254
 Class C	192.0.1.1 to 223.255.254.254
 Class D	224.0.0.0 to 239.255.255.255
(127.0.0.0 to 127.255.255.255 - used for loopback functionality : which will point back to the computer's own tcp/ip network configuration.) (1)x.x.x.0 and x.x.x.255 addresses are used for directed broadcast address and network ID. So,these two addresses are not used by hosts. (2)Network ID is computed by performing logical & on IP address with subnet mask. -> IPV4 addresses are 32 bit and they are used as follows for:
	       Identifying Networks(bit no.)        Identifying Hosts(bit no.)
 Class A              1-8      	  			9-32 
 Class B              1-16   	  			17-32
 Class C              1-24	       		        25-32
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.
Question 41
Assume that "host1.mydomain.dom" has an IP address of 145.128.16.8. Which of the following options would be most appropriate as a subsequence of steps in performing the reverse lookup of 145.128.16.8? In the following options "NS" is an abbreviation of "nameserver".
A
Query a NS for the root domain and then NS for the "dom" domains
B
Directly query a NS for "dom" and then a NS for "mydomain.dom" domains
C
Query a NS for in-addr.arpa and then a NS for 128.145.in-addr.arpa domains
D
Directly query a NS for 145.in-addr.arpa and then a NS for 128.145.in-addr.arpa domains
Network Layer    Gate IT 2005    
Discuss it


Question 41 Explanation: 
Background: When you type a web address into a web browser like www.google.com your computer needs to convert that into an IP address so that it can contact that web server & deliver the web page to you. In a forward DNS lookup client first asks ISP(Internet Service Provider) for the dns of the domain name.ISP maintains a cache for the IP address of the domains whose lookup has been already made.If IP is not found in the cache then the ISP asks the root level dns server,which is a network of hundreds of servers in many countries around the world.Nearest root level DNS for India is in Tokyo. The root level server then redirects it to another server ,say we are searching for geeksforgeeks.org then root level server will redirect isp to org server which will in turn redirect to geeksforgeeks server and from here ISP get the particular IP address which is then sent to the  client. Forward dns lookup- domain name - IP Reverse dns lookup- IP-domain name special address domain - in.addr.arpa (this domain basically converts to inverse domain) IPv6 addresses use the ip6.arpa domain. Now,ISP maintains a list of IP addresses corresponding to domain name and also domain names corresponding to the IP addresses. in-addr.arpa is the domain name server For IP address say 192.19.20.1(which is say IP address of geeksforgeeks) the corresponding entry will be 1.20.19.192.in-addr.arpa. IN PTR www.geeksforgeeks.org.” which will point back to www.geeksforgeeks.org .This helps in checking the ip address of the sender. The IP in the entry is in reverse order . shashank_1 This solution is contributed by Shashank .
Question 42
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 :   Note : This question was asked as Numerical Answer Type.
A
10
B
50
C
12
D
13
Network Layer    GATE-CS-2016 (Set 1)    
Discuss it


Question 42 Explanation: 
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.
Question 43
Which of the following statements is TRUE?  
A
Both Ethernet frame and IP packet include checksum fields
B
Ethernet frame includes a checksum field and IP packet includes a CRC field
C
Ethernet frame includes a CRC field and IP packet includes a checksum field
D
Both Ethernet frame and IP packet include CRC fields
Network Layer    GATE IT 2006    
Discuss it


Question 43 Explanation: 
  ETHERNET FRAME FORMAT: img_19 1. It also called IEEE 802.3 protocol. 2. Used at data link layer, bus topology, CSMA/CD access control, NO acknowledgement used. 3. For securing CRC is used, more precisely, CRC-32 bit. IP DATAGRAM FORMAT: img_19_1 IP datagram uses 16-bit checksum. So, ETHERNET->CRC and IP->checksum. This solution is contributed by Sandeep pandey.
Question 44
Two popular routing algorithms are Distance Vector(DV) and Link State (LS) routing. Which of the following are true?
(S1) Count to infinity is a problem only with DV and not LS routing
(S2) In LS, the shortest path algorithm is run only at one node
(S3) In DV, the shortest path algorithm is run only at one node
(S4) DV requires lesser number of network messages than LS
A
S1, S2 and S4 only
B
S1, S3 and S4 only
C
S2 and S3 only
D
S1 and S4 only
Network Layer    Gate IT 2008    
Discuss it


Question 44 Explanation: 
Shortest path algorithm runs on all nodes in both LS and DV
Question 45
Host X has IP address 192.168.1.97 and is connected through two routers R1 and R2 to an­other 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?
A
1
B
2
C
3
D
6
Network Layer    IP Addressing    Gate IT 2008    
Discuss it


Question 45 Explanation: 
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
There are 45 questions to complete.

GATE CS Corner


See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.