Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Traditional switch architecture and data centres

Clear study notes on traditional switch architecture (control plane vs data plane, forwarding, MAC learning, CAM/TCAM, store‑and‑forward and cut‑through) and their role inside data-centre networks.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Two sentences: Traditional switch architecture is the foundation of how packets are forwarded inside a data centre. Engineers use it to design, troubleshoot and size networks (switch choice, buffer sizing, forwarding-table capacity) before moving on to SDN and data-centre overlays.

Key ideas

All definitions are given simply and then used in derivations.

  • Definition: Switch — a device that forwards Ethernet frames between ports based on link-layer (MAC) addresses. Assumes a shared Ethernet frame format (IEEE 802.3) and point-to-point or multiport physical links.

  • Definition: Data plane — the part of the switch that moves packets/frames and performs fast lookup and forwarding. It includes line cards, switching fabric, packet buffers, and hardware CAM/TCAM. Assumes forwarding must meet line-rate performance.

  • Definition: Control plane — the part that builds or updates forwarding state and runs protocols (for example, STP, routing, management). It uses software/CPU and is not in the fast path for every packet.

  • Definition: Forwarding table (MAC table / FIB) — a table mapping destination addresses (or prefixes) to output ports and actions. Assumption: exact-match on MAC addresses for L2 switching; longest-prefix match for routed L3.

  • Definition: MAC learning — the algorithm by which a switch learns the mapping from source MAC address to the ingress port and populates the forwarding table. Exact statement: If a frame arrives on port P with source MAC S, then the switch records entry (S -> P) with a timestamp. If destination D has no entry, the switch floods the frame to all ports except P. This assumes symmetric links and that entry aging removes stale mappings.

  • Definition: Content-Addressable Memory (CAM) — memory that returns the matching address entries in one access (used for fast exact-match MAC lookup). Ternary CAM (TCAM) is CAM that supports three states per bit (0, 1, *) to implement longest-prefix and maskable matches.

  • Definition: Store-and-forward switching — the switch receives the entire frame, performs checks (CRC etc.), and then forwards it. Exact property: forwarding of a frame onto the output port begins only after the entire frame has been received and processed.

  • Definition: Cut-through switching — the switch begins forwarding the frame as soon as it has read the destination MAC address (the first 6 bytes after the Start Frame Delimiter), or enough header to make the forwarding decision (e.g., VLAN tag), before the entire frame arrives. Exact trade-off: lower latency but cannot check full frame CRC before forwarding; many switches therefore use fragment-free cut-through (wait ~64 bytes) or fall back to store-and-forward on errors/congestion; assumes low error rate on links.

  • Performance trade-offs (exact statements):

    • Store-and-forward provides error checking and per-frame buffering, but increases latency by at least one frame transmission time per switch.
    • Cut-through reduces latency by starting transmission earlier, but may propagate corrupted frames.
  • Typical switch hardware blocks to draw and label (diagram description): Draw a rectangular chassis. Inside, place and label: (left) multiple line cards (each with ports), (center) switching fabric/backplane, (top-right) control-plane CPU and management interfaces, (bottom-right) power supplies. For a line card zoom-in, draw: ingress parser -> lookup (CAM/TCAM) -> buffer memory -> forwarding engine -> egress scheduler -> MAC/PHY. Also label the CAM/TCAM and packet buffers near the lookup stage.

Assumptions used above: Ethernet framing, full duplex links, and that forwarding decisions are based on hardware lookup for line-rate performance. Also know the classic queuing architectures: input-queued vs output-queued vs shared-memory switches; head-of-line (HOL) blocking in input-queued designs; virtual output queuing (VOQ) and fabric speedup to avoid HOL.

Formulas

T_tx = L / R — where T_tx is frame transmission time, L is frame size in bits (bit), R is link rate (bit·s^-1). Applies for all link-layer frame transmissions.

T_store_switch = 2·T_tx + T_proc — where T_store_switch is the per-switch latency for store-and-forward switching measured from first-bit-in to last-bit-out, T_proc is internal processing time (s). Assumes output port idle when forwarding begins and input and output link rates equal.

T_end_to_end = (N+1)·T_tx + N·T_proc + T_prop_total — for a path with N switches between sender and receiver: (N+1) links, N switch processing delays, and T_prop_total total propagation delay (s). Applies when store-and-forward switching is used at each switch.

Table_memory = N_entries · Entry_size — where Table_memory is bytes of table/storage required, N_entries is number of forwarding entries, Entry_size in bytes. Applies when estimating memory used by CAM or software table.

Throughput = Frames / Time — units: frames·s^-1 or convert to bits·s^-1 by multiplying average frame size. Applies for measuring switch forwarding at steady state.

Worked examples

Example 1 — Store-and-forward latency across 3 switches (numerical) Given: frame size = 1500 B (standard MTU), link rate R = 1 Gbit·s^-1, N = 3 switches between sender and receiver, per-switch processing T_proc = 5 μs, propagation delay per link = 2 μs (four links total). Step 1: Convert L to bits: L = 1500 B · 8 = 12000 bits. Step 2: Compute T_tx = L / R = 12000 / (1·10^9) = 12·10^-6 s = 12 μs. Step 3: Compute T_prop_total = 4 links · 2 μs = 8 μs. Step 4: Use formula: T_end_to_end = (N+1)·T_tx + N·T_proc + T_prop_total = (3+1)·12 μs + 3·5 μs + 8 μs = 48 μs + 15 μs + 8 μs = 71 μs. Answer: Total end-to-end delay = 71 μs.

Example 2 — MAC learning and forwarding (algorithm trace) Network: Switch with ports P1..P4. Hosts: H1 on P1 (MAC A), H2 on P2 (MAC B), H3 on P3 (MAC C). Initial switch table empty. Traffic:

  1. H1 sends frame to H2. Switch receives source A on P1 -> learn (A->P1). Destination B not in table -> flood to P2,P3,P4. Frame arrives at H2.
  2. H2 replies to H1. Switch sees source B on P2 -> learn (B->P2). Destination A found -> forward only to P1.
  3. H3 sends to H2. Switch learns (C->P3) and forwards to P2. Final forwarding table (show as rows): A -> P1 B -> P2 C -> P3 Explain: After these steps the switch no longer floods for these addresses. If H2 moves to P4 later, the switch will refresh table on seeing frames with source B on P4 and update to (B->P4). If entries age out, flooding will reoccur.

Example 3 — Forwarding-table memory sizing (numerical) Given: expected MACs = 16,000, entry size = 16 bytes per MAC (educational estimate: MAC address + VLAN + port + flags/aging). Compute table memory. Step 1: Table_memory = 16000 · 16 B = 256,000 B. Step 2: Convert to KB: 256,000 / 1024 ≈ 250.0 KB. Answer: Approximately 250 KB of RAM required for 16,000 MAC entries.

(Notes: TCAM entries are larger; a reviewer should verify typical entry sizes for vendor hardware. In practice, L2 MAC table entries in ASICs are often on the order of 12–32 bytes, and TCAM entries are larger (e.g., 32–80+ bytes), vendor-specific.)

Common mistakes

  • Using bytes where bits are required in formulas (always convert bytes to bits for transmission time).
  • Thinking CAM and TCAM are the same size: TCAM entries are larger because of mask bits and storage overhead.
  • Assuming cut-through always reduces end-to-end time by exactly T_tx — it reduces reception wait but cannot check CRC, and so may still be held by internal buffers due to congestion.

For your exam

Types of questions you will see:

  • Definitions: define switch, data plane, control plane, CAM/TCAM, store-and-forward, cut-through, MAC learning.
  • Short notes: describe switch hardware blocks, explain trade-offs between store-and-forward and cut-through, or explain where CAM vs TCAM is used.
  • Derivations: show step-by-step calculation of end-to-end delay across N switches (like Example 1). Always state assumptions (equal link rates, processing times per switch, number of links = N+1).
  • Algorithm trace: MAC learning and flooding sequence (like Example 2). Show table entries after each event.
  • Numericals: table memory sizing, link capacity and latency calculations (convert bytes↔bits, carry units through).
  • Diagram tasks: draw a chassis with line cards, switching fabric, control-plane CPU, CAM/TCAM and packet buffers; label ingress and egress paths and show lookup stage.
  • Architectures: compare input-queued vs output-queued vs shared-memory; explain HOL blocking and how VOQ/fabric speedup mitigate it (with a simple sketch if asked).
  • Data-centre basics: spine–leaf (Clos) and ECMP/oversubscription; buffer sizing rule-of-thumb B ≥ RTT×C per port (state units), shallow vs deep buffers, and incast symptoms/mitigations.

What a full-marks answer includes:

  • Clear definitions with assumptions stated.
  • Correct diagram as described above (labelled blocks and arrows) when asked.
  • For derivations: write formulas, show unit conversions, plug numbers and state the final unit.
  • For algorithm traces: show the forwarding table after each step and explain flooding vs unicast decisions.

Quick check

  1. What is the difference between CAM and TCAM in one sentence?
  2. Give the store-and-forward per-switch latency formula and name every symbol.
  3. A 1500 B frame on a 100 Mbps link: what is T_tx in microseconds? (Show conversion.) Answers: 1) CAM supports exact-match lookups (0 or 1) while TCAM supports ternary matches (0,1,*), enabling mask/longest-prefix match; 2) T_store_switch = 2·T_tx + T_proc, where T_store_switch is per-switch latency (first-bit-in to last-bit-out, s), T_tx is frame transmit time L/R (s) and T_proc is internal processing time (s); 3) L=1500·8=12000 bits, R=100·10^6 bit·s^-1 => T_tx=12000/100e6=120·10^-6 s = 120 μs.

If anything in these notes conflicts with your course slides or vendor datasheets, check the vendor-specific values for TCAM entry size and line-card buffer sizes.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?