Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Last Updated: Mar 27, 2024

Network Layer

Leveraging ChatGPT - GenAI as a Microsoft Data Expert
Speaker
Prerita Agarwal
Data Specialist @
23 Jul, 2024 @ 01:30 PM

Introduction

This article contains various gate questions on Network Layer, with their solutions and explanations.

The third layer in the OSI reference model is the Network Layer. The network layer is in charge of the functioning of the subnet. The goal of this layer is to transmit packets from a source to a destination via various connections (networks). It acts as a network controller, sending the signal to the other end via multiple channels. The network layer ensures that each packet gets from its origin to its final destination, whereas the data link layer monitors package delivery between two systems on the same network.

It also divides incoming messages into packets and assembles received packets into higher-level messages. Because the routing problem in broadcast networks is simple, the network layer is usually shallow or non-existent.

Now let’s move on to the problems asked in the GATE exam.

Problems 

1. The Time to Live (TTL) field is one of the header fields in an IP datagram. Which of the statements best describes the importance of this field?

  1. It can be used to cut down on delays.
  2. It can be used to prioritize packets
  3. It can be used to improve throughput.
  4. It can be used to keep packets from looping.

Ans: d. It can be used to keep packets from looping.

Explanation: Time to Live can be thought of as the maximum amount of time an IP datagram can exist in the network. The TTL field's purpose is to prevent an undeliverable datagram from continuing to circulate.

2. Which of the following Internet Protocol (IP) uses the time-to-live (TTL) field in the IP datagram header?

  1. Discard packets that arrive after that time.
  2. Prevent packets from looping indefinitely
  3. Ensure that packets arrive at their destination within that time frame.
  4. Limit the amount of time a packet is queued in intermediate routers.

Ans: b. Prevent packets from looping indefinitely

Explanation: TTL, also known as a hop limit, is a mechanism that limits the lifespan or lifetime of data in a computer or network. TTL can be implemented as a counter or timestamp that is attached to or embedded in data. Data is discarded once the specified event count or timespan has elapsed. TTL prevents a data packet from circulating indefinitely in computer networking.

3. Which of the following statements about interior Gateway routing protocols - Routing Information Protocol (RIP) and Open Shortest Path First(OSPF) - is TRUE? 

  1. RIP employs distance vector routing, whereas OSPF employs link-state routing.
  2. OSPF employs distance vector routing, whereas RIP employs link-state routing.
  3. Both RIP and OSPF use distance vector routing
  4. Both RIP and OSPF use link-state routing.

Ans: a. RIP employs distance vector routing, whereas OSPF employs link-state routing.

Explanation: Both Routing Information Protocol (RIP) and Open Shortest Path First (OSPF) are Interior Gateway Protocols, which means they are used within a self-contained system. RIP is a defunct protocol that is based on distance vector routing. The OSPF protocol is based on Link-State Routing.

4. In an IPv4 datagram, the M bit is set to 0, the HLEN bit is set to 10, the total length is set to 400, and the fragment offset is 300. The datagram's position, as well as the sequence numbers of the first and last bytes of the payload, are 

  1. Last fragment, 2400 and 2759
  2. First fragment, 2400 and 2759
  3. Last fragment, 2400 and 2789
  4. Middle fragment, 300 and 689

Ans: a. Last fragment, 2400 and 2759

Explanation: M = 0 indicates that this packet is the final fragment of the original packet. As a result, the answer is either A or C.

It is assumed that the HLEN field is set to 10. The length of the header is the number of 32-bit words. As a result, the header length is 10 * 4 = 40. 

Furthermore, given that the total length = 400.

Total length denotes the length of the packet, including the header. As a result, the packet length excluding the header is 400 - 40 = 360.

 Last byte address = 2400 + 360 - 1 = 2759 (Because numbering begins with 0)

5. Routers use forwarding table entries to forward a packet. Multiple entries may match the network address of an incoming packet. How do routers deal with this?

  1. Discard the packet.
  2. Forward it to the router whose entry matches the longest prefix of the incoming packet.
  3. Forward the packet to all routers whose network addresses match
  4. Send it to the router whose entry matches the longest suffix of the incoming packet.

Ans: b. Forward it to the router whose entry matches the longest prefix of the incoming packet.

Explanation: The network addresses of different entries in the forwarding table may overlap. Routers route incoming packets to the router with the longest prefix that matches the incoming packet.

6. Which of the following IP header fields is NOT modified by a typical IP router?

  1. Source address
  2. Length
  3. Time to Live (TTL)
  4. Checksum

Ans: a. Source address

Explanation: When IP fragmentation occurs, the length and checksum can be changed. Every router on the route to the destination reduces Time To Live. Only the Source Address of an IP address can be changed, so A is the correct answer.

7. Which of the following make no decisions based on measurements or estimates of current traffic and topology?

  1. Adaptive algorithms
  2. Recursive algorithms
  3. Non-adaptive algorithms
  4. Static algorithms

Ans: c. Non-adaptive algorithms

Explanation: Non-adaptive algorithms do not base their decisions on current traffic and topology measurements or estimates. As a result, option (c) is correct.

8. Which of the following IP address is used when hosts are booted?

  1. 1.0.0.0
  2. 1.1.1.1
  3. 0.0.0.0
  4. 255.255.255.255

Ans: c. 0.0.0.0

Explanation: In IPv4 0.0.0.0 has several uses. Example: It is used when systems are being booted. As a result, (c) is the correct answer.

9. Which of the following IoT wireless technologies consumes the least amount of power?

  1. Wi-Fi
  2. Zigbee
  3. GSM/CDMA
  4. Bluetooth

Ans: d. Bluetooth

Explanation: Bluetooth is a short-range communication technology used in the Internet of Things (IoT). It is an ultra-low energy wireless technology for IoT devices that uses the least amount of power when compared to existing Bluetooth networking standards. Thus, option (d) is correct.

10. Using the sliding window protocol, station A sends messages to station B in 32-byte packets. The round trip delay between A and B is 40 ms(milliseconds), and the bottleneck bandwidth on the A-B path is 64 kbps. The optimal window size of A will be _______.

  1. 10
  2. 20
  3. 30
  4. 40

Ans: a. 10

Explanation: Since, Round Trip propagation delay = 40 ms

Frame size = 32 * 8 bits 

Bottleneck Bandwidth = 64 kbps 

Total data will be 40 ms * 64 kbps = 40 * 64 bits

        = 40 * 64 / 8  bytes

        = 320 bytes.

packet size 32 bytes.

Thus, number of packets = total data / packet size.

        = 320 B / 32 B = 10 packets.

Thus, The optimal window size of A will be ten packets.

Now, let’s move on to the FAQ section.

Frequently Asked Questions 

  1. What is OSI?
    The OSI ( Open Systems Interconnection Model ) is an excellent framework for describing networking system functions. The OSI model depicts computing functions as universal rules and requirements that must be met in order for different products and software to communicate with one another.
  2. What is a network layer?
    The third layer in the OSI reference model is the Network Layer. The network layer is in charge of the functioning of the subnet. The primary goal of this layer is to transmit packets from a source to a destination via various connections (networks). 
  3. What is the definition of circuit switching?
    Circuit switching is a technique for establishing a dedicated path between the transmitter and the receiver. After a link is established using the Circuit Switching Technique, the dedicated route will remain active until the connection is terminated.
  4. What are some of the examples of routing protocols?
    The different examples of the routing protocols are OSPF(Open shortest path first), BGP(Border Gateway Protocol), IGP(Interior gateway protocol), EGP(Exterior gateway protocol), etc.
  5. What are the main problems with Network Protocols?
    Fake IP address, DNS Configuration issue, Drown attack, DoS attack, Malware attack, Buffer overflow, Hijacking and many more.
Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Conclusion

This article extensively discussed various GATE questions on Network Layer. This article covers the solution and explanation of these GATE questions.

Refer here to know more about Network Layer in detail.

Recommended Readings:


We hope that this blog has helped you enhance your knowledge regarding the network layer, and if you would like to learn more, check out our articles in the code studio library. Do upvote our blog to help other ninjas grow. Happy Coding!

Topics covered
1.
Introduction
1.1.
Problems 
2.
Frequently Asked Questions 
3.
Conclusion