GATE / CS ARCHIVE

SUBJECT COLLECTION

Computer Networks · Network Layers & Devices

13 questions, newest first

GATE CSE has asked 13 questions on Network Layers & Devices (Computer Networks) from 2004 to 2025, in 11 of the 46 papers; the most recent is in GATE CSE 2025 Set 1. In the last five years it carried 0.2 marks per 100-mark paper on average, against 0.4 since 2003. Since 2014 the questions have been 3 MCQ, 1 MSQ and 1 NAT. 1 group of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
1 mark · MCQ
Report issue

Matching OSI layers to functions

Network Layers & Devices

Question 16, GATE 2025: Match layers (a) network, (b) transport, (c) data link to functions (I) packet routing, (II) framing and error handling, (III) host-to-host communication. A a-I,b-II,c-III; B a-I,b-III,c-II; C a-II,b-I,c-III; D a-III,b-II,c-I.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Approach: Identify the most specific layer functions before assigning the less precise phrase.
The network layer handles packet routing across networks, so a must match I. The data-link layer groups bits into frames for a link and handles link-level error detection or control, so c matches II. Those two matches already identify B among the choices.
The remaining b-III match is the question’s intended description of transport-layer end-to-end communication. More precisely, transport protocols provide process-to-process service using endpoint identifiers such as ports; “host-to-host” is broader wording than the usual precise definition.
A misassigns framing to transport; C assigns framing to network; D assigns routing to data link. Thus B is correct in the supplied matching scheme. Error handling can also exist at other layers, but “framing and error handling” together points to the data-link layer here.

Original paper, page 16 · Answer key

1 mark · MSQ
Report issue

Separate the IP destination from the Ethernet next hop

Network Layers & Devices

Question 23, GATE 2024: X sends a TCP packet to Y through router R; Ethernet switch S is the first switch between X and R. At departure from X, which statements hold? A destination IP is R; B destination IP is Y; C destination MAC is S; D destination MAC is Y.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B

Approach: Use end-to-end addressing for the IP packet and local-link addressing for its enclosing frame.

1. Derivation. The network-layer destination remains final host Y. Because R is the next IP hop beyond the local Ethernet, the frame’s destination MAC is the local interface of R, not the switch S or remote host Y. A switch forwards that frame without being its destination. Thus only B is true, under ordinary routing without destination NAT.

2. Explanation and checks. X chooses R as the next-hop router and obtains the MAC address of R’s local interface, normally through ARP. S reads that destination MAC to forward the frame, but is not itself the frame recipient. R later removes the incoming link header and constructs a new one for the next link. This changes link addresses without replacing the final IP destination Y under ordinary routing. TCP does not make a distant host directly reachable on the local Ethernet.

Original paper, page 17 · Answer key

2 marks · NAT
Report issue

Switch ports consumed by uplinks

Network Layers & Devices

Question 49, GATE 2019: Connect 15 machines into one LAN using 8-port Ethernet switches with no separate uplink ports. What is the smallest number of switches required?
Tap to enlarge
Answer & solution

Official answer: 3

1. Each machine connection consumes one switch port. Connecting switches to each other also consumes a port at each end because there are no extra uplink ports.
2. A connected arrangement of k switches requires at least k−1 inter-switch links. Using a tree achieves that minimum, consuming 2(k−1) ports in total.
3. The greatest possible number of machine ports is consequently 8k−2(k−1)=6k+2. For k=2 this is 14, insufficient for 15 machines; one switch is plainly insufficient as well.
4. For k=3 the bound becomes 20. A chain of three switches uses one port on each outer switch and two on the middle switch, leaving capacities 7,6,7 for machines.
5. Allocate five machines to each switch, for example. The outer switches then use six ports each and the middle uses seven, all within their eight-port limits. Thus three switches are feasible and two are impossible: minimum 3.
6. Simply dividing 15 by 8 and rounding up misses the ports consumed by the link between the two proposed switches. Extra cycles between switches only consume more ports and cannot improve the minimum.

Original paper, page 15 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Network field widths

Network Layers & Devices

Question 13, GATE 2018: Match P UDP port, Q Ethernet MAC address, R IPv6 Next Header, S TCP sequence number to I 48, II 8, III 32, IV 16 bits. Options: A P-III,Q-IV,R-II,S-I; B P-II,Q-I,R-IV,S-III; C P-IV,Q-I,R-II,S-III; D P-IV,Q-I,R-III,S-II.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Method

A UDP source or destination port is a 16-bit field, allowing 65536 numeric values. A conventional Ethernet address is six octets, hence 48 bits. IPv6 Next Header is a one-octet protocol identifier, not a pointer-sized field. TCP’s sequence space has 232 byte positions. These independent facts yield the complete matching; confusing byte lengths with bit lengths is the main arithmetic trap.

Solution

UDP port numbers have 16 bits; Ethernet MAC addresses 48; IPv6 Next Header8; TCP sequence numbers 32. Therefore P-IV, Q-I, R-II, S-III, C.

Original paper, page 7 · Answer key

1 mark · MCQ
Report issue

Network Layers & Devices

Question 23, GATE 2014: Which OSI layer/function pair is incorrect? A network/routing; B data link/bit synchronization; C transport/end-to-end process communication; D MAC sublayer/channel sharing.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step 1: Routing is a network-layer responsibility, and transport connects application processes end to end. MAC governs access to a shared communication medium. These match A, C and D. Step 2: Bit synchronization concerns physical timing: identifying bit boundaries in a signal. That belongs to the physical layer rather than the data-link layer. Step 3: Hence B is the incorrect pair. Distinguish bit timing from data-link framing and error detection.

Original paper, page 58 · Answer key

1 mark · MCQ
Report issue

Layer processing across two routers

Network Layers & Devices

Question 14, GATE 2013: S sends a packet to D via two routers, S–R1–R2–D. Count network-layer and data-link-layer visits, respectively. A4/4; B4/3; C4/6; D2/6.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

The network layer is visited at the source, each of the two routers, and the destination: 4 times. There are three links, and each requires a data-link send and receive, so the data-link layer is visited 6 times. Hence C.

Count at nodes and links separately. Network-layer processing occurs at S, R1, R2, D, once at each. The links are S–R1, R1–R2, R2–D. Each link has a sending data-link action and a receiving data-link action, so three links contribute six visits. A router participates in two data-link interfaces: it receives one frame and constructs/transmits another, while forwarding the enclosed network packet.

Original paper, page 4 · Answer key

1 mark · MCQ
Report issue

Application-layer protocol data unit

Network Layers & Devices

Question 10, GATE 2012: The protocol data unit (PDU) for the application layer in the Internet stack is
        (A) Segment             (B) Datagram               (C) Message            (D) Frame
Tap to enlarge
Your answer
Answer & solution

Official answer: C

The generic PDU at the application layer is a message. Segment is associated with TCP at transport, datagram with connectionless network/transport use, and frame with the data-link layer. Hence C.

Check: Encapsulation gives the useful hierarchy: application message, transport segment (TCP), network datagram or packet, and link frame. The question asks for the application unit before lower-layer headers are added.

Original paper, page 3 · Answer key

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Protocols matched to functional network layers

Network Layers & Devices

Question 70, GATE 2007: Match P: SMTP, Q: BGP, R: TCP, S: PPP to 1: Application, 2: Transport, 3: Data link, 4: Network, 5: Physical layer.
Options:
(A) P-2,Q-1,R-3,S-5
(B) P-1,Q-4,R-2,S-3
(C) P-1,Q-4,R-2,S-5
(D) P-2,Q-4,R-1,S-3
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. SMTP transfers mail, TCP provides end-to-end transport, and PPP frames data on a link. The offered matching classifies BGP by its routing function; its TCP-based transport is a separate layering nuance.

2. Derivation and interpretation. SMTP provides application-layer mail transfer (1); BGP performs interdomain routing, conventionally classified here by its network-layer function (4); TCP is transport-layer (2); PPP is data-link-layer (3). Thus P-1,Q-4,R-2,S-3, option B. BGP actually exchanges control messages over TCP, so its implementation can also be described as an application-layer protocol; the offered matching uses routing function.

Original paper, page 17

2 marks · MCQ
Report issue

Spanning-tree bridge traversal

Network Layers & Devices

Question 82, GATE 2006: Transparent bridges B1,…,B5 connect six LANs. The following connection list fully specifies the figure; Bk:p denotes port p of bridge k:
LAN H1,H2: B1:1, B5:2, B3:4.
LAN H3,H4: B1:2, B5:3, B3:3.
LAN H5,H6: B5:1, B3:1, B4:1, B2:2.
LAN H7,H8: B5:4, B3:2, B4:2, B2:1.
LAN H9,H10: B4:3.
LAN H11,H12: B2:3.
The bridge with lowest serial number is root. Every bridge selects a shortest path to the root; equal root-port choices prefer lower port index. For forwarding onto a LAN, bridges closer to the root win, then lower bridge serial number. Which listed order is a depth-first traversal of the resulting bridge spanning tree?
Options:
(A) B1,B5,B3,B4,B2
(B) B1,B3,B5,B2,B4
(C) B1,B5,B2,B3,B4
(D) B1,B3,B4,B5,B2
Question 82, GATE 2006: Transparent bridges B1,…,B5 connect six LANs. The following connection list fully specifies the figure; Bk:p denotes port p of bridge k:
LAN H1,H2: B1:1, B5:2, B3:4.
LAN H3,H4: B1:2, B5:3, B3:3.
LAN H5,H6: B5:1, B3:1, B4:1, B2:2.
LAN H7,H8: B5:4, B3:2, B4:2, B2:1.
LAN H9,H10: B4:3.
LAN H11,H12: B2:3.
The bridge with lowest serial number is root. Every bridge selects a shortest path to the root; equal root-port choices prefer lower port index. For forwarding onto a LAN, bridges closer to the root win, then lower bridge serial number. Which listed order is a depth-first traversal of the resulting bridge spanning tree?
Options:
(A) B1,B5,B3,B4,B2
(B) B1,B3,B5,B2,B4
(C) B1,B5,B2,B3,B4
(D) B1,B3,B4,B5,B2
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. B1 is the root (lowest serial number). B5 and B3 both connect directly to the two top LANs: B5 chooses root port 2 over 3, while B3 chooses root port 3 over 4.

2. On each middle LAN B3 wins the designated-bridge tie against B5 because 3<5. B4 chooses its root port 1 via the H5/H6 LAN; B2 chooses root port 1 via the H7/H8 LAN.

3. Thus the bridge tree has edges B1–B5, B1–B3, B3–B4, B3–B2. Among listed sequences only B1,B5,B3,B4,B2 is a depth-first traversal, A.

4. (Other child orders can give other valid DFS sequences, but the other listed sequences leave B3’s subtree prematurely.)

5. Teaching check: After choosing root ports, compare B3 and B5 on the middle LANs: both are one bridge-hop from B1, so B3’s smaller ID wins. B4 and B2 consequently attach under B3. A depth-first traversal must finish B3’s children before returning to visit sibling B5.

Original paper, page 13

2 marks · MCQ
Report issue

Forwarding ports on bridge B3

Network Layers & Devices

Question 83, GATE 2006: Transparent bridges B1,…,B5 connect six LANs. The following connection list fully specifies the figure; Bk:p denotes port p of bridge k:
LAN H1,H2: B1:1, B5:2, B3:4.
LAN H3,H4: B1:2, B5:3, B3:3.
LAN H5,H6: B5:1, B3:1, B4:1, B2:2.
LAN H7,H8: B5:4, B3:2, B4:2, B2:1.
LAN H9,H10: B4:3.
LAN H11,H12: B2:3.
The bridge with lowest serial number is root. Every bridge selects a shortest path to the root; equal root-port choices prefer lower port index. For forwarding onto a LAN, bridges closer to the root win, then lower bridge serial number. For the resulting tree, after H1 sends a broadcast ping, which listed forwarding table describes B3? Tables list destination groups and outgoing port. D retains the reproduced H7 duplication.
Options:
(A) H1,H2,H3,H4→3; H5,H6,H9,H10→1; H7,H8,H11,H12→2
(B) H1,H2→4; H3,H4→3; H5,H6→1; H7,H8,H9,H10,H11,H12→2
(C) H3,H4→3; H5,H6,H9,H10→1; H1,H2→4; H7,H8,H11,H12→2
(D) H1,H2,H3,H4→3; H5,H7,H9,H10→1; H7,H8,H11,H12→4
Question 83, GATE 2006: Transparent bridges B1,…,B5 connect six LANs. The following connection list fully specifies the figure; Bk:p denotes port p of bridge k:
LAN H1,H2: B1:1, B5:2, B3:4.
LAN H3,H4: B1:2, B5:3, B3:3.
LAN H5,H6: B5:1, B3:1, B4:1, B2:2.
LAN H7,H8: B5:4, B3:2, B4:2, B2:1.
LAN H9,H10: B4:3.
LAN H11,H12: B2:3.
The bridge with lowest serial number is root. Every bridge selects a shortest path to the root; equal root-port choices prefer lower port index. For forwarding onto a LAN, bridges closer to the root win, then lower bridge serial number. For the resulting tree, after H1 sends a broadcast ping, which listed forwarding table describes B3? Tables list destination groups and outgoing port. D retains the reproduced H7 duplication.
Options:
(A) H1,H2,H3,H4→3; H5,H6,H9,H10→1; H7,H8,H11,H12→2
(B) H1,H2→4; H3,H4→3; H5,H6→1; H7,H8,H9,H10,H11,H12→2
(C) H3,H4→3; H5,H6,H9,H10→1; H1,H2→4; H7,H8,H11,H12→2
(D) H1,H2,H3,H4→3; H5,H7,H9,H10→1; H7,H8,H11,H12→4
Question 83, GATE 2006: Transparent bridges B1,…,B5 connect six LANs. The following connection list fully specifies the figure; Bk:p denotes port p of bridge k:
LAN H1,H2: B1:1, B5:2, B3:4.
LAN H3,H4: B1:2, B5:3, B3:3.
LAN H5,H6: B5:1, B3:1, B4:1, B2:2.
LAN H7,H8: B5:4, B3:2, B4:2, B2:1.
LAN H9,H10: B4:3.
LAN H11,H12: B2:3.
The bridge with lowest serial number is root. Every bridge selects a shortest path to the root; equal root-port choices prefer lower port index. For forwarding onto a LAN, bridges closer to the root win, then lower bridge serial number. For the resulting tree, after H1 sends a broadcast ping, which listed forwarding table describes B3? Tables list destination groups and outgoing port. D retains the reproduced H7 duplication.
Options:
(A) H1,H2,H3,H4→3; H5,H6,H9,H10→1; H7,H8,H11,H12→2
(B) H1,H2→4; H3,H4→3; H5,H6→1; H7,H8,H9,H10,H11,H12→2
(C) H3,H4→3; H5,H6,H9,H10→1; H1,H2→4; H7,H8,H11,H12→2
(D) H1,H2,H3,H4→3; H5,H7,H9,H10→1; H7,H8,H11,H12→4
Question 83, GATE 2006: Transparent bridges B1,…,B5 connect six LANs. The following connection list fully specifies the figure; Bk:p denotes port p of bridge k:
LAN H1,H2: B1:1, B5:2, B3:4.
LAN H3,H4: B1:2, B5:3, B3:3.
LAN H5,H6: B5:1, B3:1, B4:1, B2:2.
LAN H7,H8: B5:4, B3:2, B4:2, B2:1.
LAN H9,H10: B4:3.
LAN H11,H12: B2:3.
The bridge with lowest serial number is root. Every bridge selects a shortest path to the root; equal root-port choices prefer lower port index. For forwarding onto a LAN, bridges closer to the root win, then lower bridge serial number. For the resulting tree, after H1 sends a broadcast ping, which listed forwarding table describes B3? Tables list destination groups and outgoing port. D retains the reproduced H7 duplication.
Options:
(A) H1,H2,H3,H4→3; H5,H6,H9,H10→1; H7,H8,H11,H12→2
(B) H1,H2→4; H3,H4→3; H5,H6→1; H7,H8,H9,H10,H11,H12→2
(C) H3,H4→3; H5,H6,H9,H10→1; H1,H2→4; H7,H8,H11,H12→2
(D) H1,H2,H3,H4→3; H5,H7,H9,H10→1; H7,H8,H11,H12→4
Tap to enlarge
Your answer
Answer & solution

Answer: A, as complete topology-consistent forwarding table (no official key was published)

1. Using Q82’s spanning tree, B3 reaches both top LANs through root port 3: H1,H2,H3,H4→3. Its port 1 connects the H5/H6 LAN and B4 leading to H9/H10: H5,H6,H9,H10→1.

2. Port 2 connects the H7/H8 LAN and B2 leading to H11/H12: H7,H8,H11,H12→2. This is A; B3 port 4 is blocked.

3. A broadcast from H1 arrives at B3 on port 3.

4. Teaching check: Interpret the table as the forwarding directions implied by the converged spanning tree. A single broadcast frame teaches a learning bridge only the source’s direction, not every destination entry by itself. The full table in the options therefore describes the tree-based routes, rather than a complete table learned solely from that one frame.

Original paper, page 13

1 mark · MCQ
Report issue

Purpose of a bridge spanning tree

Network Layers & Devices

Question 26, GATE 2005: Why use spanning tree among LAN bridges? A shortest paths; B avoid forwarding loops; C fault tolerance; D minimize collisions.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

A spanning tree leaves a connected forwarding topology without cycles. This prevents frames, especially flooded broadcasts/unknown unicasts, from circulating indefinitely and being duplicated. Thus B; spanning-tree forwarding does not promise pairwise shortest routes.

Flooded frames do not have an IP-style hop limit at the bridging layer. A forwarding cycle can therefore cause copies to circulate and multiply. The spanning-tree protocol disables redundant paths to leave a connected acyclic active topology, preventing that loop. It can reconfigure after faults, but the question’s direct purpose is B; pairwise routes need not be shortest.

Original paper, page 3

1 mark · MCQ
Report issue

Layer-function matching

Network Layers & Devices

Question 15, GATE 2004: Match layers P=data link, Q=network, R=transport with: (1) reliable transfer over a physical point-to-point link; (2) encode/decode data for physical transmission; (3) end-to-end communication between processes; (4) route data from one network node to the next.
Options:
(A) P-1,Q-4,R-3
(B) P-2,Q-4,R-1
(C) P-2,Q-3,R-1
(D) P-1,Q-3,R-2
Question 15, GATE 2004: Match layers P=data link, Q=network, R=transport with: (1) reliable transfer over a physical point-to-point link; (2) encode/decode data for physical transmission; (3) end-to-end communication between processes; (4) route data from one network node to the next.
Options:
(A) P-1,Q-4,R-3
(B) P-2,Q-4,R-1
(C) P-2,Q-3,R-1
(D) P-1,Q-3,R-2
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. The data-link layer supplies link-local transfer/reliability, P→1; the network layer routes between nodes, Q→4; the transport layer supports end-to-end process communication, R→3. Thus A.

2. Physical encoding/decoding belongs to the physical layer rather than these three.

3. Teaching check: Ask what the communication endpoints are: adjacent link endpoints identify the data-link layer; hosts or network nodes identify routing; application processes identify transport. Encoding bits onto a physical medium is the unused physical-layer description, not a network-layer function.

Original paper, page 2

1 mark · MCQ
Report issue

Bridge and router addressing

Network Layers & Devices

Question 16, GATE 2004: Which statement about a transparent bridge and a router is NOT true?
Options:
(A) Both selectively forward data packets
(B) A bridge uses IP addresses while a router uses MAC addresses
(C) A bridge builds its forwarding table by inspecting incoming packets
(D) A router can connect a LAN to a WAN
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. A transparent bridge forwards using learned MAC addresses, while an IP router forwards using network-layer IP addresses. Option B reverses these roles and is false.

2. Both can selectively forward, bridges learn source addresses from arriving frames, and routers can join LANs to WANs.

3. Teaching check: A learning bridge records the source MAC and incoming port of received frames, then consults destination MACs for forwarding. A router performs a network-prefix lookup on a destination IP address. Reversing these address families is the decisive false statement.

Original paper, page 3