UNIT 1: DATA COMMUNICATION
1.0 INTRODUCTION TO DATA COMMUNICATION
1.1 Definition, Components, and Characteristics
-
Definition: The transmission of data (digital or analog) from a source to a destination through a communication medium.
-
Core Components:
-
Source (Sender): Generates data to be sent (e.g., computer, sensor).
-
Transmitter: Converts data into transmittable signals (e.g., modem, network interface card).
-
Transmission Medium: Physical path for signal travel (guided: cable; unguided: air).
-
Receiver: Converts received signal back into data.
-
Destination (Sink): Intended recipient of the data.
-
-
Key Characteristics:
-
Delivery: Accuracy and completeness.
-
Timeliness: On-time delivery (real-time vs. store-and-forward).
-
Jitter: Variation in packet arrival time (critical for streaming).
-
Throughput: Actual data transfer rate (bps).
-
Reliability: Probability of error-free transmission.
-
1.2 Data Representation and Signals
-
Analog Signals: Continuous waveforms (e.g., voice, sine wave). Represented by amplitude, frequency, phase.
-
Digital Signals: Discrete, binary pulses (0s and 1s). Represented by voltage levels (e.g., 0V for 0, +5V for 1).
-
Conversion:
-
Digital-to-Analog (Modulation): Modem. Techniques: ASK, FSK, PSK.
-
Analog-to-Digital (Sampling): PCM (Pulse Code Modulation). Nyquist Theorem: Sampling rate ≥ 2 × max frequency.
-
1.3 Transmission Modes
| Mode | Direction | Example |
|---|---|---|
| Simplex | One-way only | Keyboard → Computer, TV Broadcast |
| Half-Duplex | Two-way, but not simultaneous | Walkie-talkie, Traditional Ethernet (CSMA/CD) |
| Full-Duplex | Two-way simultaneously | Telephone, Modern Switched Ethernet |
1.4 Transmission Directions
-
Serial Transmission: Bits sent sequentially over a single path. Used for long distances (e.g., USB, SATA, network links). Lower cost, less error-prone.
-
Parallel Transmission: Multiple bits sent simultaneously over multiple paths. Used for short distances (e.g., internal computer buses, printer ports). Higher speed, more crosstalk.
[!TIP] Exam Focus: Be prepared to draw waveforms for NRZ, RZ, etc., and differentiate serial vs. parallel with real-world examples.
2.0 NETWORK FUNDAMENTALS & TOPOLOGY
2.1 Network Topology Concepts
-
Definition: The physical or logical arrangement of nodes (devices) and links (connections) in a network.
-
Common Physical Topologies:
| Topology | Description | Advantages | Disadvantages |
|---|---|---|---|
| Bus | All nodes share a single central cable (backbone). | Simple, cheap, easy to extend. | Single point of failure (backbone), performance degrades with nodes, difficult fault isolation. |
| Star | All nodes connect to a central hub/switch. | Easy to install/manage, single node failure doesn't affect others, central monitoring. | Central device failure brings down network, more cable required. |
| Ring | Nodes form a closed loop; data travels in one direction (token passing). | Deterministic access (no collisions), good for high-load environments. | Single node/link failure breaks ring, adding/removing nodes is complex. |
| Mesh | Every node has a dedicated link to every other node. | High reliability, redundancy, no traffic congestion. | Extremely expensive, high cabling complexity, difficult to install. |
| Tree/Hybrid | Hierarchical (bus of stars) or combination of topologies. | Scalable, manageable, supports large networks. | Depends on root node; complex design. |
2.2 Network Classification (by geographical scope)
| Type | Scope | Typical Size | Example Technology |
|---|---|---|---|
| PAN | Personal Area | ~10 m | Bluetooth, USB |
| LAN | Local Area | Building/Campus | Ethernet (802.3), Wi-Fi (802.11) |
| MAN | Metropolitan Area | City | DQDB (802.6), SMDS |
| WAN | Wide Area | Country/Globe | Internet, ATM, Frame Relay, MPLS |
2.3 Internetworking
-
Connecting multiple networks of different types (e.g., LAN to WAN) using routers or gateways.
-
Requires common protocol suites (e.g., TCP/IP) and addressing schemes (e.g., IP addresses).
3.0 TRANSMISSION MEDIA & LINE ENCODING
3.1 Guided Media
-
Twisted Pair (UTP/STP): Two insulated copper wires twisted. UTP (Cat5e/6) for LANs; STP has shielding for noisy environments. Limited bandwidth (~100 MHz), susceptible to EMI.
-
Coaxial Cable: Central conductor, insulator, shield, jacket. Baseband (single signal, e.g., Ethernet) vs. Broadband (multiple signals, e.g., cable TV). Better shielding than TP, higher bandwidth (~500 MHz).
-
Fiber Optic: Glass/plastic core, cladding. Light pulses transmit data.
-
Single-mode: Small core, one light ray. Long distance, high bandwidth (100+ Gbps).
-
Multi-mode: Larger core, multiple rays. Shorter distance, cheaper.
-
Advantages: Immune to EMI, high security, low attenuation, high bandwidth.
-
3.2 Unguided Media (Wireless)
-
Radio Waves: Omnidirectional, penetrate walls. Used for Wi-Fi, Bluetooth, cellular.
-
Microwave: Directional, line-of-sight (LOS). Terrestrial (towers) & Satellite (GHz range). Requires repeaters.
-
Infrared: Short range, LOS, cannot penetrate walls. Used for remote controls, IrDA.
-
Satellite: Microwave-based; covers vast areas, high latency (~270 ms for GEO).
3.3 Transmission Impairments
| Impairment | Cause | Effect | Mitigation |
|---|---|---|---|
| Attenuation | Medium resistance | Signal strength loss over distance | Use amplifiers/repeaters, choose low-loss media (fiber). |
| Distortion | Different propagation speeds for frequencies | Signal shape changes (especially in baseband) | Use equalizers, limit bandwidth. |
| Noise | Unwanted energy from external/internal sources | Random bits flip (1→0 or 0→1). Types: Thermal, Crosstalk, Impulse. | Shielding, proper grounding, error detection/correction. |
| Interference | External signals (e.g., EMI from motors) | Corrupts signal | Use shielded media, frequency hopping, spread spectrum. |
3.4 Line Encoding Schemes
-
Purpose: Convert binary data into digital signals for baseband transmission. Defines voltage/current transitions.
-
Schemes:
| Category | Scheme | Key Feature | DC Component? | Synchronization? |
|---|---|---|---|---|
| Unipolar | NRZ (Non-Return-to-Zero) | 0=0V, 1=+V | Yes (problematic) | No (long 1s/0s lose sync) |
| Polar | NRZ-L (Level) | 0=+V, 1=-V (or vice versa) | Yes | No |
| NRZ-I (Inverted) | Transition at 1, no transition at 0 | No | No | |
| RZ (Return-to-Zero) | Mid-bit transition to 0V | Yes | Yes (self-clocking) | |
| Bipolar | AMI (Alternate Mark Inversion) | 0=0V, 1 alternates +V/-V | No | No (long 0s problem) |
| HDB3 (High-Density Bipolar-3) | Replaces 4 consecutive 0s with B00V or 000V |
No | Yes (solves long 0s) | |
| Block | 4B/5B | 4 data bits → 5 code bits (no >1 zero run) | No | Yes (used in Fast Ethernet, FDDI) |
| 8B/10B | 8 data bits → 10 code bits (DC balance, disparity control) | No | Yes (used in Gigabit Ethernet, Fibre Channel, PCIe) |
[!TIP] Exam Tip: Be ready to encode a given bit sequence (e.g.,
1011001) using NRZ-L, NRZ-I, AMI, and explain HDB3 substitution rules.
4.0 REFERENCE MODELS
4.1 OSI Seven-Layer Model
| Layer | PDU (Protocol Data Unit) | Key Functions | Devices |
|---|---|---|---|
| 7. Application | Data | Network software interface (HTTP, FTP, SMTP). User services. | - |
| 6. Presentation | Data | Data translation, encryption/decryption, compression. | - |
| 5. Session | Data | Establishes, manages, terminates sessions (dialog control). | - |
| 4. Transport | Segment (TCP) / Datagram (UDP) | End-to-end connection, reliability (TCP: flow control, error recovery), segmentation/reassembly. | Gateway (app layer) |
| 3. Network | Packet / Datagram | Logical addressing (IP), routing (path determination), congestion control. | Router |
| 2. Data Link | Frame | Framing, physical addressing (MAC), error detection (CRC), flow control (link layer). | Switch, Bridge |
| 1. Physical | Bits / Signals | Media/interface specs, bit synchronization, line encoding, transmission mode. | Repeater, Hub |
-
Encapsulation: Data → (Presentation) → (Session) → (Transport: Segment) → (Network: Packet) → (Data Link: Frame) → (Physical: Bits).
-
Layer-to-Layer Interaction: Each layer adds its header (and sometimes trailer) to the PDU from the layer above. The receiving peer layer removes the header/trailer.
4.2 TCP/IP Protocol Suite (Four-Layer Model)
| TCP/IP Layer | OSI Equivalent(s) | Key Protocols | Function |
|---|---|---|---|
| Application | App, Pres, Session | HTTP, FTP, SMTP, DNS, Telnet | Process-to-process communication. |
| Transport | Transport | TCP (reliable, connection-oriented), UDP (unreliable, connectionless) | Host-to-host communication. |
| Internet | Network | IP (IPv4, IPv6), ICMP, ARP | Routing, logical addressing, packet delivery. |
| Link | Data Link + Physical | Ethernet (802.3), Wi-Fi (802.11), PPP, SONET | Media access, physical transmission. |
-
Comparison with OSI:
-
TCP/IP is practical, protocol-centric; OSI is theoretical, service-centric.
-
TCP/IP combines OSI's Session/Presentation/Application into one Application layer.
-
TCP/IP's Link layer maps to OSI's Data Link + Physical.
-
TCP/IP protocols (e.g., TCP, IP) were developed before the OSI model.
-
[!TIP] Common Pitfall: Don't confuse PDU names (Segment/ Packet/ Frame/ Bits) and devices operating at each layer. Remember: Router = Network Layer (IP), Switch = Data Link Layer (MAC).
5.0 SWITCHING TECHNIQUES
| Technique | Principle | How it Works | Advantages | Disadvantages |
|---|---|---|---|---|
| Circuit Switching | Dedicated physical path established before communication. | Setup → Data Transfer → Teardown. Resources (bandwidth) reserved for entire duration. Example: PSTN. | Guaranteed bandwidth, low latency during transfer, no reassembly. | Inefficient resource use (idle time), long setup delay, inflexible. |
| Packet Switching | Data split into packets; each packet routed independently. | Store-and-forward at each node. Two approaches: | Efficient resource use, robust (alternative routes), supports bursty traffic. | Variable delay (jitter), packets may arrive out-of-order, overhead from headers. |
| • Datagram | Each packet independent; no pre-defined path. | Routers route based on destination address in each packet. Example: IP (Internet). | Highly robust, no connection state. | Packets may take different paths → out-of-order, more overhead. |
| • Virtual Circuit | Logical path (VC) established before data transfer. | All packets follow same path; contain VC ID, not full address. Example: ATM, Frame Relay. | In-order delivery, less per-packet overhead, QoS possible. | Connection setup delay, nodes maintain VC state, less robust to failures. |
| Message Switching | Entire message stored at each node, then forwarded. | Store-and-forward of whole message. Used in early email systems, some WANs. | Can prioritize messages, efficient for non-real-time. | High delay (store entire message), requires large buffers, not for interactive traffic. |
[!TIP] Key Comparison: Circuit Switching = Dedicated path (like a private train). Packet Switching (Datagram) = Independent letters (each with full address). Packet Switching (Virtual Circuit) = Pre-addressed envelopes with a route number.
6.0 ERROR DETECTION AND CORRECTION
6.1 Types of Errors
-
Single-Bit Error: One bit flipped (e.g.,
0→1). -
Burst Error: Contiguous sequence of bits in error (length = burst error length). More common in noisy channels.
6.2 Error Detection Mechanisms
- Concept: Add redundant bits (check bits) to data. Receiver uses same algorithm to check consistency.
| Mechanism | Principle | How it Works | Pros | Cons |
|---|---|---|---|---|
| VRC / Parity Check | Add 1 bit to make number of 1s even (even parity) or odd (odd parity). | Sender: Count 1s in data unit, append parity bit. Receiver: Re-count 1s. | Simple, detects all single-bit errors and odd number of bit errors. | Cannot detect even-numbered bit errors. |
| LRC (Longitudinal Redundancy Check) | Organize data in rows and columns. Add parity bit for each column (2D parity). | Sender: Create block. Compute row parity (optional) and column parity bits. Send block + column parity row. Receiver: Check all column parities. | Detects burst errors (if burst ≤ column length) and most multiple-bit errors. Better than single VRC. | More overhead. May not correct error location. |
| CRC (Cyclic Redundancy Check) | Treat data as polynomial, divide by generator polynomial G(x), append remainder R(x). | Polynomial Division (Modulo-2):<br>1. Append n zeros to data (n = degree of G(x)).<br>2. Divide by G(x) using XOR (no carries).<br>3. Remainder (n bits) is CRC.<br>Receiver: Divides received (data+CRC) by same G(x). Zero remainder = no error. | Very powerful. Detects all single-bit, all double-bit, all odd number of errors, all burst errors < n+1, >99.9% of longer bursts. | More complex computation. |
| Checksum | Sum of data words (often 1's complement), then complement the sum. | Sender: Divide data into k-bit words. Sum them (with carry wrap-around). Send 1's complement of sum as checksum. Receiver: Sum all words + checksum. Result should be all 1s (0xFFFF). |
Simple, used in IP/TCP/UDP. | Weaker than CRC. Not good for burst errors. |
[!TIP] CRC Example (Exam Critical): Given data
11010101and CRC-8 polynomialx⁸ + x² + x + 1→ Generator100000111. Show division steps. Box final CRC remainder.
6.3 Error Correction Fundamentals
-
Forward Error Correction (FEC): Sender adds enough redundancy (e.g., Hamming code) so receiver can correct errors without retransmission. Used in real-time systems (satellite, deep space).
-
Automatic Repeat Request (ARQ): Receiver detects error (via CRC) and requests retransmission. Requires feedback channel. Types: Stop-and-Wait, Go-Back-N, Selective Repeat.
7.0 DATA LINK LAYER PROTOCOLS
7.1 Framing
-
Purpose: Define packet boundaries (start/end) for the Data Link layer. Separates incoming data into frames.
-
Methods:
-
Character-Oriented (Byte Stuffing): Uses special flag byte (e.g.,
0x7EorESC). If flag appears in data, insert escape character (ESC) before it. Receiver removes ESC. Used in PPP (for control frames) and old protocols (BISYNC). -
Bit-Oriented (Flag Stuffing): Uses special flag pattern (e.g.,
01111110for HDLC). If 5 consecutive 1s appear in data, insert a0bit (bit stuffing). Receiver removes stuffed0after 5 consecutive 1s.
-
-
Role in Error Detection: Frame delimiters ensure the receiver knows where to apply CRC check. Stuffed bits/bytes are removed before CRC verification.
7.2 High-Level Data Link Control (HDLC)
-
Features: Bit-oriented, full-duplex, synchronous, supports point-to-point and multidrop (secondary stations). Frame-based.
-
Frame Structure:
[Flag: 01111110] [Address] [Control] [Information (optional)] [FCS (CRC-16/32)] [Flag: 01111110]-
Flag:
01111110(start/end). -
Address: Identifies secondary station (in multidrop).
-
Control: Frame type & sequence number (for ARQ).
-
FCS: Frame Check Sequence (CRC).
-
-
Modes of Operation:
-
Normal Response Mode (NRM): Primary station controls token; secondary responds only when polled. (Used on multidrop lines).
-
Asynchronous Response Mode (ARM): Secondary can transmit without permission, but primary retains responsibility for line recovery.
-
Asynchronous Balanced Mode (ABM): Most common. Both stations are combined (peer-to-peer). Either can transmit anytime. Used in point-to-point links (e.g., PPP's HDLC-like framing).
-
7.3 Automatic Repeat Request (ARQ) Protocols
-
Stop-and-Wait:
-
Sender sends one frame, stops and waits for ACK.
-
Efficiency = 1 / (1 + 2a) where
a = Propagation Time / Transmission Time. -
Problem: Very low utilization if propagation delay >> transmission time.
-
-
Sliding Window:
-
Sender can send multiple frames before needing ACK. Window size = max unacknowledged frames.
-
Go-Back-N (GBN): Receiver discards out-of-order frames and requests retransmission of the frame where sequence broke. Sender re-sends all subsequent frames from error point. Simpler receiver, more retransmission.
-
Selective Repeat (SR): Receiver buffers out-of-order frames. Sender only retransmits specific errored frames. More complex receiver, less retransmission, higher efficiency.
-
Window Size Constraint: For GBN:
Ws ≤ 2ⁿ - 1; for SR:Ws + Wr ≤ 2ⁿ(n = bits in sequence number).
-
7.4 Point-to-Point Protocol (PPP) - Brief
-
Purpose: Data link protocol for direct connection between two nodes (e.g., dial-up, DSL).
-
Phases: Link establishment (LCP), Authentication (PAP/CHAP), Network layer protocol (NCP), Link termination.
-
Frame Format: Flag, Address (
0xFF), Control (0x03), Protocol (identifies network layer packet), Data, FCS, Flag. -
Features: Supports multiple protocols (IP, IPX), authentication, error detection (CRC), but no error correction (assumes reliable underlying layer).
8.0 LOCAL AREA NETWORK (LAN) TECHNOLOGIES
8.1 Ethernet (IEEE 802.3)
-
Access Method: CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
-
Procedure:
Listen→ If idle,Transmit→ While transmitting,Listen for collision→ If collision,Jam signal→Backoff(random time) → Retry. -
Contention Slot Time: 512 bits (51.2 µs for 10 Mbps). Ensures collision detection across entire network.
-
Efficiency: High for light load, degrades with load. Modern switched Ethernet is full-duplex → no collisions.
-
-
Frame Structure:
[Preamble (7B)] [SFD (1B)] [Dest MAC (6B)] [Src MAC (6B)] [Type/Length (2B)] [Data (46-1500B)] [FCS (4B)]-
Preamble + SFD: Clock synchronization.
-
Type: Indicates upper layer protocol (e.g.,
0x0800= IPv4). -
FCS: CRC-32.
-
8.2 Token-Based LANs
-
Token Ring (IEEE 802.5):
-
Architecture: Physical star, logical ring. Multistation Access Unit (MAU) connects nodes.
-
Operation: A token (3-byte frame: start, control, end) circulates. Station with token can transmit. After transmission, it releases a new token. Deterministic access.
-
Frame Format: Similar to Ethernet but with access control field.
-
-
Token Bus (IEEE 802.4):
-
Architecture: Physical bus, logical ring. Stations ordered by logical address.
-
Operation: Token passed in logical order (not physical). Station with token transmits for max time (
T_max), then passes token to next logical neighbor. -
Comparison:
| Feature | Token Ring | Token Bus | | :--- | :--- | :--- | | Physical Topology | Star | Bus | | Logical Topology | Ring | Ring | | Access Control | Token passing (physical order) | Token passing (logical order) | | Fault Tolerance | MAU can bypass failed station | Bus break disrupts entire ring | | Complexity | Higher (ring maintenance) | Simpler (like bus) |
-
8.3 Fiber Distributed Data Interface (FDDI)
-
Architecture: Dual counter-rotating rings (primary & secondary). Data flows in opposite directions on each ring.
-
Operation:
-
Normal: Data on primary ring, secondary idle (backup).
-
Fault: If primary ring breaks, stations wrap traffic to secondary ring, forming a single ring (fault tolerance).
-
-
Features: High speed (100 Mbps), long distance (up to 200 km stations, 100 km between), uses token passing (like Token Ring), 4B/5B encoding.
8.4 Wireless LANs (IEEE 802.11) - Brief
-
Architecture: Infrastructure mode (with Access Point) or Ad-hoc (peer-to-peer).
-
Access Method: CSMA/CA (Collision Avoidance). Uses
RTS/CTS(optional) andDIFS/SIFSinter-frame spaces to avoid collisions (since collision detection is hard in wireless). -
Key Standards: 802.11b/g/n (2.4 GHz), 802.11a/n/ac/ax (5 GHz). Wi-Fi 6 (802.11ax) introduces OFDMA.
9.0 METROPOLITAN AREA NETWORK (MAN) TECHNOLOGIES
9.1 Distributed Queue Dual Bus (DQDB) - IEEE 802.6
-
Architecture: Two unidirectional buses (Bus A & Bus B) running in opposite directions. Each station connects to both buses.
-
Access Control: Distributed Queue.
-
Each station maintains a request counter and a countdown counter.
-
To send on Bus A, station places a request on Bus B. All stations see this request.
-
Requests are queued in distributed fashion based on station position (closer to head of bus gets priority).
-
Station decrements its countdown counter when it sees a request ahead of it. When countdown reaches 0, it can transmit.
-
-
Operation in MAN: Provides asynchronous, connectionless data service over city-wide fiber infrastructure. Supports both isochronous (voice/video) and non-isochronous traffic.
-
Key Feature: Fairness through distributed queue; no central controller.
9.2 Switched Multi-megabit Data Service (SMDS)
-
Connectionless, packet-switched service for MANs.
-
Uses 53-byte cells (like ATM) over high-speed networks.
-
Provides high throughput and low delay for bursty data.
-
No call setup; each packet carries full destination address.
9.3 Comparison: DQDB vs. SMDS
| Feature | DQDB (802.6) | SMDS |
|---|---|---|
| Architecture | Dual bus, distributed queue | Packet-switched, connectionless |
| Cell Size | 53 bytes (like ATM) | 53 bytes |
| Access Control | Distributed queue (fair) | First-Come-First-Served (FCFS) at switches |
| Primary Use | MAN backbone, integrated services | High-speed data interconnect (MAN) |
| Standard | IEEE 802.6 | Bellcore (now Telcordia) standard |
10.0 WIDE AREA NETWORK (WAN) & CELL-BASED TECHNOLOGIES
10.1 Asynchronous Transfer Mode (ATM)
-
Cell-Based Architecture: Fixed-size 53-byte cells (5-byte header, 48-byte payload).
- Header Fields: VPI (Virtual Path Identifier), VCI (Virtual Circuit Identifier), PT (Payload Type), CLP (Cell Loss Priority), HEC (Header Error Control).
-
Virtual Paths (VP) & Virtual Circuits (VC):
-
VC: End-to-end connection identifier (VCI) within a VP.
-
VP: Group of VCs sharing the same path; allows bulk management.
-
-
Switching Mechanisms: Cell switching (similar to packet switching but fixed size). Fast hardware switching due to small, fixed cells. Supports PVCs (Permanent VCs) and SVCs (Switched VCs).
-
Key Feature: QoS classes (CBR, VBR, ABR, UBR) for different traffic types (voice, video, data).
10.2 Frame Relay
-
Operation: Simplified, high-performance packet-switched WAN protocol. Operates at Physical + Data Link layers.
-
Frame Structure: Flag, Address (DLCI - Data Link Connection Identifier), Control, Information, FCS, Flag.
- DLCI: Locally significant VC identifier.
-
Efficiency: Minimal error detection (only FCS), no retransmission (assumes reliable underlying physical layer). Congestion bits (FECN, BECN) for flow control.
-
Limitations: No flow control at data link layer, best-effort service (no guarantees), sensitive to congestion.
10.3 Synchronous Optical Network (SONET) / Synchronous Digital Hierarchy (SDH)
-
Purpose: Standard for high-speed fiber optic transmission (starting at 51.84 Mbps - STS-1/OC-1).
-
Key Concept: Synchronous byte-interleaved multiplexing of lower-rate signals (e.g., DS1, DS3).
-
Frame Structure: STS-1 frame = 9 rows × 90 columns (810 bytes), transmitted every 125 µs. Section, Line, Path overhead bytes for management.
-
Features: High reliability (automatic protection switching), built-in OAM (Operations, Administration, Maintenance), supports ATM over SONET.
10.4 X.25 Protocol Suite
-
Legacy WAN protocol for packet-switched networks over unreliable links (e.g., analog phone lines).
-
Three Layers: Physical (X.21), Data Link (LAPB - Link Access Procedure, Balanced), Packet Layer (virtual circuits).
-
Key Feature: Extensive error correction and flow control at each node (store-and-forward). Very reliable but slow due to multiple error checks. Largely replaced by Frame Relay and ATM.
11.0 NETWORKING DEVICES & INTERNETWORKING
| Device | OSI Layer(s) | Function | Key Technology |
|---|---|---|---|
| Repeater | Physical (1) | Regenerates/amplifies weakened signals. Extends cable length. No intelligence. | Analog/Digital repeaters. |
| Hub | Physical (1) | Multiport repeater. Broadcasts incoming signal to all ports. Creates a single collision domain. | Passive/Active hub. |
| Bridge | Data Link (2) | Connects two similar LAN segments. Forwards frames based on MAC addresses. Learns addresses. Creates separate collision domains. Transparent bridging (self-learning). | Store-and-forward, cut-through. |
| Switch (Layer 2) | Data Link (2) | Multiport bridge. Forwards frames based on MAC. Reduces collisions (each port = collision domain). VLANs support. | MAC address table, store/cut-through. |
| Router | Network (3) | Connects different networks (LANs, WANs). Forwards packets based on IP addresses. Uses routing tables and algorithms (RIP, OSPF). Performs logical addressing and path determination. | Routing table, longest prefix match. |
| Gateway | Application (7) | Connects networks with different protocol suites (e.g., LAN ↔ X.25). Performs protocol conversion at highest layer. | Email gateway, XML gateway. |
| Layer 3 Switch | Network (3) | Switch with routing capabilities. Forwards based on IP (like router) but at wire speed using hardware (ASICs). | Cisco "Multilayer Switch". |
[!TIP] Mnemonic: Repeater/Hub (Physical), Bridge/Switch (Data Link), Router (Network), Gateway (Application). Switches break collision domains; Routers break broadcast domains.
12.0 ROUTING ALGORITHMS
12.1 Routing Fundamentals
-
Goal: Find least-cost path from source to destination.
-
Routing Table: Contains
[Destination Network, Next Hop, Cost/Metric, Interface]. -
Types:
-
Static: Manually configured. Simple, secure, but not adaptive.
-
Dynamic: Routers exchange information, automatically update tables. Distance Vector & Link State.
-
12.2 Distance Vector Routing (Bellman-Ford)
-
Principle: Each router knows distance (cost) to each destination and the next-hop vector. Shares its entire table with direct neighbors periodically.
-
Algorithm (Router X):
-
Receive neighbor's distance vector
D_Y. -
For each destination
j:D_X(j) = min [ c(X,i) + D_i(j) ]for all neighborsi. -
Update own table and send new vector to neighbors.
-
-
Example Protocol: RIP (Routing Information Protocol). Metric = hop count (max 15). Updates every 30 sec.
-
Problems:
-
Count-to-Infinity: Slow convergence on link failure; metric increases gradually to infinity.
-
Routing Loops: Temporary loops before convergence.
-
Large Updates: Sends full table periodically (even if unchanged).
-
-
Solutions: Split Horizon, Poison Reverse, Hold-down Timers.
12.3 Link State Routing (Dijkstra's)
-
Principle: Each router has complete map of network topology (link costs). Runs Dijkstra's SPF (Shortest Path First) algorithm independently to compute shortest paths.
-
Steps:
-
Flooding: Each router broadcasts Link State Advertisements (LSAs) to all other routers (reliable flooding). LSAs describe router's links and costs.
-
Database: All routers build identical Link State Database (LSDB).
-
SPF Calculation: Each router runs Dijkstra on LSDB to compute shortest path tree with itself as root.
-
Routing Table: Populated from shortest path tree.
-
-
Example Protocol: OSPF (Open Shortest Path First). Uses areas, authentication, faster convergence.
-
Comparison with Distance Vector:
| Feature | Distance Vector | Link State |
|---|---|---|
| Information Shared | Entire routing table to neighbors | LSAs (link state) to all routers |
| Update Trigger | Periodic (e.g., 30s) & triggered | Triggered by change (LSA flood) |
| Convergence | Slow (count-to-infinity) | Fast |
| CPU/Memory | Low (simple min calculation) | High (SPF algorithm, large LSDB) |
| Scalability | Smaller networks | Large networks (hierarchical OSPF areas) |
| Example | RIP, IGRP | OSPF, IS-IS |
[!TIP] Exam Focus: Be able to run Dijkstra's algorithm on a small graph (5-6 nodes). Know the step-by-step: initialize, find min-cost unvisited node, update neighbors, repeat. For Bellman-Ford, show the iteration table for a small network.