
This second set of Computer Networks MCQs focuses on the data link layer, where most numerical questions in GATE and university exams come from. It covers framing, error detection codes, sliding window protocols and medium access control, with the working shown for every calculation so you can use it for placement and interview revision too.
How to practise: read each question and tap the option you think is correct. You will see right away whether you got it, along with a short explanation, and your score is tracked at the bottom of the screen. This set has 18 questions.
Topics covered in this set
- Framing, bit stuffing and byte stuffing
- Parity, checksum, CRC and Hamming code
- Stop-and-wait, Go-Back-N and Selective Repeat
- ALOHA, slotted ALOHA and CSMA/CD
- Ethernet, switches, hubs and bridges
- ARP
Computer networks MCQs with answers and explanations
Q1. In HDLC-style bit stuffing, the sender inserts a 0 bit after how many consecutive 1 bits in the data?
a) Four
b) Five
c) Six
d) Seven
Q2. In byte-oriented framing with byte stuffing, what does the sender do when the flag byte appears inside the payload?
a) Inserts an escape (ESC) byte before it
b) Drops the flag byte from the payload
c) Splits the frame into two frames at that point
d) Replaces the flag byte with a parity byte
Q3. The data bits 01111110 are to be sent using bit stuffing. What bit sequence is actually transmitted (excluding the frame flags)?
a) 01111110
b) 0111110110
c) 011111010
d) 0111111010
Q4. A single even parity bit added to each data word can reliably detect which errors?
a) All burst errors of any length
b) All 2-bit errors
c) All single-bit errors and correct them
d) Any error that flips an odd number of bits
Q5. The data 110101 is sent using CRC with generator polynomial x^2 + 1 (divisor 101). Which CRC bits are appended to the data?
a) 11
b) 01
c) 10
d) 00
Q6. How many redundant (check) bits does a Hamming code need to correct single-bit errors in 7 data bits?
a) 2
b) 3
c) 4
d) 5
Q7. A block code has a minimum Hamming distance of 5. Up to how many bit errors per codeword can it correct?
a) 1
b) 2
c) 4
d) 5
Q8. How is the Internet checksum used by IP, TCP and UDP computed?
a) Two's complement sum of all 32-bit words
b) XOR of all bytes in the packet
c) Remainder of polynomial division by a generator
d) One's complement of the one's complement sum of all 16-bit words
Q9. What are the minimum and maximum sizes of a classic IEEE 802.3 Ethernet frame, counting header and CRC but not the preamble?
a) 64 bytes and 1518 bytes
b) 46 bytes and 1500 bytes
c) 64 bytes and 1500 bytes
d) 72 bytes and 1526 bytes
Q10. A 24-port Layer 2 switch has one host connected to each port and no VLANs configured. How many collision domains and broadcast domains are there?
a) 1 collision domain and 1 broadcast domain
b) 1 collision domain and 24 broadcast domains
c) 24 collision domains and 1 broadcast domain
d) 24 collision domains and 24 broadcast domains
Q11. Which statement about ARP on an Ethernet LAN is correct?
a) The ARP request is unicast and the ARP reply is broadcast
b) The ARP request is broadcast and the ARP reply is unicast
c) ARP finds the IP address when the MAC address is known
d) ARP messages are carried inside TCP segments
Q12. A stop-and-wait link has bandwidth 1 Mbps, frame size 1000 bits and one-way propagation delay 10 ms. Ignoring ACK transmission and processing time, what is the link utilisation?
a) About 9.09%
b) About 4.76%
c) 50%
d) About 33.3%
Q13. Go-Back-N ARQ uses 3-bit sequence numbers. What is the maximum sender window size?
a) 7
b) 8
c) 4
d) 3
Q14. Selective Repeat ARQ uses 4-bit sequence numbers. What is the maximum window size (sender and receiver windows equal)?
a) 15
b) 16
c) 7
d) 8
Q15. On a link, frame transmission time is 1 ms and one-way propagation delay is 20 ms. What is the minimum sender window (in frames) for a sliding window protocol to keep the link 100% busy?
a) 20
b) 40
c) 41
d) 21
Q16. What is the maximum throughput of pure ALOHA, and at what offered load G does it occur?
a) 18.4% at G = 0.5
b) 36.8% at G = 1
c) 18.4% at G = 1
d) 36.8% at G = 0.5
Q17. In a slotted ALOHA network the offered load is G = 0.5 frames per slot. What is the throughput S?
a) About 18.4%
b) About 30.3%
c) About 36.8%
d) 50%
Q18. A CSMA/CD network runs at 10 Mbps over a 2 km cable with signal speed 2 x 10^8 m/s. What is the minimum frame size needed so that collisions are always detected?
a) 100 bits
b) 400 bits
c) 25 bits
d) 200 bits
Quick revision notes
- Bit stuffing inserts a 0 after five consecutive 1s so data never mimics the 01111110 flag.
- Hamming code needs r check bits where 2^r >= m + r + 1; detect d errors needs distance d + 1, correct t needs 2t + 1.
- CRC: append (degree of generator) zeros, divide modulo-2, and send data plus remainder.
- Stop-and-wait efficiency = 1 / (1 + 2a), where a = propagation delay / transmission time.
- Max window: Go-Back-N = 2^n - 1, Selective Repeat = 2^(n-1) for n-bit sequence numbers.
- Pure ALOHA peaks at 18.4% (G = 0.5); slotted ALOHA peaks at 36.8% (G = 1).
- CSMA/CD minimum frame size = 2 x propagation delay x bandwidth; classic Ethernet uses 64 bytes.
- Hub: one collision domain; switch and bridge: one collision domain per port; router splits broadcast domains.
Frequently asked questions
What is the difference between error detection and error correction at the data link layer?
Detection codes such as parity, checksum and CRC only tell the receiver that something went wrong, after which the frame is discarded and retransmitted. Correction codes such as Hamming code carry enough redundancy to locate and fix the faulty bits without retransmission, at the cost of more check bits.
Why does Selective Repeat need a smaller window than Go-Back-N for the same sequence number bits?
In Selective Repeat the receiver also has a window and accepts out-of-order frames. If the window were larger than half the sequence space, a retransmitted old frame could fall inside the receiver's new window and be accepted as new data, so the window is limited to 2^(n-1).
Why does CSMA/CD need a minimum frame size?
A station detects a collision only while it is still transmitting. If a frame finishes before the collision signal from the far end of the cable can return, the sender would wrongly assume success, so the frame must last at least one round-trip propagation time.
Comments
Post a Comment