How unit 2 is examined
The unit covers layer 2: services, framing, flow and error control, sliding-window ARQ, protocol modelling and address resolution. Go-Back-N/Selective Repeat and ARP carry the most marks, then flow control, framing and error control.
Data Link Layer: Need
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. The data link layer is layer 2 of OSI; it turns the raw, error-prone bit pipe of the physical layer into a reliable link for node-to-node delivery of frames.
Key points.
- The physical layer only moves bits and does not know where a message starts or whether it arrived correctly, so a layer above it must add structure and reliability.
- The layer groups bits into frames and adds physical (MAC) addresses so that the correct neighbouring node picks up each frame.
- It detects and corrects transmission errors and stops a fast sender from swamping a slow receiver.
- It shares one medium among many stations through the MAC sublayer.
Services Provided
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. The data link layer provides services to the network layer above it: framing, physical addressing, error control, flow control and access control over a single hop.
Key points.
- Framing packs network-layer packets into frames with header and trailer so the receiver can find frame boundaries.
- Physical addressing puts the sender and receiver MAC addresses in the frame header.
- Error control detects damaged, lost or duplicate frames and recovers them by retransmission.
- Flow control keeps the sender no faster than the receiver can accept.
- Access control (MAC) decides which station may use a shared channel. Services may be unacknowledged connectionless, acknowledged connectionless or acknowledged connection-oriented.
Asked: [7 marks] (May 2023) What is the data link layer and what services does it provide?
Framing
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>
Definition. Framing divides the bit stream into frames, each with header, data and trailer, so the receiver can detect where every frame starts and ends.
Key points.
- Functions of the data link layer are framing, physical addressing, error control, flow control and access control; state these first in a "functions" question.
- Character count puts the frame length in the header's first field; it fails if that count is corrupted, because the receiver loses sync.
- Byte stuffing marks frames with a FLAG byte; a FLAG or ESC byte appearing inside the data is preceded by an ESC byte, and the receiver removes the ESC.
- Bit stuffing uses the flag 01111110; the sender inserts a 0 after every five consecutive 1s in the data, and the receiver deletes a 0 that follows five 1s.
- Physical layer coding violation uses signal patterns that are illegal for data (for example, Manchester code with no mid-bit transition) as delimiters; it works only where the encoding has spare signals.
Example. Bit stuffing: data 0110111110111111 becomes 011011111001111101 (a 0 added after each run of five 1s), placed between two 01111110 flags. Byte stuffing: data A FLAG B is sent as FLAG A ESC FLAG B FLAG; data A ESC B becomes A ESC ESC B.
<mark>Stuffing lets a frame carry any data pattern without the flag being mistaken for a frame boundary.</mark>
Answer frame. Open with the definition of framing; list DLL functions; then character count, byte stuffing with the ESC example, bit stuffing with the 01111110 example, coding violation; close with the note that stuffing keeps the data transparent.
Asked: [7 marks] (May 2022) What is bit and byte stuffing? Explain with example. Asked: [7 marks] (Jun 2026) Explain the functions of the Data Link Layer. Discuss framing techniques in detail.
Flow Control
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>
Definition. Flow control is the set of procedures that stops a fast sender from overwhelming a slow receiver's buffer; the receiver tells the sender when to send.
Key points.
- Stop-and-Wait: the sender sends one frame and waits for its ACK before the next; a timeout triggers retransmission and sequence numbers 0/1 separate a new frame from a duplicate.
- Stop-and-Wait wastes the link because the sender idles for a round trip per frame; efficiency is $\eta = \frac{1}{1+2a}$ with $a = T_p/T_t$.
- Sliding window lets the sender transmit up to $W$ frames without waiting, using sequence numbers; the receiver's window shows which frames it will accept.
- The window slides forward as ACKs arrive, which keeps the pipe full; efficiency is $\eta = \frac{W}{1+2a}$ (at most 1).
- Piggybacking attaches the ACK of received data to an outgoing data frame in the reverse direction. Advantages: saves bandwidth and reduces frame overhead. Disadvantages: more complex, and the ACK is delayed while waiting for a data frame, which can cause a timeout, so an ACK timer is needed.
Example. Window $W=4$, frames 0-7: the sender sends 0,1,2,3; ACK 1 arrives and the window slides to 1-4, so frame 4 may now be sent.
<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u2-01" viewBox="0 0 424 80" width="424" height="80" role="img" aria-label="Sender S sends frames 0-3 (window 4); receiver R ACKs and the window slides"><style>#dsfig-u2-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u2-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u2-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u2-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u2-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u2-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u2-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u2-01 .t{fill:#16181D;font-weight:500}#dsfig-u2-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u2-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u2-01 .dot{fill:#16181D}#dsfig-u2-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u2-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u2-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u2-01 .ah{fill:#454C5A}#dsfig-u2-01 .ah.hi{fill:#2340B8}#dsfig-u2-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u2-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u2-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u2-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u2-01 .e{stroke:#B1B7C3}html.dark #dsfig-u2-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u2-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u2-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u2-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u2-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u2-01 .t{fill:#E6E8ED}html.dark #dsfig-u2-01 .t.inv{fill:#0F1115}html.dark #dsfig-u2-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u2-01 .dot{fill:#E6E8ED}html.dark #dsfig-u2-01 .ann{fill:#8FA3FF}html.dark #dsfig-u2-01 .lbl{fill:#858D9C}html.dark #dsfig-u2-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u2-01 .ah{fill:#B1B7C3}html.dark #dsfig-u2-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u2-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u2-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u2-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah5" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh5" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M58.7,43.5 Q212,72 363.4,43.8" marker-end="url(#ah5)"/><path class="e" d="M365.3,36.5 Q212,8 60.6,36.2" marker-end="url(#ah5)"/><g class="wl"><rect x="188" y="48.8" width="47.1" height="18" rx="9"/><text class="t" x="211.5" y="57.8" dy=".35em" text-anchor="middle">F0-F3</text></g><g class="wl"><rect x="192.1" y="13.2" width="40.8" height="18" rx="9"/><text class="t" x="212.5" y="22.2" dy=".35em" text-anchor="middle">ACK1</text></g><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">S</text><circle class="n" cx="384" cy="40" r="18"/><text class="t" x="384" y="40" dy=".35em" text-anchor="middle">R</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Sender S sends frames 0-3 (window 4); receiver R ACKs and the window slides</figcaption></figure>
| Point | Stop-and-Wait | Sliding Window |
|---|---|---|
| Frames in flight | 1 | Up to W |
| Sequence numbers | 0, 1 | 0 to 2^m - 1 |
| Efficiency | 1/(1+2a), low | W/(1+2a), high |
| Buffers | 1 frame | W frames |
| Best for | Short links | Long, fast links |
<mark>Flow control regulates the sender's speed to the receiver's capacity; sliding window improves on stop-and-wait by pipelining.</mark>
Answer frame. Open with the definition; draw the sender/receiver window diagram or the stop-and-wait timeline; develop stop-and-wait, then sliding window with the W=4 example, then the table; close with piggybacking if asked.
Asked: [7 marks] (Dec 2020) What is meant by Piggybacking? What are its advantages and disadvantages? Asked: [7 marks] (Dec 2020) Explain Flow control and Error control. Asked: [7 marks] (May 2022) Describe the stop and wait flow control technique. Asked: [7 marks] (May 2023) What is the mechanism of sliding window flow control? Explain with an example. Asked: [7 marks] (Jun 2026) Describe flow control techniques. Compare Stop-and-Wait and Sliding Window Protocols.
Error control
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>
Definition. Error control detects damaged or lost frames and corrects them, either by retransmission (ARQ) or by forward error correction (FEC).
Key points.
- Error detection only finds that bits were corrupted; error correction also locates and repairs them.
- Detection methods are parity check, checksum and CRC; Hamming code corrects single-bit errors.
- ARQ (Stop-and-Wait, Go-Back-N, Selective Repeat) uses ACKs, NAKs and timeouts to retransmit bad or lost frames.
- Flow control and error control together give reliable delivery over a noisy channel: flow control paces the sender, error control repairs the damage.
Formula. Hamming: $2^r \ge m + r + 1$; parity bits sit at positions $1,2,4,8,\dots$ and each checks the positions whose binary index contains that power of 2.
Example. Data 10101111, $m=8$, so $r=4$ ($2^4=16\ge13$), 12-bit code. Data goes to positions 3,5,6,7,9,10,11,12 = 1,0,1,0,1,1,1,1.
| Parity | Positions checked | Data 1s | Bit |
|---|---|---|---|
| P1 | 1,3,5,7,9,11 | 3 (odd) | 1 |
| P2 | 2,3,6,7,10,11 | 4 | 0 |
| P4 | 4,5,6,7,12 | 2 | 0 |
| P8 | 8,9,10,11,12 | 4 | 0 |
Encoded word (positions 1 to 12) = 101001001111
Answer frame. Open by defining error detection versus correction; list the methods; for the numerical, give $r$, the table and the final word; close with the flow/error control link.
Asked: [7 marks] (Dec 2024) Explain in detail about the error and flow control mechanisms employed at data link layer. Asked: [7 marks] (Jun 2025) What do you mean by Error detection? Write down the name of methods. An 8-bit with binary value 10101111 is to be encoded using an even-parity Hamming code. What is the binary value after encoding?
Elementary and Sliding Window protocol: 1-bit
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. The elementary protocols are the simplex stop-and-wait ones; the 1-bit sliding window protocol has window size 1 and a 1-bit sequence number (0 or 1).
Key points.
- The sender sends a frame carrying sequence bit 0 and does not send the next until the matching ACK arrives.
- The 1-bit sequence number lets the receiver tell a new frame from a retransmitted duplicate.
- It works in both directions with piggybacked ACKs, but only one frame is outstanding, so utilisation is low on long links.
Go-Back-N
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>
Definition. Sliding window ARQ protocols let the sender keep up to $N$ frames outstanding; Go-Back-N (GBN) has sender window $N$ and receiver window 1, and on an error the sender retransmits the damaged frame and all frames after it.
Key points.
- The sender window size is at most $2^m - 1$ for $m$-bit sequence numbers; larger windows make old and new frames indistinguishable.
- To fill the pipe, $N$ is chosen from the bandwidth-delay product: $N = 1 + 2a$, where $a = T_p/T_t$, bounded by $2^m-1$.
- The receiver accepts frames only in order and discards out-of-order frames, so it needs no buffering.
- ACKs are cumulative: ACK $n$ confirms all frames up to $n-1$.
- A lost or damaged frame is detected when later frames arrive out of order (or on sender timeout); the sender goes back and resends from that frame onward.
- A lost ACK is harmless if a later cumulative ACK arrives before the timer expires; otherwise the timeout resends the window.
- Advantage: simple receiver and high efficiency compared with stop-and-wait. Disadvantage: wasted retransmissions on a noisy link.
Example. $N=4$: frames 0-3 sent, frame 1 lost. Receiver gets 0 (ACK), discards 2 and 3; sender times out and resends 1,2,3.
<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u2-02" viewBox="0 0 424 252" width="424" height="252" role="img" aria-label="GBN with frame 1 lost: the sender goes back and resends 1, 2, 3"><style>#dsfig-u2-02 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u2-02 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u2-02 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u2-02 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u2-02 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u2-02 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u2-02 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u2-02 .t{fill:#16181D;font-weight:500}#dsfig-u2-02 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u2-02 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u2-02 .dot{fill:#16181D}#dsfig-u2-02 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u2-02 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u2-02 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u2-02 .ah{fill:#454C5A}#dsfig-u2-02 .ah.hi{fill:#2340B8}#dsfig-u2-02 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u2-02 .wl .t{font-size:12px;font-weight:700}#dsfig-u2-02 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u2-02 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u2-02 .e{stroke:#B1B7C3}html.dark #dsfig-u2-02 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u2-02 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u2-02 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u2-02 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u2-02 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u2-02 .t{fill:#E6E8ED}html.dark #dsfig-u2-02 .t.inv{fill:#0F1115}html.dark #dsfig-u2-02 .kd{stroke:#E6E8ED}html.dark #dsfig-u2-02 .dot{fill:#E6E8ED}html.dark #dsfig-u2-02 .ann{fill:#8FA3FF}html.dark #dsfig-u2-02 .lbl{fill:#858D9C}html.dark #dsfig-u2-02 .ptr{fill:#8FA3FF}html.dark #dsfig-u2-02 .ah{fill:#B1B7C3}html.dark #dsfig-u2-02 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u2-02 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u2-02 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u2-02 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah6" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh6" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M58.7,43.5 Q212,72 363.4,43.8" marker-end="url(#ah6)"/><path class="e" d="M365.3,36.5 Q212,8 60.6,36.2" marker-end="url(#ah6)"/><path class="e" d="M59,212 L363,212" marker-end="url(#ah6)"/><g class="wl"><rect x="188" y="48.8" width="47.1" height="18" rx="9"/><text class="t" x="211.5" y="57.8" dy=".35em" text-anchor="middle">F0-F3</text></g><g class="wl"><rect x="192.1" y="13.2" width="40.8" height="18" rx="9"/><text class="t" x="212.5" y="22.2" dy=".35em" text-anchor="middle">ACK1</text></g><g class="wl"><rect x="163.7" y="203" width="96.6" height="18" rx="9"/><text class="t" x="212" y="212" dy=".35em" text-anchor="middle">resend-F1-F3</text></g><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">S</text><circle class="n" cx="384" cy="40" r="18"/><text class="t" x="384" y="40" dy=".35em" text-anchor="middle">R</text><circle class="n" cx="40" cy="212" r="18"/><text class="t" x="40" y="212" dy=".35em" text-anchor="middle">T</text><circle class="n" cx="384" cy="212" r="18"/><text class="t" x="384" y="212" dy=".35em" text-anchor="middle">U</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">GBN with frame 1 lost: the sender goes back and resends 1, 2, 3</figcaption></figure>
| Point | Go-Back-N | Selective Repeat |
|---|---|---|
| Sender window | up to 2^m - 1 | up to 2^(m-1) |
| Receiver window | 1 | Same as sender |
| Retransmission | Damaged frame and all after it | Only the damaged frame |
| Receiver buffer | None for out-of-order | Buffers out-of-order frames |
| ACK | Cumulative | Individual, plus NAK |
| Complexity | Low | High |
| Efficiency on noisy link | Lower | Higher |
<mark>In Go-Back-N the receiver window is 1, so one error forces the sender to retransmit that frame and every frame after it.</mark>
Answer frame. Open by defining sliding window ARQ with window $N$; draw the sender-receiver timeline (stop-and-wait, GBN, SR as asked) with a lost frame; explain GBN, then SR (see next topic), then the table; close by stating which suits noisy long links. For the "how is n determined" question, give $2^m-1$ and $1+2a$, then lost frame, lost ACK and timeout.
Asked: [7 marks] (May 2022, Dec 2024, Jun 2026) Describe Go Back N and Selective Repeat protocol. Asked: [7 marks] (Dec 2020) What is Go back N and selective repeat protocol? Asked: [14 marks] (May 2024) With the help of suitable diagrams explain the following protocols of data link layer: a) Stop and wait b) Go back c) Selective repeat. Asked: [14 marks] (Jun 2025) What is the advantage of Go-back-n protocol? How is the parameter 'n' determined? Explain how the protocol works at transport layer in case of errors, lost packet or Acks?
Selective Repeat
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Selective Repeat (SR) is a sliding window ARQ in which the receiver accepts and buffers out-of-order frames and only the damaged or lost frame is retransmitted.
Key points.
- Both sender and receiver windows are $2^{m-1}$ for $m$-bit sequence numbers.
- Each frame is acknowledged individually, and a NAK may ask for a missing frame at once.
- The receiver buffers out-of-order frames and delivers them in order after the gap is filled, so it needs more memory.
- It gives better throughput on noisy links but is more complex than GBN. Stop-and-Wait is the case $N=1$.
Hybrid ARQ
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Hybrid ARQ (HARQ) combines forward error correction with ARQ retransmission: the receiver tries to correct errors, and requests a retransmission only if correction fails.
Key points.
- Each transmission carries error-correcting code plus an error-detecting check such as CRC.
- In Type I, failed frames are discarded and resent; in Type II (incremental redundancy) the receiver combines earlier and retransmitted copies.
- It gives fewer retransmissions than plain ARQ and is used in wireless systems such as LTE.
Protocol verification: Finite State Machine Models & Petri net models
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. A finite state machine (FSM) models a protocol as a set of states, events (frame arrival, timeout) and transitions between states, with an action on each transition.
Key points.
- A protocol machine is drawn as a state graph, for example the sender states "waiting for ACK" and "ready to send" of stop-and-wait.
- Analysing all reachable states finds deadlock, livelock, missing transitions and unspecified receptions.
- An FSM gives an unambiguous specification, so it is used to specify and verify protocols before implementing them.
- A Petri net models the same with places, transitions and tokens; token movement shows concurrency and synchronisation.
Asked: [7 marks] (May 2023) What is finite state machine model? How finite state machines are used in the study of network protocols? Explain.
ARP
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>
Definition. The Address Resolution Protocol (ARP) maps a known 32-bit IP address to the 48-bit MAC address of a host on the same network, because frames need a MAC address.
Key points.
- A host needing a MAC broadcasts an ARP request ("Who has IP X?") in a frame with destination FF:FF:FF:FF:FF:FF.
- Every host on the LAN receives it, but only the host owning IP X replies.
- The reply is a unicast ARP reply carrying its MAC address.
- The sender stores the pair in its ARP cache with a timeout, so repeat sends need no request.
- For a destination outside the LAN, the host resolves the MAC of the default router instead.
- The ARP packet has hardware type, protocol type, operation (1 request, 2 reply), and sender and target MAC and IP; it sits directly on Ethernet at the network layer boundary.
Example. A (10.0.0.1) wants B (10.0.0.2): A broadcasts "Who has 10.0.0.2?"; B replies "10.0.0.2 is at MAC-B"; A caches it and sends the frame.
<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u2-03" viewBox="0 0 424 252" width="424" height="252" role="img" aria-label="A broadcasts an ARP request; only the owner D replies by unicast"><style>#dsfig-u2-03 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u2-03 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u2-03 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u2-03 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u2-03 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u2-03 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u2-03 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u2-03 .t{fill:#16181D;font-weight:500}#dsfig-u2-03 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u2-03 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u2-03 .dot{fill:#16181D}#dsfig-u2-03 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u2-03 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u2-03 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u2-03 .ah{fill:#454C5A}#dsfig-u2-03 .ah.hi{fill:#2340B8}#dsfig-u2-03 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u2-03 .wl .t{font-size:12px;font-weight:700}#dsfig-u2-03 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u2-03 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u2-03 .e{stroke:#B1B7C3}html.dark #dsfig-u2-03 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u2-03 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u2-03 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u2-03 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u2-03 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u2-03 .t{fill:#E6E8ED}html.dark #dsfig-u2-03 .t.inv{fill:#0F1115}html.dark #dsfig-u2-03 .kd{stroke:#E6E8ED}html.dark #dsfig-u2-03 .dot{fill:#E6E8ED}html.dark #dsfig-u2-03 .ann{fill:#8FA3FF}html.dark #dsfig-u2-03 .lbl{fill:#858D9C}html.dark #dsfig-u2-03 .ptr{fill:#8FA3FF}html.dark #dsfig-u2-03 .ah{fill:#B1B7C3}html.dark #dsfig-u2-03 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u2-03 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u2-03 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u2-03 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah7" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh7" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M57,117.5 L193.2,49.4" marker-end="url(#ah7)"/><path class="e" d="M57,134.5 L193.2,202.6" marker-end="url(#ah7)"/><path class="e" d="M58.7,129.5 Q212,158 363.4,129.8" marker-end="url(#ah7)"/><path class="e hi" d="M365.3,122.5 Q212,94 60.6,122.2" marker-end="url(#ahh7)"/><g class="wl"><rect x="95.3" y="74" width="61.5" height="18" rx="9"/><text class="t" x="126" y="83" dy=".35em" text-anchor="middle">request</text></g><g class="wl"><rect x="95.3" y="160" width="61.5" height="18" rx="9"/><text class="t" x="126" y="169" dy=".35em" text-anchor="middle">request</text></g><g class="wl"><rect x="180.8" y="134.8" width="61.5" height="18" rx="9"/><text class="t" x="211.5" y="143.8" dy=".35em" text-anchor="middle">request</text></g><g class="wl hi"><rect x="188.9" y="99.2" width="47.1" height="18" rx="9"/><text class="t" x="212.5" y="108.2" dy=".35em" text-anchor="middle">reply</text></g><circle class="n" cx="40" cy="126" r="18"/><text class="t" x="40" y="126" dy=".35em" text-anchor="middle">A</text><circle class="n" cx="212" cy="40" r="18"/><text class="t" x="212" y="40" dy=".35em" text-anchor="middle">B</text><circle class="n" cx="212" cy="212" r="18"/><text class="t" x="212" y="212" dy=".35em" text-anchor="middle">C</text><circle class="n" cx="384" cy="126" r="18"/><text class="t" x="384" y="126" dy=".35em" text-anchor="middle">D</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">A broadcasts an ARP request; only the owner D replies by unicast</figcaption></figure>
RARP. Reverse ARP finds an IP address from a known MAC address: a diskless host broadcasts its MAC, and a RARP server replies with its IP. Limitation: it needs a server on every network, and gives only an IP, so BOOTP and DHCP replaced it.
Other terms asked with ARP. FDDI: fibre-optic dual counter-rotating token ring at 100 Mbps, data link/physical layers. ICMP: network layer protocol for error and control messages such as ping (echo request/reply). UDP: connectionless transport layer protocol with an 8-byte header (source port, destination port, length, checksum), used in DNS and streaming.
<mark>ARP resolves IP to MAC by broadcast request and unicast reply, and caches the result.</mark>
Answer frame. Open with the definition; draw the broadcast-request and unicast-reply diagram; develop steps 1-4 then cache and router case; add RARP with its limitation; close with the line that ARP works inside one network only.
Asked: [14 marks] (May 2022) Explain the following terms with example: i) FDDI ii) ARP iii) ICMP iv) UDP Asked: [7 marks] (Dec 2024) Explain the working of ARP and RARP.
RARP
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Reverse ARP (RARP) finds the IP address of a host from its known MAC address.
Key points.
- A diskless host broadcasts a RARP request containing its own MAC address.
- A RARP server holding a MAC-to-IP table replies with the IP address.
- A server is needed on every network because the request is a broadcast that routers do not forward.
- It is obsolete, replaced by BOOTP and DHCP.
GARP
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Gratuitous ARP is an ARP request or reply a host sends for its own IP address without being asked.
Key points.
- It announces or updates the host's IP-to-MAC mapping in other hosts' ARP caches, for example after a NIC change or failover.
- It detects duplicate IP addresses: if another host replies, the address is already in use.
- The sender and target IP fields hold the same address, and it is broadcast.
Last-minute revision
- Data link layer = layer 2; frames, MAC addresses, error and flow control, access control.
- Bit stuffing: flag 01111110, insert 0 after five 1s; byte stuffing: ESC before FLAG or ESC.
- Stop-and-Wait efficiency $=1/(1+2a)$; sliding window $=W/(1+2a)$.
- Piggybacking = ACK carried in a data frame going the other way.
- Hamming: $2^r \ge m+r+1$; parity bits at positions 1, 2, 4, 8.
- 10101111 even-parity Hamming = 101001001111.
- GBN: sender window $2^m-1$, receiver window 1, cumulative ACK, resend from error.
- SR: windows $2^{m-1}$, individual ACK/NAK, buffers out-of-order frames.
- HARQ = FEC plus ARQ.
- ARP: IP to MAC, broadcast request, unicast reply, cached; RARP: MAC to IP; GARP: unsolicited announcement.
Memory hooks
- GBN "goes back" and resends everything; SR resends "selectively" the one frame.
- ARP asks everyone (broadcast), only one answers (unicast).
- Hamming parity positions are powers of two: 1, 2, 4, 8.
- Stuffing: five 1s means insert a 0.
- FSM = states + events + transitions.
Coverage checklist
- Data Link Layer: Need - definition, purpose.
- Services Provided - Asked: What is the data link layer and its services (May 2023).
- Framing - Asked: bit and byte stuffing (May 2022); DLL functions and framing (Jun 2026).
- Flow Control - Asked: piggybacking, flow and error control, stop-and-wait, sliding window, compare (Dec 2020, May 2022, May 2023, Jun 2026).
- Error control - Asked: error and flow control mechanisms (Dec 2024); error detection and Hamming numerical (Jun 2025).
- Data Link Layer Protocol: Elementary & Sliding Window protocol: 1-bit - definition and key points.
- Go-Back-N - Asked: GBN and SR (Dec 2020, May 2022, May 2024, Dec 2024, Jun 2025, Jun 2026).
- Selective Repeat - definition and key points.
- Hybrid ARQ - definition and key points.
- Protocol verification: Finite State Machine Models & Petri net models - Asked: FSM model (May 2023).
- ARP - Asked: FDDI, ARP, ICMP, UDP (May 2022); ARP and RARP (Dec 2024).
- RARP - definition and key points.
- GARP - definition and key points.