Computer Network Notes
DSC course under University of Kerala (UoK FYUGP Regulations). Credits: 4 | 60 Hours (4 Hrs/Week).
Chapter-Wise Module Notes & PDF Downloads
Short Notes
All Modules IncludedComplete syllabus revision notes covering all modules in one single PDF
Module 1
Reference Models, Physical Layer and Multiplexing
Module 2
Data Link Layer, Error Control and LAN Standards
Module 3
Network Layer, Routing and Transport Protocols
Module 4
Application Layer, Content Delivery and Streaming
Module 5
Session/Presentation Layers, OSPF/BGP, DTN and Lab Experiments
Read Module Notes Online
Module I: Reference Models, Physical Layer and Multiplexing
Chapter 1: Fundamentals of Computer Networks and Topologies
1.1 Definition and Components of Data Communication
A computer network is an interconnected collection of autonomous computing devices capable of exchanging data and sharing hardware, software, and informational resources over guided or unguided transmission media. Two devices are considered networked when a process running on one device can exchange information with a process running on another device through a well-defined communication protocol. Unlike early mainframe-terminal architectures where dumb terminals depended entirely on a central host for computation, modern computer networks link independent processors—ranging from embedded sensors and smartphones to enterprise servers and cloud data centers—allowing distributed computation, fault isolation, and scalable resource sharing.
Every data communication system relies on five fundamental components:
- Message: The information (text, numbers, images, audio, video, or binary files) to be communicated from source to destination.
- Sender: The computing device (workstation, server, smartphone, sensor) that originates and transmits the data message.
- Receiver: The computing device that accepts, decodes, and consumes the transmitted message.
- Transmission Medium: The physical path—such as twisted-pair copper wire, coaxial cable, optical fiber, or free-space radio waves—over which the signal propagates.
- Protocol: A formal set of rules governing data communication. A protocol defines syntax (the structure and format of data), semantics (the meaning of each section of bits and control actions), and timing (when data should be sent and at what transmission rate).
Communication between two devices operates in one of three data-flow modes: Simplex (unidirectional, where one device only transmits and the other only receives, such as a keyboard or television broadcast), Half-Duplex (bidirectional, where each station can both transmit and receive, but not simultaneously, as in walkie-talkies), or Full-Duplex (simultaneous bidirectional transmission over separate physical wires or frequency/time channels, as in modern switched Ethernet and telephone calls).
1.2 Network Criteria: Performance, Reliability, and Security
For a computer network to operate effectively in enterprise and consumer environments, network architects evaluate its design against three fundamental criteria:
- Performance: Measured primarily through transit time (the duration required for a message to travel from source to destination) and response time (the elapsed time between a user inquiry and the received response). Performance depends on the number of concurrent users, transmission medium capacity, hardware switching speed, and software protocol efficiency. Two critical quantitative metrics are throughput (actual bits delivered per second) and latency (delay). High throughput and low latency are often competing objectives when queues build up inside routers.
- Reliability: Quantified by the frequency of link or node failures, the time required for a network to recover from a failure (Mean Time To Repair, MTTR), and robustness against catastrophic events such as power outages, hardware faults, or fiber cuts. Redundant paths, dual power supplies, uninterruptible power systems, and fault-tolerant dynamic routing protocols directly improve reliability.
- Security: Encompasses protecting data from unauthorized access, eavesdropping, modification, or denial of service, as well as implementing policies and procedures for recovery from breaches and data losses. Core security properties include confidentiality (encryption), integrity (message authentication codes), availability (resilience against DoS), and authentication (verifying peer identity).
Worked Numerical 1.1: End-to-End Delay Calculation
Suppose a host transmits a 1,500-byte packet over a 2,000 km fiber-optic link with a bandwidth of 100 Mbps. The signal propagation speed in glass fiber is , and nodal processing plus queuing delay totals 0.5 ms. Compute the total end-to-end delay.
Step 1: Convert packet size to bits: .
Step 2: Compute propagation delay: .
Step 3: Compute transmission delay: .
Step 4: Sum all four delay components: . Notice that on long-haul WAN links, propagation delay dominates transmission delay for individual packets.
1.3 Types of Connections
Communication links between devices are organized into two physical or logical connection modes:
- Point-to-Point Connection: Provides a dedicated physical or logical link between exactly two devices. The entire capacity of the channel is reserved exclusively for transmission between those two nodes. Examples include a direct fiber-optic trunk between two core routers, a serial RS-232 cable, or a point-to-point microwave link between two towers.
- Multipoint (Multidrop) Connection: A single physical link is shared by more than two specific devices. Channel capacity is shared either spatially (multiple devices can use the link simultaneously via frequency or code separation) or temporally (time-shared via turn-taking). Traditional coaxial Ethernet buses and wireless Wi-Fi access points operate as multipoint shared media.
1.4 Network Topologies
Physical topology refers to the geometric arrangement of links and communicating nodes, whereas logical topology describes how data frames actually traverse the network regardless of physical cabling. Choosing a topology involves balancing cabling cost, I/O port count, scalability, fault tolerance, and ease of administration.
| Topology | Link Count ( nodes) | Key Advantages | Primary Disadvantages |
|---|---|---|---|
| Mesh | duplex links | Dedicated traffic eliminates congestion; high fault tolerance; strong privacy and security. | Excessive cabling and I/O port cost; impractical installation for large node counts. |
| Star | links to central hub/switch | Easy installation and reconfiguration; single link failure isolates only one node. | Single point of failure at the central switch/hub; more cabling than bus topology. |
| Bus | 1 shared backbone + drop lines | Minimal cabling cost; simple linear installation for small legacy LANs. | Backbone break halts entire network; signal reflection requires terminators; difficult fault isolation. |
| Ring | point-to-point links | Deterministic token-passing access; uniform signal regeneration at each repeater. | Unidirectional break disables the ring unless a dual-ring architecture is deployed. |
| Hybrid | Varies by sub-topologies | Combines scalability of star clusters with backbone resilience. | Complex management and heterogeneous hardware configuration. |
In a fully connected mesh topology of routers, each router requires I/O ports, and the network requires full-duplex links. In enterprise campus networks, a Star-of-Stars (Tree/Hierarchical) hybrid topology is standard, where access-layer switches connect end hosts in local stars and aggregate upward to redundant distribution and core switches.
1.5 Categories of Networks and the Internet
Networks are classified by geographical span, administrative ownership, and transmission technology:
- Personal Area Network (PAN): Covers a few meters around an individual (typically up to 10 m). Connects personal devices such as wireless headphones, smartwatches, keyboards, and smartphones via Bluetooth (IEEE 802.15.1) or Zigbee.
- Local Area Network (LAN): Privately owned network spanning a single office, building, or university campus (up to a few kilometers). Operates at high data rates (100 Mbps to 100 Gbps) with low bit-error rates using Ethernet (IEEE 802.3) or Wi-Fi (IEEE 802.11).
- Metropolitan Area Network (MAN): Spans an entire city or metropolitan region (5–50 km), interconnecting multiple corporate or campus LANs via high-speed fiber rings, Metro Ethernet, or municipal broadband owned by telecom carriers.
- Wide Area Network (WAN): Covers countries or continents, interconnecting LANs and MANs through leased lines, MPLS backbones, undersea fiber-optic cables, cellular networks, and satellite links.
- The Internet: A global internetwork ("network of networks") formed by tens of thousands of Autonomous Systems (ASes) interconnected via Internet Exchange Points (IXPs) and tiered Internet Service Providers (Tier-1 transit-free backbones, Tier-2 regional ISPs, and Tier-3 access ISPs) operating on the TCP/IP protocol suite. Technical standards for the Internet are developed through open consensus by the Internet Engineering Task Force (IETF) and published as Request for Comments (RFC) documents.
Chapter 2: Network Reference Models (OSI and TCP/IP)
2.1 Layered Architecture Principles
Modern networks are structured as a stack of horizontal layers to manage engineering complexity. Each layer offers well-defined services to the layer immediately above it through a Service Access Point (SAP) while shielding upper layers from hardware and implementation details below. Layer on one host communicates logically with peer layer on a remote host using a standardized protocol. Physically, data passes downward through the sender's stack—receiving a header (and at Layer 2, a trailer) at each layer in a process called encapsulation—crosses the physical medium as modulated bits, and ascends the receiver's stack via decapsulation, where each layer strips and processes its corresponding header.
In layered service models, an upper layer interacts with a lower layer through four abstract service primitives: REQUEST (an entity wants the service to do work), INDICATION (an entity is notified about an event), RESPONSE (an entity replies to an event), and CONFIRM (the requesting entity is informed that its request completed). Layers may provide either connection-oriented service (establish connection, transfer data in order, release connection) or connectionless service (each message is routed independently without prior setup).
2.2 The OSI Reference Model
Developed by the International Organization for Standardization (ISO) in 1984, the Open Systems Interconnection (OSI) model defines seven distinct layers:
- Physical Layer (Layer 1): Coordinates the functions required to carry an unstructured bit stream over a physical medium. Defines mechanical specifications (connectors, pinouts), electrical/optical signaling (voltage levels, bit duration), line coding (NRZ, Manchester), data rate, bit synchronization, and physical topology. Protocol Data Unit (PDU): Bits.
- Data Link Layer (Layer 2): Transforms the raw physical transmission facility into a reliable node-to-node link. Responsibilities include framing, physical addressing (48-bit MAC addresses), flow control, error detection (CRC) and correction, and medium access control (CSMA/CD, CSMA/CA). PDU: Frame.
- Network Layer (Layer 3): Responsible for source-to-destination packet delivery across multiple interconnected networks. Handles logical addressing (IPv4/IPv6), routing table computation, packet forwarding, fragmentation/reassembly, and internetwork congestion control. PDU: Packet.
- Transport Layer (Layer 4): Provides end-to-end process-to-process delivery across the entire path. Manages port addressing (service-point addressing), segmentation and reassembly of application messages, connection establishment and teardown, end-to-end flow control, and error recovery. PDU: Segment (TCP) or Datagram (UDP).
- Session Layer (Layer 5): Establishes, manages, and terminates communication sessions between applications. Implements dialog control (half-duplex or full-duplex turn-taking), token management, and synchronization checkpoints for crash recovery.
- Presentation Layer (Layer 6): Addresses the syntax and semantics of transmitted information. Performs character code translation (ASCII, EBCDIC, UTF-8), data encryption/decryption, and lossless or lossy compression/decompression.
- Application Layer (Layer 7): Provides network services directly to end-user software and human operators, such as web browsing (HTTP), file transfer (FTP), directory resolution (DNS), and electronic mail (SMTP). PDU: Data / Message.
2.3 The TCP/IP Reference Model
The TCP/IP (Department of Defense) model originated with ARPANET and serves as the practical architectural foundation of the modern Internet. It organizes networking into four (or five in hybrid academic texts) layers:
- Network Access (Host-to-Network / Link) Layer: Combines OSI Physical and Data Link functions, defining how IP packets are encapsulated into frames for Ethernet, Wi-Fi, PPP, or MPLS links.
- Internet Layer: Equivalent to the OSI Network Layer. Uses the connectionless Internet Protocol (IPv4/IPv6) alongside helper protocols such as ICMP (diagnostics), ARP (IP-to-MAC resolution), and routing protocols (OSPF, BGP) to deliver packets independently across networks.
- Transport Layer: Provides end-to-end process delivery through TCP (reliable, connection-oriented byte stream) and UDP (unreliable, connectionless datagrams).
- Application Layer: Merges OSI Session, Presentation, and Application functions into a single layer hosting HTTP, HTTPS, DNS, FTP, DHCP, SMTP, and SSH.
| Comparison Criterion | OSI Reference Model | TCP/IP Reference Model |
|---|---|---|
| Number of Layers | 7 strictly defined layers | 4 layers (5 in hybrid textbook view) |
| Origin & Adoption | Theoretical standard developed before protocols | Protocols built first; model abstracted afterward |
| Session & Presentation | Dedicated Layers 5 and 6 | Absorbed into the Application Layer |
| Network Layer Modes | Supports both connection-oriented and connectionless | Strictly connectionless (IP) |
| Transport Layer Modes | Connection-oriented only in original specification | Supports both TCP (connection-oriented) and UDP (connectionless) |
| Service vs. Protocol Separation | Clear distinction between service, interface, and protocol | Did not originally separate service, interface, and protocol |
Chapter 3: The Physical Layer and Transmission Media
3.1 Signals, Line Coding, and Theoretical Capacity Limits
Information transmitted across physical media takes the form of analog (continuous-time, continuous-amplitude) or digital (discrete-level) electromagnetic signals. Two distinct rate metrics describe digital transmission: Bit Rate (bits per second, bps) and Baud Rate (signal elements or symbols per second). If each signal element encodes bits using discrete amplitude or phase levels, then .
Before transmission, binary data is converted into electrical or optical waveforms via line coding:
- Polar NRZ-L and NRZ-I: Non-Return-to-Zero Level encodes
1and0with opposite voltages; NRZ-Inverted toggles voltage on every1bit. Long runs of zeros can cause receiver clock drift. - Manchester and Differential Manchester: Guarantees a mid-bit voltage transition on every single bit, embedding the clock signal directly into the data stream (used in classic 10 Mbps Ethernet and IEEE 802.5 Token Ring), at the cost of doubling the required signal bandwidth.
- 4B/5B Block Coding: Maps every 4-bit data nibble into a 5-bit codeword containing at least two
1s, preventing long zero runs without doubling bandwidth (used in 100BASE-FX Fast Ethernet).
Physical channels attenuate signals, introduce thermal noise, and restrict frequency bandwidth. Two foundational theorems bound the maximum achievable data rate:
Worked Numerical 1.2: Nyquist and Shannon Capacity
A telephone voice channel has a bandwidth of 3,000 Hz and an SNR of 30 dB. (a) Find the Shannon capacity. (b) Determine how many signal levels would be required to achieve this capacity under Nyquist's formula.
Step 1: Convert SNR from decibels to linear ratio: .
Step 2: Compute Shannon capacity: .
Step 3: Equate to Nyquist rate: .
Worked Numerical 1.3: Attenuation in Decibels
A signal travels through a cable and loses half of its power. What is the attenuation in decibels (dB)? Using . Thus, a 3 dB loss corresponds to halving signal power, while a +3 dB gain corresponds to doubling signal power.
3.2 Guided Transmission Media
Guided media confine electromagnetic energy within a physical conductor or dielectric waveguide:
- Twisted-Pair Cable: Consists of two insulated copper conductors twisted helically around each other. Because both wires experience nearly identical electromagnetic interference (EMI) and crosstalk, twisting ensures each wire alternates closer to and farther from the noise source, canceling induced differential noise. Unshielded Twisted Pair (UTP)—standardized by EIA/TIA categories such as Cat5e (1 Gbps), Cat6 (1–10 Gbps), and Cat6a (10 Gbps up to 100 m)—dominates Ethernet LANs using 8P8C (RJ-45) connectors. Shielded Twisted Pair (STP) wraps each pair or the entire bundle in metallic foil or braiding for noisy industrial floors.
- Coaxial Cable: Features a central solid copper core surrounded by a cylindrical dielectric insulator, a braided metallic outer conductor (shield), and a protective outer jacket. Because the outer shield blocks external EMI, coaxial cable supports higher bandwidths and longer runs than UTP. Widely used in cable television (CATV) distribution and DOCSIS broadband internet.
- Fiber-Optic Cable: Transmits modulated light pulses through an ultra-pure silica glass or plastic core surrounded by a lower-refractive-index cladding using total internal reflection. Multimode fiber (50 or 62.5 micron core, LED/VCSEL source) allows multiple light rays at different angles, causing modal dispersion that limits range to ~300 m–2 km. Single-mode fiber (8–10 micron core, laser diode source) restricts light to a single axial mode, carrying tens of gigabits per second over 40–100 km without repeaters and with complete immunity to EMI and lightning.
| Guided Medium | Bandwidth / Data Rate | Typical Max Segment | Noise Immunity & Cost |
|---|---|---|---|
| UTP (Cat5e / Cat6a) | 1 Gbps – 10 Gbps | 100 m | Moderate immunity; lowest cost, easiest installation |
| Coaxial Cable | 10 Mbps – 1 Gbps+ | 500 m (LAN) / km (CATV) | Good immunity via outer shield; moderate cost |
| Multimode Fiber | 10 Gbps – 100 Gbps | 300 m – 2 km | Complete EMI immunity; moderate optical transceiver cost |
| Single-Mode Fiber | 100 Gbps – Tbps (DWDM) | 40 km – 100+ km | Complete EMI immunity; highest transceiver/splicing cost |
3.3 Wireless Transmission and Communication Satellites
Unguided media radiate electromagnetic waves through free space without physical conductors using antennas. Depending on frequency, wireless waves propagate via Ground Propagation (below 2 MHz, hugging Earth's curvature), Sky Propagation (2–30 MHz, bouncing off the ionosphere), or Line-of-Sight Propagation (above 30 MHz, traveling in straight lines between elevated antennas).
- Radio Waves (3 kHz – 1 GHz): Omnidirectional propagation; waves travel in all directions, eliminating precise antenna alignment. Penetrates building walls effectively, making radio ideal for AM/FM broadcasting, maritime radio, and sub-GHz IoT telemetry.
- Microwaves (1 GHz – 300 GHz): Unidirectional propagation requiring line-of-sight alignment between parabolic dish or phased-array antennas. Used in terrestrial cellular backhaul, Wi-Fi (2.4 GHz, 5 GHz, 6 GHz), Bluetooth, and radar. High-frequency microwaves above 10 GHz suffer attenuation during heavy rain (rain fade).
- Infrared (300 GHz – 400 THz): Short-range line-of-sight communication unable to penetrate solid walls. Because signals stay confined to a single room, infrared devices in adjacent rooms never interfere with one another.
Communication Satellites act as orbital microwave repeaters equipped with transponders that receive weak uplink signals, amplify them, shift them to a lower downlink frequency (to prevent feedback interference), and retransmit them over wide geographical footprints. Common satellite frequency bands include C-band (4/6 GHz, rain-resistant), Ku-band (11/14 GHz, smaller dishes), and Ka-band (20/30 GHz, high throughput). Very Small Aperture Terminals (VSATs) allow remote enterprises to connect via a central hub station.
| Orbit Class | Altitude | Round-Trip Latency | Key Characteristics |
|---|---|---|---|
| GEO (Geostationary) | ~35,786 km | ~250–280 ms | Stationary relative to Earth; 3 satellites cover the globe; high latency affects interactive TCP. |
| MEO (Medium Earth) | 5,000–20,000 km | ~80–120 ms | Used by GPS/GNSS navigation constellations; requires ~10–12 satellites for global coverage. |
| LEO (Low Earth) | 500–2,000 km | ~20–40 ms | Low latency and high bandwidth; requires large constellations (e.g., Starlink) and frequent handoffs. |
Chapter 4: Multiplexing Techniques
4.1 Concept of Multiplexing
High-capacity physical trunks—such as single-mode optical fibers or coaxial backbones—possess far more bandwidth than a single user session requires. Multiplexing enables multiple independent data streams to share a single physical transmission medium simultaneously, maximizing link utilization and lowering per-bit transport cost. At the transmitting end, a multiplexer (MUX) combines input channels onto one composite link; at the receiving end, a demultiplexer (DEMUX) separates the composite signal back into distinct output streams.
4.2 Frequency Division Multiplexing (FDM)
FDM is an analog technique applied when the available bandwidth of a medium exceeds the combined bandwidths of the individual signals to be transmitted. Each input signal modulates a distinct carrier frequency, shifting its spectrum into a dedicated, non-overlapping frequency sub-band. Unused frequency strips called guard bands separate adjacent sub-bands to prevent inter-channel interference (crosstalk). All modulated sub-bands are summed linearly and transmitted continuously. FDM is used in commercial AM/FM radio, cable television, and Orthogonal Frequency Division Multiplexing (OFDM) in Wi-Fi and 4G/5G cellular networks.
Worked Numerical 1.4: FDM Bandwidth Calculation
Five voice channels, each requiring a 4 kHz bandwidth, are multiplexed using FDM with a 500 Hz guard band between adjacent channels. What is the minimum total link bandwidth required?
Total signal bandwidth = . Number of guard bands between 5 channels = . Total guard bandwidth = . Minimum required link bandwidth = .
4.3 Time Division Multiplexing (TDM)
TDM is a digital technique that allows multiple connections to share the high bit rate of a link by taking turns in time. Each connection occupies the full channel bandwidth for brief, recurring intervals called time slots.
- Synchronous TDM: Assigns fixed-duration time slots in a deterministic round-robin frame structure. Each input line owns one dedicated slot per frame. If a source has no data to send, its assigned slot is transmitted empty, wasting bandwidth. Framing bits are prepended to each frame so the demultiplexer maintains bit and slot synchronization.
- Statistical (Asynchronous) TDM: Dynamically allocates time slots only to active sources that currently have buffered data to transmit. Because slot ownership is not fixed by position, each slot must carry a source address identifier (increasing per-slot header overhead), but total link utilization increases dramatically for bursty computer traffic.
Worked Numerical 1.5: Synchronous TDM Frame Rate and Bit Rate
Four 10 kbps digital sources are multiplexed using Synchronous TDM, taking 1 byte (8 bits) from each source per frame, plus 1 framing bit per frame. Compute the frame bit size, frame rate, and output link bit rate.
Step 1: Data bits per frame = . Total bits per frame = .
Step 2: Each source produces , so the multiplexer must transmit 1,250 frames/s.
Step 3: Output link bit rate = .
4.4 Wavelength Division Multiplexing (WDM)
WDM is conceptually identical to FDM, except multiplexing and demultiplexing occur with optical light signals inside fiber-optic cables rather than electrical RF carriers. Multiple laser transmitters emit light at distinct wavelengths (colors), typically in the 1310 nm or 1550 nm low-attenuation windows. An optical prism or arrayed waveguide grating combines these wavelengths onto a single strand of single-mode fiber, and a matching optical demultiplexer splits them at the receiver. Coarse WDM (CWDM) spaces channels by 20 nm, whereas Dense WDM (DWDM) packs 40 to over 160 tightly spaced wavelengths (0.4–0.8 nm apart) into a single fiber, achieving aggregate capacities exceeding tens of terabits per second across transoceanic backbones.
| Feature | FDM | Synchronous TDM | Statistical TDM | WDM |
|---|---|---|---|---|
| Signal Domain | Analog (frequency) | Digital (time) | Digital (time) | Optical (wavelength) |
| Resource Sharing | Continuous sub-bands | Fixed time slots | On-demand time slots | Distinct light wavelengths |
| Idle Bandwidth Waste | Yes (unused sub-band) | Yes (empty slots) | No (dynamic allocation) | Yes (unused wavelength) |
| Overhead | Guard bands | Synchronization bits | Source address headers | Optical guard bands |
4.5 Spread Spectrum: FHSS, DSSS and CDMA
While FDM, TDM, and WDM partition a medium by frequency, time, or wavelength, Spread Spectrum deliberately expands a narrowband signal over a much wider frequency band than required by the original data rate. This provides strong resistance against narrowband interference, multipath fading, and eavesdropping.
- Frequency Hopping Spread Spectrum (FHSS): The transmitter rapidly switches carrier frequencies across a wide spectrum according to a pseudo-random hopping sequence synchronized with the receiver. Used in Bluetooth (1,600 hops/second across 79 1-MHz channels in 2.4 GHz).
- Direct Sequence Spread Spectrum (DSSS): Multiplies each data bit by a high-rate pseudo-random chipping sequence (spreading code), spreading the signal energy across a wide bandwidth.
- Code Division Multiple Access (CDMA): Allows all stations to transmit simultaneously across the entire frequency band using mutually orthogonal spreading codes (Walsh-Hadamard sequences). If station uses chip vector and station uses , their inner product is . A receiver recovering 's signal computes the inner product of the composite channel signal with and divides by 4, completely canceling 's orthogonal transmission.
Chapter 2 Addendum: End-to-End Encapsulation Walkthrough
To visualize how the OSI and TCP/IP layers cooperate during a web request, consider an HTTP GET message of 200 bytes generated by a browser:
- Application Layer: Creates the 200-byte HTTP request message.
- Transport Layer: Prepends a 20-byte TCP header (source port 51422, destination port 80), forming a 220-byte TCP Segment.
- Network Layer: Prepends a 20-byte IPv4 header (source IP, destination IP, Protocol = 6), forming a 240-byte IP Packet.
- Data Link Layer: Prepends a 14-byte Ethernet header (destination MAC, source MAC, EtherType
0x0800) and appends a 4-byte CRC-32 FCS trailer, forming a 258-byte Ethernet Frame. - Physical Layer: Prepends an 8-byte Preamble + SFD and transmits 2,128 bits as modulated electrical or optical pulses onto the wire.
Module II: Data Link Layer, Error Control and LAN Standards
Chapter 5: Data Link Layer Design Issues and Framing
5.1 Responsibilities of the Data Link Layer
The Data Link Layer (Layer 2) sits directly above the Physical Layer and provides a well-defined service interface to the Network Layer. While the Physical Layer moves raw bits without understanding their structure, the Data Link Layer groups bits into discrete frames, regulates transmission speed so a fast sender does not overwhelm a slow receiver (flow control), detects or corrects transmission errors (error control), and arbitrates shared channel access in broadcast LANs (media access control). Internally, the IEEE 802 project splits Layer 2 into two sublayers: the upper Logical Link Control (LLC, IEEE 802.2) sublayer, which interfaces uniformly with Layer 3, and the lower Medium Access Control (MAC) sublayer, which handles physical addressing and media contention.
The Data Link Layer typically offers three service classes to the Network Layer: (1) Unacknowledged connectionless service (appropriate for low-error wired LANs like Ethernet where higher layers handle recovery), (2) Acknowledged connectionless service (used on error-prone wireless links like Wi-Fi 802.11 where each frame is individually acknowledged), and (3) Acknowledged connection-oriented service (used over long unreliable links where frames are guaranteed to arrive in sequence without duplication).
5.2 Framing Methods
Framing allows the receiver's Data Link Layer to identify exact frame boundaries within a continuous stream of physical-layer bits:
- Character (Byte) Count: A field in the frame header specifies the total number of bytes in the frame. Although simple, a single bit error in the count field corrupts the receiver's boundary calculation, causing it to lose synchronization for all subsequent frames. Consequently, character count is rarely used alone in modern protocols.
- Flag Bytes with Byte Stuffing: Each frame begins and ends with a special delimiter byte called a
FLAG(e.g.,01111110or0x7Ein PPP/HDLC). If theFLAGpattern naturally occurs inside binary payload data, the sender inserts an escape byte (ESC,0x7D) immediately before it. IfESCitself appears in the payload, anotherESCis stuffed ahead of it. The receiver strips stuffedESCbytes upon arrival. - Flag Bits with Bit Stuffing: Used in bit-oriented protocols like HDLC and USB. Frames are bounded by the 8-bit flag
01111110(six consecutive 1s). Whenever the sender encounters five consecutive1bits in the payload, it automatically stuffs a0bit into the outgoing stream. The receiver monitors incoming bits and removes any0that immediately follows five consecutive1s, guaranteeing that six consecutive1s only ever represent a true frame flag. - Physical Layer Coding Violations: Applicable when the physical line coding contains redundancy. For example, Manchester encoding represents
1as high-to-low and0as low-to-high; pairs of high-high or low-low transitions never occur in valid data and can serve as unambiguous frame delimiters in IEEE 802.5 Token Ring and 100BASE-FX.
--- Bit Stuffing (Flag = 01111110) --- Original Payload : 0111111011111010 After 5 ones : 011111[0]1011111[0]010 Transmitted Bits : 011111010111110010 (bracketed 0s stuffed by sender) Receiver Output : 0111111011111010 (stuffed 0s stripped after 5 ones) --- Byte Stuffing (FLAG = 0x7E, ESC = 0x7D) --- Original Payload : [A] [0x7E] [B] [0x7D] [C] Stuffed Frame : [0x7E] [A] [0x7D][0x7E] [B] [0x7D][0x7D] [C] [0x7E]
5.3 Flow Control and Error Control Overview
Flow control prevents a fast transmitter from saturating a slow receiver's finite buffer memory. Two approaches dominate: feedback-based flow control (the receiver explicitly grants permission via ACKs or window updates) and rate-based flow control (built-in rate limits). Error control ensures reliable delivery across noisy links using acknowledgments (positive ACKs for valid frames, negative NAKs for corrupted frames), retransmission timers to recover lost frames or lost ACKs, and sequence numbers to detect and discard duplicate frames.
Chapter 6: Error Detection and Correction
6.1 Types of Errors, Redundancy, and Hamming Distance
Electromagnetic noise, thermal agitation, attenuation, and crosstalk alter transmitted bits. A single-bit error alters only one bit in a frame, whereas a burst error corrupts two or more consecutive bits (measured from the first corrupted bit to the last corrupted bit, even if intermediate bits remain intact). Burst errors are far more common in wireless and high-speed serial links because a single impulse noise event of duration corrupts bits at bandwidth . All error-control schemes add structured redundant bits to the -bit dataword to form an -bit codeword ().
The Hamming distance between two equal-length codewords is the number of bit positions in which they differ (computed as the number of 1s in ). For a block code with minimum Hamming distance between any two valid codewords: to detect up to bit errors, we require ; to correct up to bit errors, we require .
6.2 Parity Checks: VRC and LRC
- Vertical Redundancy Check (VRC / Simple Parity): Appends a single parity bit to each character or dataword so the total number of
1s becomes even (even parity) or odd (odd parity). VRC has , detecting all single-bit errors and any odd number of bit errors, but failing whenever an even number of bits (2, 4, 6...) are flipped. - Longitudinal Redundancy Check (LRC / Two-Dimensional Parity): Organizes a block of bytes as a matrix of rows and columns, computes a parity bit for each column, and appends an entire LRC parity byte at the end. LRC detects all burst errors up to the width of the row (8 bits), though rectangular 4-bit error patterns at matching row/column corners remain undetectable.
6.3 Checksum
Checksums are used extensively in IPv4, TCP, and UDP headers because they are fast to compute in software. The sender divides the data into -bit segments (typically 16 bits), sums them using 1's complement arithmetic (wrapping any carry-out back into the least significant bit), and takes the 1's complement (bitwise NOT) of the final sum as the checksum. The receiver sums all segments including the checksum; if the 1's complement of the result is all zeros, the packet is accepted.
Worked Numerical 2.1: 8-Bit Checksum
Compute the 8-bit 1's complement checksum for the two data bytes 10101001 (169) and 00111001 (57).
Step 1: Add the two bytes: (no carry-out).
Step 2: Take 1's complement (flip all bits): Checksum = 00011101.
Step 3: Receiver adds 10101001 + 00111001 + 00011101 = 11111111. Complementing gives 00000000, confirming zero error.
6.4 Cyclic Redundancy Check (CRC)
CRC is the strongest error-detection method used in Ethernet, Wi-Fi, HDLC, and storage controllers. Both sender and receiver agree on an -bit generator polynomial whose most significant and least significant bits are both 1. The sender appends zero bits to the -bit message and divides by using modulo-2 arithmetic (XOR without carries or borrows). The -bit remainder (Frame Check Sequence, FCS) replaces the appended zeros. At the receiver, the entire -bit frame is divided by ; a zero remainder indicates an error-free frame.
Worked Numerical 2.2: CRC Modulo-2 Division
Given data bits 101100 and generator polynomial (binary 1011, degree ), compute the transmitted CRC codeword.
Step 1: Append r = 3 zeros to data -> 101100000
Step 2: Modulo-2 (XOR) division by 1011:
100010
----------
1011 ) 101100000
1011
----
000000
1000
1011
----
0110 -> Remainder (FCS) = 011 (3 bits)
Step 3: Transmitted Codeword = Data + FCS = 101100011Dividing 101100011 by 1011 at the receiver yields remainder 000, confirming integrity. Standard generator polynomials such as CRC-32 (used in IEEE 802.3 Ethernet) detect all single-bit errors, all double-bit errors, any odd number of errors (if contains the factor ), and all burst errors up to 32 bits long.
6.5 Hamming Code (Forward Error Correction)
While CRC only detects errors and relies on retransmission, Hamming Code locates and corrects single-bit errors directly at the receiver without retransmission (Forward Error Correction, FEC). For data bits, redundant parity bits are required satisfying:
Worked Numerical 2.3: 7-Bit Hamming Code Construction and Correction
Encode the 4-bit data 1011 using even-parity Hamming Code (positions numbered 1 to 7 from right to left: ).
Step 1: Since , , so parity bits at positions 1, 2, and 4. Data bits occupy positions 3, 5, 6, 7: .
Step 2: Compute even parity bits:
- covers positions with bit 0 set (1, 3, 5, 7): .
- covers positions with bit 1 set (2, 3, 6, 7): .
- covers positions with bit 2 set (4, 5, 6, 7): .
Step 3: Transmitted 7-bit codeword (bits 7 down to 1): 1 0 1 0 1 0 1. If bit 5 flips in transit (received 1 0 0 0 1 0 1), the receiver recomputes syndrome bits $, directly pinpointing and flipping bit 5 back to 1.
Chapter 7: Flow Control and ARQ Protocols
7.1 Stop-and-Wait ARQ
In Stop-and-Wait Automatic Repeat Request (ARQ), the sender transmits one frame, starts a retransmission timer, and waits for an acknowledgment (ACK) before sending the next frame. Sequence numbers alternate between 0 and 1 (1-bit sequence number) so the receiver can distinguish fresh frames from duplicates caused by lost ACKs. While simple to implement, Stop-and-Wait suffers severe under-utilization on high-bandwidth-delay links because the sender remains idle for an entire round-trip time (RTT) per frame.
Worked Numerical 2.4: Stop-and-Wait Link Efficiency
A 1 Gbps link has a one-way propagation delay of 10 ms and transmits 1,250-byte (10,000-bit) frames. Find the Stop-and-Wait utilization.
Step 1: .
Step 2: .
Step 3: . Clearly, pipelining via sliding windows is essential on high-speed links.
7.2 Sliding Window Protocols: Go-Back-N and Selective Repeat
Sliding window protocols allow the sender to transmit up to unacknowledged frames in flight simultaneously (pipelining), keeping the channel busy. To achieve 100% link utilization on a link with ratio , the window size must satisfy .
- Go-Back-N ARQ: The sender window size is up to (for -bit sequence numbers; using would cause wrap-around ambiguity if all ACKs were lost), while the receiver window size is strictly
1. The receiver accepts frames only in exact order and sends cumulative ACKs. If frame is lost or corrupted, the receiver discards all subsequent out-of-order frames ; when the sender's timer for expires, it goes back and retransmits and every subsequent frame in the window. - Selective Repeat ARQ: Both sender and receiver maintain a window of size (half the sequence number space, preventing wrap-around ambiguity between old and new frames). The receiver buffers valid out-of-order frames and returns a Negative Acknowledgment (NAK) for a missing frame. The sender retransmits only the specific damaged or lost frame, conserving bandwidth on high-error or high-latency links at the expense of greater receiver buffer complexity.
| Parameter | Stop-and-Wait ARQ | Go-Back-N ARQ | Selective Repeat ARQ |
|---|---|---|---|
| Sender Window () | 1 | ||
| Receiver Window () | 1 | 1 | |
| Out-of-Order Buffering | No | No (discarded) | Yes (buffered until gap filled) |
| Retransmission Scope | Single frame | Lost frame + all following | Only lost/corrupted frame |
Chapter 8: Multiple Access, LAN Standards and Network Devices
8.1 Random Access: ALOHA and CSMA Variants
When multiple stations share a single broadcast medium, Medium Access Control (MAC) protocols prevent or resolve frame collisions:
- Pure ALOHA: Stations transmit whenever data is ready. If a collision occurs, the station waits a random backoff and retransmits. The vulnerable period is , yielding maximum throughput , peaking at when offered load .
- Slotted ALOHA: Time is divided into discrete slots of duration , and stations may transmit only at slot boundaries. This halves the vulnerable period to , doubling maximum throughput to at .
- CSMA (Carrier Sense Multiple Access): Stations listen to the medium before transmitting ("listen before talk"). In 1-persistent CSMA, a station senses continuously and transmits immediately when idle; in non-persistent CSMA, it backs off randomly if busy; in p-persistent CSMA, it transmits with probability on an idle slot.
- CSMA/CD (Collision Detection): Used in classic half-duplex wired Ethernet. Stations monitor the wire while transmitting; upon detecting a voltage spike from a collision, they abort immediately, emit a 32-bit jam signal, and execute Binary Exponential Backoff (waiting to slot times after collisions, capped at , aborting at 16 attempts). To guarantee collision detection before a frame finishes, minimum frame transmission time must satisfy (giving Ethernet's 64-byte minimum frame).
- CSMA/CA (Collision Avoidance): Used in IEEE 802.11 Wi-Fi, where wireless radios cannot simultaneously transmit and listen for collisions due to near-far signal masking and the hidden terminal problem (two stations out of range of each other both transmit to the same Access Point). Stations use Interframe Spaces (DIFS/SIFS), random backoff timers, positive ACKs, and optional RTS/CTS (Request-to-Send / Clear-to-Send) handshakes to reserve the medium via a Network Allocation Vector (NAV).
Worked Numerical 2.5: CSMA/CD Minimum Frame Size
A 100 Mbps Ethernet LAN uses CSMA/CD with a maximum cable span of 250 m and propagation speed . Find the minimum frame size required for reliable collision detection.
Step 1: .
Step 2: Round-trip collision window = .
Step 3: Minimum frame size = (standard Ethernet enforces 64 bytes to accommodate repeaters).
8.2 LAN Standards: Ethernet, Token Bus, and Token Ring
- Ethernet (IEEE 802.3): Defines a 48-bit MAC address (6 octets, e.g.,
00:1A:2B:3C:4D:5E), Preamble (7 bytes of alternating 1s and 0s) + Start Frame Delimiter SFD (1 byte10101011), Destination/Source MACs (6 bytes each), Type/Length (2 bytes), Payload (46–1500 bytes), and 4-byte CRC-32 FCS. Modern switched Fast (100 Mbps), Gigabit (1 Gbps), and 10G Ethernet operate full-duplex over twisted pair or fiber without collisions. - Token Bus (IEEE 802.4): Stations attach to a physical coaxial bus but form a logical ring ordered by station address; a control token passes sequentially, granting deterministic collision-free transmission rights suitable for factory automation.
- Token Ring (IEEE 802.5): Stations connect in a physical ring using Differential Manchester encoding. A 3-byte free token circulates; a station seizes the token, flips a bit to mark it busy, appends its frame, and releases a new token after the frame completes the loop.
8.3 Network Interconnection Devices
| Device | OSI Layer | Primary Function | Collision / Broadcast Domains |
|---|---|---|---|
| Repeater | Layer 1 (Physical) | Regenerates and retimes attenuated bit signals across cable segments. | Single collision & single broadcast domain |
| Hub | Layer 1 (Physical) | Multiport repeater; broadcasts incoming bits out all other ports. | Single collision & single broadcast domain |
| Bridge | Layer 2 (Data Link) | Filters/forwards frames between LAN segments using MAC learning tables and STP. | Separates collision domains; 1 broadcast domain |
| Switch | Layer 2 (Data Link) | Multiport hardware bridge; provides dedicated full-duplex bandwidth per port. | Each port is a collision domain; 1 broadcast domain (unless VLANs) |
| Router | Layer 3 (Network) | Forwards IP packets across distinct networks using routing tables and longest-prefix match. | Separates both collision and broadcast domains |
| Gateway | Layer 7 (Application) | Translates between dissimilar protocol stacks, message formats, or architectures. | Full protocol isolation |
Switches operate in two primary forwarding modes: Store-and-Forward (buffers the entire frame, verifies the CRC-32 FCS, and drops corrupted frames before forwarding) and Cut-Through (reads only the 6-byte destination MAC address and begins forwarding immediately for ultra-low latency). To prevent broadcast storms in redundant switched topologies, switches run the Spanning Tree Protocol (STP, IEEE 802.1D) to logically block redundant loop paths.
8.4 HDLC and Point-to-Point Protocol (PPP)
High-Level Data Link Control (HDLC) is a bit-oriented protocol defining three frame types: Information frames (I-frames) for user data and piggybacked ACKs, Supervisory frames (S-frames) for flow/error control (RR, RNR, REJ, SREJ), and Unnumbered frames (U-frames) for link setup and disconnection. Each HDLC frame is delimited by 0x7E flags using bit stuffing. The Point-to-Point Protocol (PPP, RFC 1661) adapts HDLC framing (with byte stuffing) for serial WAN links and DSL/fiber broadband, providing Link Control Protocol (LCP) for link negotiation/authentication (PAP/CHAP) and Network Control Protocols (NCP/IPCP) for dynamic IP assignment.
8.5 Channelization Protocols and Virtual LANs (VLANs)
Unlike random-access CSMA, channelization divides the shared link deterministically among stations via Frequency-Division Multiple Access (FDMA), Time-Division Multiple Access (TDMA, assigning dedicated slots as in GSM cellular), or Code-Division Multiple Access (CDMA).
In large switched Ethernet campuses, a single flat Layer 2 broadcast domain suffers excessive ARP and broadcast traffic. Virtual LANs (VLANs, IEEE 802.1Q) logically partition a physical switch into multiple isolated broadcast domains by inserting a 4-byte 802.1Q tag (containing a 12-bit VLAN ID supporting up to 4,094 VLANs) into Ethernet frames traversing inter-switch trunk links. Traffic between different VLANs must pass through a Layer 3 router or Layer 3 switch, improving both security and scalability.
8.6 Worked Numerical 2.6: Pipelined Satellite Link Window Size
A geostationary satellite link has a bandwidth of 10 Mbps and a one-way propagation delay of 270 ms. Frames are 1,000 bytes (8,000 bits) long. What minimum sliding-window size is required to achieve 100% channel utilization?
Step 1: Frame transmission time: .
Step 2: Ratio .
Step 3: Required window size: . Because , at least sequence-number bits () are needed for Go-Back-N, or bits () for Selective Repeat.
8.7 Worked Numerical 2.7: Two-Dimensional Parity (LRC) Error Detection
Consider four 7-bit ASCII characters transmitted with an 8th even-parity VRC bit per row and an LRC even-parity byte at the bottom:
Row 1 (Data + VRC): 1 0 1 0 1 0 1 | 0 (four 1s -> even) Row 2 (Data + VRC): 1 1 0 0 1 1 0 | 0 (four 1s -> even) Row 3 (Data + VRC): 0 1 1 1 0 0 1 | 0 (four 1s -> even) Row 4 (Data + VRC): 0 0 1 1 1 0 1 | 0 (four 1s -> even) -------------------------------------- LRC Parity Byte : 0 0 1 0 1 1 1 | 0 (column-wise even parity)
If a 3-bit burst corrupts bits 2, 3, and 4 in Row 2, Row 2's VRC parity fails, and columns 2, 3, and 4 fail their LRC checks—pinpointing the exact corrupted bits. Only a symmetric 4-bit error pattern forming a rectangle across two rows and two columns can evade both VRC and LRC simultaneously.
8.8 Comparative Summary of Error Control Techniques
| Technique | Mechanism | Detection / Correction Capability | Typical Protocol Usage |
|---|---|---|---|
| VRC (Simple Parity) | 1 parity bit per data unit | Detects all odd-numbered bit errors; misses even errors | Legacy serial UART / ASCII links |
| LRC (2D Parity) | Row + column parity matrix | Detects burst errors up to row width; misses 4-bit rectangles | Magnetic tape & legacy block links |
| Checksum | 1's complement modular sum | Fast software check; weaker against compensating bit flips | IPv4 header, TCP, UDP |
| CRC (Polynomial) | Modulo-2 polynomial division | Detects all single, double, odd, and burst errors up to degree | Ethernet (CRC-32), Wi-Fi, HDLC |
| Hamming Code | Overlapping power-of-2 parity bits | Corrects 1-bit errors (or detects 2-bit with extra parity) | ECC RAM, satellite & embedded links |
8.9 Deep-Dive: Ethernet Frame Format and MAC Addressing
Every IEEE 802.3 Ethernet network interface card (NIC) is burned with a globally unique 48-bit (6-byte) Media Access Control (MAC) address, conventionally written as six colon-separated hexadecimal pairs (e.g., 3C:52:82:4A:19:F0). The first 24 bits constitute the Organizationally Unique Identifier (OUI) assigned to the hardware manufacturer by IEEE, while the remaining 24 bits are assigned uniquely by the vendor. The broadcast MAC address FF:FF:FF:FF:FF:FF is delivered to all stations on the local broadcast domain, whereas multicast MACs set the least-significant bit of the first octet to 1.
| Ethernet Field | Size (Bytes) | Purpose and Encoding |
|---|---|---|
| Preamble + SFD | 7 + 1 | Alternating 10101010 clock-sync pattern ending with 10101011 Start Frame Delimiter. |
| Destination MAC | 6 | Physical address of target NIC, router interface, or broadcast/multicast group. |
| Source MAC | 6 | Physical address of originating NIC (always unicast). |
| EtherType / Length | 2 | Values ≥ 1536 indicate Layer 3 protocol (0x0800 IPv4, 0x0806 ARP, 0x86DD IPv6). |
| Payload (Data + Pad) | 46 – 1500 | Encapsulated Layer 3 packet; padded to 46 bytes if shorter to meet 64-byte minimum frame. |
| FCS (CRC-32) | 4 | 32-bit Cyclic Redundancy Check computed over Destination MAC through Payload. |
8.10 Worked Numerical 2.8: Pure vs. Slotted ALOHA Throughput
A shared wireless channel transmits 200-bit frames at 200 kbps (frame time ). Suppose stations generate 1,000 frames/second in aggregate (). Compare the effective throughput under Pure ALOHA and Slotted ALOHA.
- Pure ALOHA: (13.53% of channel capacity, or 135.3 successful frames/s).
- Slotted ALOHA: (36.79% of channel capacity, or 367.9 successful frames/s).
Slotted ALOHA achieves nearly triple the throughput at because restricting transmissions to slot boundaries cuts the collision vulnerability window in half.
8.11 Piggybacking, Bidirectional Sliding Windows and Wireless 802.11
In full-duplex communication, instead of sending a separate tiny acknowledgment frame back to the sender, the receiver waits briefly until it has an outgoing data frame of its own and attaches the acknowledgment sequence number inside the header of that outgoing data frame. This optimization, called piggybacking, substantially reduces frame header overhead and medium contention. If no outgoing data arrives within a short acknowledgment timer, the station transmits a standalone S-frame ACK.
In IEEE 802.11 Wi-Fi LANs, stations communicate through an Access Point (Infrastructure BSS) or directly peer-to-peer (Ad-hoc IBSS). Because wireless channels suffer multipath fading and high bit-error rates, 802.11 uses an acknowledged connectionless Data Link service: every unicast data frame must be explicitly acknowledged after a Short Interframe Space (SIFS) interval. Before transmitting, a station senses the channel for a Distributed Interframe Space (DIFS); if busy, it enters a random contention window backoff. Modern Wi-Fi standards (802.11n/ac/ax, Wi-Fi 5/6) combine MIMO spatial streams, channel bonding (40/80/160 MHz), and OFDMA to reach multi-gigabit speeds.
8.12 Worked Numerical 2.9: CRC Error-Burst Detection Analysis
Prove why a CRC generator polynomial of degree detects any single-bit error, any two-bit error (if is primitive), and any burst error of length :
- Single-Bit Error: Represented as . Provided has at least two non-zero terms ( and ), can never divide , yielding a non-zero remainder.
- Burst Error of Length : Represented as . Since does not divide (because its constant term is 1) and the degree of the bracketed polynomial () is strictly less than , cannot divide . Therefore, 100% of burst errors of length are guaranteed to be detected.
8.13 Spanning Tree Protocol (STP) and Ethernet Speed Evolution
In enterprise switched LANs, redundant physical links between switches create Layer 2 loops that trigger catastrophic broadcast storms, MAC table instability, and multiple frame copies. The Spanning Tree Protocol (STP, IEEE 802.1D) and Rapid STP (IEEE 802.1w) prevent loops automatically by electing a single Root Bridge (lowest Bridge ID = Priority + MAC), computing the shortest-cost path from every non-root switch to the Root Bridge, and placing redundant backup links into a Blocking state while keeping primary links in a Forwarding state. If an active link fails, STP reconverges and unblocks the backup port.
Over four decades, IEEE 802.3 Ethernet evolved from 10 Mbps shared coaxial bus (10BASE5/10BASE2) and 10BASE-T hubs to 100 Mbps Fast Ethernet (100BASE-TX), 1 Gbps Gigabit Ethernet (1000BASE-T over 4-pair Cat5e using PAM-5 modulation), and 10/40/100 Gbps full-duplex switched fiber backbones—preserving the exact 802.3 frame format across every generation.
Module III: Network Layer, Routing and Transport Protocols
Chapter 9: Switching Techniques and Network Layer Addressing
9.1 Switching Techniques
Data traverses wide-area networks using three classical switching paradigms:
| Criterion | Circuit Switching | Message Switching | Packet Switching |
|---|---|---|---|
| Path Setup | Dedicated physical path reserved before transfer | No dedicated path; store-and-forward entire message | No physical reservation (Datagram) or logical VC |
| Bandwidth Efficiency | Low during idle periods | High (shared links) | Highest (statistical multiplexing of small packets) |
| Delay Profile | Initial setup delay, then constant low delay | High queuing/storage delay per hop | Low variable queuing delay; pipelined forwarding |
| Typical Application | Legacy PSTN voice telephony | Early telegraphy / store-and-forward email | Modern Internet (IP, Ethernet, MPLS) |
Within packet switching, Datagram networks route each packet independently using its destination IP address—packets from the same flow may take different paths and arrive out of order. In contrast, Virtual Circuit (VC) networks (such as ATM, Frame Relay, and MPLS) establish a logical path during a signaling setup phase and forward packets using short local VC identifiers, preserving packet ordering.
9.2 IPv4 Header Structure and Fragmentation
The Internet Protocol version 4 (IPv4, RFC 791) provides best-effort, connectionless packet delivery across heterogeneous networks. Its minimum header is 20 bytes (up to 60 bytes with Options) containing: Version (4 bits, value 4), IHL (4 bits, header length in 32-bit words), DSCP/ECN (8 bits, QoS priority), Total Length (16 bits, max 65,535 bytes), Identification (16 bits, groups fragments), Flags (3 bits: Reserved, Don't Fragment DF, More Fragments MF), Fragment Offset (13 bits, in units of 8 bytes), Time-To-Live (TTL) (8 bits, decremented at each router to prevent loops), Protocol (8 bits: 1=ICMP, 6=TCP, 17=UDP, 89=OSPF), Header Checksum (16 bits), and 32-bit Source and Destination IP addresses.
Worked Numerical 3.1: IPv4 Packet Fragmentation
A 4,020-byte IPv4 packet (20-byte header + 4,000-byte payload) arrives at a router whose outgoing link has a Maximum Transmission Unit (MTU) of 1,500 bytes. How is it fragmented?
Step 1: Max payload per fragment = (1480 is divisible by 8: ).
Step 2: Fragment 1 carries bytes 0–1479 (Total Length = 1500, MF = 1, Offset = 0). Fragment 2 carries bytes 1480–2959 (Total Length = 1500, MF = 1, Offset = 185). Fragment 3 carries the remaining (Total Length = 1060, MF = 0, Offset = 370).
9.3 IPv4 Addressing, CIDR, Subnetting and IPv6
An IPv4 address is a 32-bit identifier written in dotted-decimal notation (e.g., 192.168.10.1). Traditional classful addressing divided addresses rigidly into Class A (/8), Class B (/16), and Class C (/24), wasting massive address blocks. Modern networks use Classless Inter-Domain Routing (CIDR), written as A.B.C.D/n, where is the network prefix length in bits and bits identify hosts. The maximum usable hosts per subnet is (excluding the all-zeros network ID and all-ones broadcast address).
Worked Numerical 3.2: CIDR Subnetting
Divide the network 192.168.20.0/24 into 4 equal subnets. Determine the new prefix, subnet mask, usable hosts per subnet, and the exact range of Subnet 2.
Step 1: Borrowing bits creates bits. New prefix is .
Step 2: Subnet mask for /26 has 26 ones: 255.255.255.192 (block size ).
Step 3: Host bits remaining: . Usable hosts per subnet: .
Step 4: The four subnets are .0/26, .64/26, .128/26, and .192/26. For Subnet 2: Network ID = 192.168.20.64, Broadcast = 192.168.20.127, Usable Hosts = 192.168.20.65 to 192.168.20.126.
To mitigate IPv4 exhaustion, enterprises deploy Network Address Translation (NAT / PAT) at border routers, mapping multiple private RFC 1918 addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) onto a single public IPv4 address using unique source port numbers. Long-term, IPv6 expands addresses to 128 bits written as eight 16-bit hexadecimal groups separated by colons (e.g., 2001:0db8:85a3::8a2e:0370:7334). IPv6 streamlines the header to a fixed 40 bytes, removes header checksums and router fragmentation, mandates stateless address autoconfiguration (SLAAC), and supports Unicast, Multicast, and Anycast addressing (eliminating broadcast).
Chapter 10: Routing Algorithms
10.1 Classification of Routing
Routing is the Network Layer process of selecting optimal paths from source to destination across an internetwork, distinct from forwarding (the local hardware lookup of moving an arriving packet from an input port to an output port). Non-adaptive (Static) routing computes routes offline and loads fixed tables manually; it cannot react to link failures. Adaptive (Dynamic) routing continuously adapts to topology changes and traffic loads using distributed routing algorithms.
10.2 Shortest Path Algorithm (Dijkstra)
Dijkstra's algorithm computes the minimum-cost path from a single source node to all other nodes in a weighted graph with non-negative link weights. Each node maintains a tentative distance label and predecessor; at each iteration, the unvisited node with the smallest tentative distance is marked permanent and used to relax its neighbors' distances.
Graph Edges: (A-B: 2), (A-C: 5), (B-C: 1), (B-D: 4), (C-D: 2), (C-E: 6), (D-E: 3) Init : d(A)=0, d(B)=inf, d(C)=inf, d(D)=inf, d(E)=inf Step 1 (Pick A=0): Relax B=2(via A), C=5(via A) Step 2 (Pick B=2): Relax C=min(5, 2+1)=3(via B), D=2+4=6(via B) Step 3 (Pick C=3): Relax D=min(6, 3+2)=5(via C), E=3+6=9(via C) Step 4 (Pick D=5): Relax E=min(9, 5+3)=8(via D) Step 5 (Pick E=8): Done. Final Shortest Paths from A: B(2), C(3: A->B->C), D(5: A->B->C->D), E(8: A->B->C->D->E)
10.3 Flooding
Flooding is a simple non-adaptive algorithm in which every incoming packet is forwarded out on every outgoing line except the one on which it arrived. To prevent infinite packet loops, each packet carries a Hop Count decremented at every router (discarded at zero), or routers track source-sequence numbers to suppress duplicates. Selective flooding forwards packets only along lines going roughly in the right direction. Flooding guarantees finding the shortest path in unweighted networks and is highly fault-tolerant, making it ideal for distributing Link State Advertisements in OSPF.
10.4 Distance Vector vs. Link State Routing
- Distance Vector Routing (Bellman-Ford): Each router maintains a vector of minimum distances to all destinations and periodically exchanges its entire vector with immediate neighbors only. While simple, it suffers slow convergence and the count-to-infinity problem when links fail (routers bounce bad news back and forth incrementing metrics toward infinity), mitigated partially by Split Horizon (never advertise a route back out the interface it was learned from) and Poison Reverse.
- Link State Routing: Each router discovers its direct neighbors, measures link costs, packages them into a Link State Packet (LSP), and floods the LSP to all routers in the area. Every router builds an identical complete topology map and runs Dijkstra's algorithm independently, achieving fast, loop-free convergence.
10.5 Hierarchical Routing
As networks grow to millions of nodes, flat routing tables become prohibitively large and update traffic consumes excessive bandwidth. Hierarchical routing partitions the network into regions (autonomous systems or areas). Routers know full topological detail within their own region but maintain only aggregated prefix entries for external regions, trading slight path sub-optimality for dramatic reductions in table size and CPU overhead. For a network of routers partitioned into 24 regions of 30 routers each, each router's table shrinks from 720 entries down to entries—over a 92% reduction.
Chapter 11: Transport Layer Elements and Congestion Control
11.1 Elements of Transport Protocols
The Transport Layer (Layer 4) provides logical end-to-end communication between application processes:
- Addressing (Port Numbers): 16-bit Transport Service Access Points (TSAPs / ports) identify specific applications (Well-known 0–1023, Registered 1024–49151, Ephemeral 49152–65535).
- Connection Establishment: Uses a Three-Way Handshake (
SYN,SYN-ACK,ACK) with pseudo-random initial sequence numbers (ISNs) to synchronize state and reject delayed duplicate segments from prior connections. - Connection Release: Asymmetric termination risks data loss, and symmetric release faces the theoretical Two-Army Problem (no finite handshake guarantees both sides know the other received the final ACK). TCP uses a graceful four-step
FIN/ACKexchange with aTIME_WAITtimer. - Flow Control and Buffering: Uses sliding windows and dynamically sized circular buffers to prevent fast senders from overflowing slow receivers.
- Multiplexing and Demultiplexing: Combines streams from multiple sockets onto the Network Layer and delivers incoming segments to the correct socket using 4-tuple identifiers (source IP, source port, destination IP, destination port).
11.2 Congestion Control: Leaky Bucket and Token Bucket
Congestion occurs when offered packet load exceeds network router and link capacity, causing queue overflow, packet drops, and retransmission collapse. Open-loop traffic shaping regulates bursty flows before they enter the network:
- Leaky Bucket Algorithm: Models a bucket with a small hole at the bottom. Incoming packets of arbitrary burstiness enter the bucket (finite queue of size bytes); if full, excess packets are discarded. Packets drain out at a constant, rigid output rate bytes/s, completely smoothing traffic into a uniform stream.
- Token Bucket Algorithm: A bucket of capacity tokens fills at a constant rate tokens/s. To transmit a packet of bytes, tokens must be removed from the bucket. Unlike Leaky Bucket, Token Bucket permits controlled bursts up to maximum rate bytes/s for a duration until accumulated tokens are exhausted:
Worked Numerical 3.3: Token Bucket Burst Duration
A Token Bucket has capacity , token arrival rate , and maximum host output rate . Compute the maximum burst duration and total bytes sent during the burst.
Step 1: Convert units consistently: .
Step 2: .
Step 3: Total bytes sent at 10 MB/s: .
Chapter 12: Transport Layer Protocols — TCP and UDP
12.1 User Datagram Protocol (UDP)
UDP is a minimal, connectionless, unreliable transport protocol defined in RFC 768. It adds only an 8-byte header containing Source Port (16 bits), Destination Port (16 bits), Length (16 bits), and a Checksum (16 bits, optional in IPv4, mandatory in IPv6). UDP performs no handshaking, ordering, retransmission, or congestion control, making it ideal for latency-sensitive applications such as DNS lookups, DHCP, VoIP, live video streaming, and online gaming.
12.2 Transmission Control Protocol (TCP)
TCP (RFC 793 / RFC 9293) provides a reliable, full-duplex, connection-oriented byte stream over unreliable IP. Its 20-byte minimum header includes 32-bit Sequence and Acknowledgment numbers, a 16-bit Advertised Window for flow control, control flags (SYN, ACK, FIN, RST, PSH, URG), and a mandatory Checksum. TCP dynamically adjusts its sending rate using a Congestion Window (cwnd) via four phases: Slow Start (exponential growth, doubling cwnd per RTT until reaching ssthresh), Congestion Avoidance (linear Additive Increase Multiplicative Decrease, AIMD), Fast Retransmit (retransmitting immediately upon receiving 3 duplicate ACKs without waiting for timeout), and Fast Recovery.
| Feature | TCP | UDP |
|---|---|---|
| Connection Model | Connection-oriented (3-way handshake) | Connectionless (no handshake) |
| Reliability | Guaranteed ordered delivery via ACKs & timers | Best-effort; packets may be lost or reordered |
| Header Overhead | 20 bytes (up to 60 bytes with options) | Fixed 8 bytes |
| Flow & Congestion Control | Built-in (sliding window, AIMD, Slow Start) | None (handled by application if needed) |
| Data Abstraction | Unstructured byte stream | Discrete message boundaries (datagrams) |
| Use Cases | HTTP/HTTPS, FTP, SMTP, SSH | DNS, DHCP, RTP streaming, SNMP |
12.3 Variable Length Subnet Masking (VLSM), ARP and ICMP
Standard fixed-length subnetting wastes IP addresses when departments have vastly different host counts. Variable Length Subnet Masking (VLSM) allocates subnets of different prefix lengths from the same parent block, always assigning the largest subnet first to avoid address overlap.
Worked Numerical 3.4: VLSM Design
Allocate subnets from 192.168.10.0/24 for: Dept A (100 hosts), Dept B (50 hosts), and Dept C (12 hosts).
- Dept A (100 hosts): Needs hosts (). Assigned
192.168.10.0/25(Usable:.1–.126, Broadcast:.127). - Dept B (50 hosts): Needs hosts (). Assigned
192.168.10.128/26(Usable:.129–.190, Broadcast:.191). - Dept C (12 hosts): Needs hosts (). Assigned
192.168.10.192/28(Usable:.193–.206, Broadcast:.207).
Two essential helper protocols support IPv4 at Layer 3: ARP (Address Resolution Protocol) broadcasts an Ethernet frame asking "Who has IP X?" to resolve a known IPv4 address into its 48-bit MAC address on the local LAN, caching the mapping in an ARP table. ICMP (Internet Control Message Protocol, RFC 792) reports delivery errors (Destination Unreachable, Time Exceeded for traceroute) and supports reachability diagnostics (Echo Request/Reply for ping).
12.4 Count-to-Infinity in Distance Vector Routing
Consider a linear 3-router topology A — B — C where each link has cost 1. Initially, B reaches A with cost 1, and C reaches A via B with cost 2. If link A—B fails, B marks A as unreachable (). However, before B can notify C, C sends its periodic update advertising "I can reach A in 2 hops." Naive B updates its route to A via C with cost . On the next cycle, C sees B's cost increased to 3 and updates its own cost to 4, looping upward toward infinity (16 in RIP). Split Horizon prevents C from advertising a route to A back to B (the next hop for that route), breaking 2-node loops immediately.
12.5 TCP Congestion Window Evolution and Closed-Loop Control
In addition to open-loop traffic shaping (Leaky Bucket and Token Bucket), networks employ closed-loop congestion control where routers signal congestion back to senders using Choke Packets, Explicit Congestion Notification (ECN) IP header bits, or Random Early Detection (RED)—probabilistically dropping packets before queues overflow completely.
Inside TCP, the sender maintains a Congestion Window (cwnd) and Slow Start Threshold (ssthresh), limiting unacknowledged bytes in flight to :
- Slow Start: Starting at
cwnd = 1 MSS,cwndincreases by 1 MSS for every ACK received, doubling exponentially each RTT until reachingssthresh. - Congestion Avoidance (AIMD): Above
ssthresh,cwndincreases linearly by roughly 1 MSS per RTT. - Packet Loss Reaction: Upon a Retransmission Timeout (RTO), TCP sets
ssthresh = cwnd / 2and resetscwnd = 1 MSS(re-entering Slow Start). Upon 3 Duplicate ACKs (Fast Retransmit/Fast Recovery), TCP halvesssthresh = cwnd / 2and setscwnd = ssthresh, avoiding a drastic drop to 1 MSS.
Furthermore, to prevent Silly Window Syndrome (transmitting tiny 1-byte segments), Nagle's Algorithm buffers small writes while unacknowledged data is in flight, and Clark's Solution prevents receivers from advertising tiny window increments.
Client Server | --- SYN (seq=100) -----------------> | [Connection Setup] | <-- SYN-ACK (seq=300, ack=101) ----- | | --- ACK (seq=101, ack=301) --------> | [ESTABLISHED] | | | --- FIN (seq=500) -----------------> | [Graceful Teardown] | <-- ACK (ack=501) ------------------ | [Half-closed: server still sends] | <-- FIN (seq=800) ------------------ | | --- ACK (ack=801) -----------------> | [Client enters TIME_WAIT (2*MSL)]
12.6 IPv4 Header Breakdown and Longest-Prefix Matching
When a Layer 3 router receives an IPv4 packet, it inspects the 32-bit Destination IP address and searches its forwarding table using Longest-Prefix Matching: if multiple CIDR routes match the destination address, the router selects the route with the longest subnet mask (most specific prefix). For example, if a routing table contains 192.168.0.0/16 (Interface A), 192.168.16.0/20 (Interface B), and 192.168.20.0/24 (Interface C), an arriving packet destined for 192.168.20.45 matches all three entries, but is forwarded out Interface C because /24 is the longest matching prefix.
| IPv4 Header Field | Bit Width | Functional Role |
|---|---|---|
| Version & IHL | 4 + 4 bits | Identifies IPv4 (4) and header length in 32-bit words (5 = 20 bytes without options). |
| DSCP & ECN | 6 + 2 bits | Differentiated Services QoS priority and Explicit Congestion Notification signaling. |
| Total Length | 16 bits | Combined header + payload length in bytes (maximum 65,535 bytes). |
| ID, Flags, Frag Offset | 16 + 3 + 13 bits | Supports fragmentation and reassembly when crossing smaller-MTU links. |
| TTL & Protocol | 8 + 8 bits | Hop limit preventing routing loops; identifies upper-layer protocol (TCP=6, UDP=17). |
| Header Checksum | 16 bits | 1's complement checksum over the IPv4 header (recomputed at every router hop as TTL drops). |
12.7 IPv6 Transition Mechanisms and Quality of Service (QoS)
Because IPv4 and IPv6 headers are incompatible, networks migrate using three transition strategies: (1) Dual-Stack (hosts and routers run both IPv4 and IPv6 protocol stacks simultaneously, preferring IPv6 when DNS returns an AAAA record), (2) Tunneling (encapsulating IPv6 packets inside IPv4 payloads to traverse legacy IPv4-only core networks), and (3) NAT64 / DNS64 (translating IPv6-only client packets into IPv4 at a border gateway).
To support latency-sensitive traffic alongside bulk downloads, IP networks implement Quality of Service (QoS) under two architectures: Integrated Services (IntServ) uses the Resource Reservation Protocol (RSVP) to reserve per-flow bandwidth along every router on a path (high precision, poor core scalability), whereas Differentiated Services (DiffServ) classifies packets at the network edge using the 6-bit DSCP field into Per-Hop Behaviors (Expedited Forwarding for VoIP, Assured Forwarding for priority business apps, Best-Effort for general traffic).
12.8 Worked Numerical 3.5: Circuit vs. Packet Switching End-to-End Delay
Compare the total time to transfer a 640-kilobit message across 4 hops (each link 1 Mbps, propagation delay 1 ms per hop) using: (a) Circuit Switching with a 10 ms call-setup phase, and (b) Packet Switching with 10-kilobit packets (negligible header overhead).
- Circuit Switching: Setup = 10 ms. Message transmission = . Total propagation across 4 hops = . Total = .
- Packet Switching: 64 packets of 10 kb each; transmission time per packet per hop = . First packet reaches destination in ; the remaining 63 packets follow pipelined 10 ms apart: (and if setup were 50 ms, packet switching would win decisively).
12.9 Broadcast and Multicast Routing
When a host sends a packet to all destinations in a network (broadcast) or to a subscribed subset of hosts (multicast), naive flooding generates severe duplicate traffic. Reverse Path Forwarding (RPF) eliminates duplicates without maintaining global spanning trees: when a router receives a broadcast packet from source on incoming interface , it checks its unicast routing table. If is the exact interface the router would normally use to reach (the shortest path back to the source), the router forwards the packet out all other interfaces; otherwise, it silently discards the duplicate.
For IP Multicast (Class D addresses 224.0.0.0–239.255.255.255), hosts join or leave multicast groups using the Internet Group Management Protocol (IGMP), and routers build loop-free distribution trees using protocols such as Protocol Independent Multicast (PIM-SM / PIM-DM) and MOSPF, ensuring only one copy of a live video stream traverses each shared backbone link.
12.10 TCP Segment Header Breakdown and State Machine
Every TCP segment carries a 20-byte fixed header (plus optional fields up to 40 bytes) that enables reliable, ordered, flow-controlled delivery:
| TCP Header Field | Size | Description |
|---|---|---|
| Source & Dest Ports | 16 + 16 bits | Identify sending and receiving application sockets on end hosts. |
| Sequence Number | 32 bits | Byte-stream offset of the first payload byte in this segment (or ISN if SYN=1). |
| Acknowledgment Number | 32 bits | Next byte sequence number expected by the receiver (cumulative ACK). |
| Data Offset & Flags | 4 + 6+ bits | Header length in 32-bit words; control bits URG, ACK, PSH, RST, SYN, FIN. |
| Window Size | 16 bits | Receiver's advertised buffer space (rwnd) for flow control (scaled via Window Scale option). |
| Checksum & Urgent Ptr | 16 + 16 bits | Covers TCP header, payload, and IP pseudo-header; marks urgent data offset. |
During its lifetime, a TCP endpoint transitions through 11 well-defined states: CLOSED, LISTEN, SYN_SENT, SYN_RCVD, ESTABLISHED, FIN_WAIT_1, FIN_WAIT_2, CLOSE_WAIT, CLOSING, LAST_ACK, and TIME_WAIT. The TIME_WAIT state lasts for twice the Maximum Segment Lifetime (, typically 60–120 seconds) so delayed segments from the closed connection expire before the same 4-tuple port pair is reused.
12.11 Worked Numerical 3.6: TCP Congestion Window Evolution Trace
Suppose a TCP connection has Maximum Segment Size (MSS) = 1 KB and initial ssthresh = 16 KB. Trace cwnd from RTT 1 through a 3-Duplicate-ACK event at RTT 7:
| RTT | Phase | cwnd (KB) | ssthresh (KB) | Notes |
|---|---|---|---|---|
| 1 | Slow Start | 1 | 16 | Initial window 1 MSS |
| 2 | Slow Start | 2 | 16 | Doubles on ACK |
| 3 | Slow Start | 4 | 16 | Exponential growth |
| 4 | Slow Start | 8 | 16 | Exponential growth |
| 5 | Slow Start → CA | 16 | 16 | Reached ssthresh; enter Congestion Avoidance |
| 6 | Congestion Avoidance | 17 | 16 | Linear AIMD (+1 MSS/RTT) |
| 7 | 3 Duplicate ACKs | 9 | 9 | Fast Retransmit: halves ssthresh & cwnd (approx. 17/2 = 8.5 → 9) |
| 8 | Congestion Avoidance | 10 | 9 | Resumes linear +1 MSS/RTT growth |
Had a full Retransmission Timeout (RTO) occurred at RTT 7 instead of 3 Duplicate ACKs, ssthresh would still drop to 9 KB, but cwnd would reset all the way to 1 KB (Slow Start).
12.12 Worked Numerical 3.7: Leaky Bucket vs. Token Bucket Comparison
Suppose a host emits a 2 MB burst of packets in 0.1 s (20 MB/s), followed by 0.9 s of silence. Compare how a Leaky Bucket (output rate 2 MB/s, capacity 1 MB) and a Token Bucket (token rate 2 MB/s, capacity 1 MB, max output 10 MB/s) shape this traffic:
- Leaky Bucket: Smooths output rigidly to 2 MB/s. In 0.1 s, only 0.2 MB drains while 1.8 MB attempts to queue; because bucket capacity is 1 MB, 0.8 MB of packets are dropped. The remaining 1 MB drains steadily over the next 0.5 s.
- Token Bucket: Starts full with 1 MB of tokens, allowing an immediate burst at 10 MB/s for , transmitting without dropping packets during the initial spike, then throttling smoothly to the token arrival rate of 2 MB/s.
Thus, Leaky Bucket enforces a strict constant bit rate, whereas Token Bucket accommodates legitimate bursty application traffic while bounding long-term average bandwidth.
12.13 Worked Numerical 3.8: UDP Pseudo-Header Checksum Verification
Unlike IPv4's header-only checksum, UDP (and TCP) computes a 16-bit 1's complement checksum covering a 12-byte IP pseudo-header (Source IP, Destination IP, Zero byte, Protocol=17, UDP Length), the 8-byte UDP header, and the entire application payload (zero-padded to an even byte boundary). Including the IP addresses in the pseudo-header protects the transport layer against misrouted packets delivered to the wrong host IP. If the computed checksum happens to equal 0x0000, UDP transmits 0xFFFF (since 0x0000 in IPv4 indicates "checksum disabled").
12.14 IPv6 Address Compression and Special Addresses
Because writing 32 hexadecimal digits in IPv6 is cumbersome, RFC 5952 defines two strict compression rules: (1) Leading-zero suppression removes leading zeros inside each 16-bit group (e.g., 0db8 becomes db8, and 0000 becomes 0); (2) Double-colon compression (::) replaces the single longest contiguous run of all-zero 16-bit groups, usable at most once per address to avoid ambiguity. Thus, 2001:0db8:0000:0000:0000:0000:0000:0001 compresses to 2001:db8::1. Key reserved IPv6 addresses include ::1/128 (loopback), ::/128 (unspecified), fe80::/10 (link-local unicast automatically configured on every interface), and ff00::/8 (multicast).
12.15 Transport Layer Multiplexing and Socket Addressing
When multiple applications run concurrently on a single host—such as a browser tab downloading a webpage, an SSH terminal, and a DNS resolver—the Transport Layer performs multiplexing on outbound segments and demultiplexing on inbound segments. UDP sockets are uniquely identified by a 2-tuple (Destination IP, Destination Port), meaning datagrams from different senders targeting the same server port arrive at the same UDP socket. By contrast, TCP sockets are identified by a 4-tuple (Source IP, Source Port, Destination IP, Destination Port), allowing a web server listening on port 443 to maintain thousands of isolated, concurrent client connections simultaneously.
12.16 Summary of Well-Known Transport Ports
| Port Number | Protocol | Service | Primary Role |
|---|---|---|---|
| 20 / 21 | TCP | FTP | Data transfer (20) and control commands (21) |
| 22 | TCP | SSH / SFTP | Encrypted remote shell and secure file transfer |
| 25 / 587 | TCP | SMTP | Electronic mail relay and client submission |
| 53 | UDP / TCP | DNS | Domain name resolution queries and zone transfers |
| 67 / 68 | UDP | DHCP | Dynamic IPv4 address lease allocation (DORA) |
| 80 / 443 | TCP / QUIC | HTTP / HTTPS | Web page transfer (plaintext / TLS-encrypted) |
Module IV: Application Layer, Content Delivery and Streaming
Chapter 13: Content Delivery, Server Farms, Proxies and CDNs
13.1 Content and Internet Traffic Patterns
Modern Internet traffic is heavily dominated by web objects, cloud APIs, software distribution, and multimedia streaming rather than uniform peer-to-peer text transfers. Empirically, content popularity follows a skewed Zipf distribution, where the -th most popular object receives requests proportional to —meaning a tiny fraction of popular videos and web assets accounts for the vast majority of total requests. File sizes follow heavy-tailed distributions. Routing every user request across transcontinental backbones to a single origin server creates severe round-trip latency, packet loss, and backbone congestion.
13.2 Server Farms and Web Proxies
- Server Farms: High-traffic web services deploy clusters of commodity servers inside data centers behind a Load Balancer (Layer 4 or Layer 7) that presents a single Virtual IP (VIP) to clients. The load balancer distributes incoming requests across backend workers using round-robin, least-connections, or consistent-hashing algorithms, providing horizontal scalability, health-check monitoring, and transparent failover.
- Web Proxies: An intermediary HTTP server that intercepts client requests. A Forward Proxy sits near clients inside an enterprise or university LAN to cache frequently accessed external pages, enforce content filtering policies, and hide internal client IPs. A Reverse Proxy (such as Nginx or HAProxy) sits in front of origin servers to offload TLS termination, compress responses, cache static assets, and shield backend servers from direct exposure.
Worked Numerical 4.1: Web Proxy Cache Performance
Suppose a university LAN has an average WAN round-trip delay of 120 ms to origin servers and a local proxy delay of 4 ms. If the web proxy achieves a cache hit ratio of , calculate the average response delay and percentage latency reduction.
Step 1: .
Step 2: Latency reduction = .
13.3 Content Delivery Networks (CDNs)
A Content Delivery Network (CDN) is a geographically distributed overlay of edge cache servers placed inside ISP Points of Presence (PoPs) close to end users. When a user requests content from a CDN-enabled domain, authoritative DNS redirection (returning the IP of the closest edge cluster based on client resolver location) or IP Anycast (advertising the same IP prefix from multiple PoPs so BGP routes packets to the topologically nearest site) directs the client to an optimal edge server. On a cache hit, the edge serves the object immediately; on a cache miss, it fetches the object from the origin, caches it according to HTTP Cache-Control headers, and streams it to the client.
Chapter 14: Streaming Audio and Video
14.1 Digital Audio and Video Fundamentals
Analog audio waves are digitized through Pulse Code Modulation (PCM) in three stages: (1) Sampling at or above the Nyquist rate () so the original waveform can be reconstructed without aliasing; (2) Quantization, mapping continuous sample amplitudes to discrete levels; and (3) Encoding into binary words (e.g., CD audio: 44.1 kHz, 16-bit stereo = 1.411 Mbps). Perceptual codecs like MP3 and AAC exploit psychoacoustic masking (discarding frequencies masked by louder adjacent tones) to compress audio to 128–256 kbps with minimal perceived loss.
Digital video consists of a sequence of raster frames (24–60 fps). Compression exploits two forms of redundancy: spatial redundancy within a single frame (using Discrete Cosine Transform in JPEG/MPEG intra-frames) and temporal redundancy between consecutive frames (using motion estimation vectors). MPEG defines three frame types: I-frames (Intra-coded, self-contained keyframes), P-frames (Predicted from preceding I/P frames), and B-frames (Bidirectionally predicted from past and future frames for maximum compression).
Worked Numerical 4.2: Uncompressed vs. Compressed Digital Audio Bit Rate
Calculate the uncompressed bit rate of stereo audio sampled at 48 kHz with 16 bits per sample per channel. Bit rate = . Encoding this stream with AAC at 192 kbps achieves an compression ratio.
14.2 Streaming Stored Media vs. Streaming Live Media
| Characteristic | Streaming Stored Media | Streaming Live Media |
|---|---|---|
| Content Availability | Pre-recorded and stored on disk/CDN | Generated in real time (sports, broadcasts) |
| Interactivity | Supports pause, rewind, fast-forward, seek | Minimal seek; near-live synchronization required |
| Transport & Protocols | HTTP Adaptive Streaming (DASH, HLS) over TCP/QUIC | RTP/RTCP over UDP, IP Multicast, or low-latency HLS |
| Playout Buffering | Large client buffer (5–30 s) absorbs jitter | Small buffer (100 ms–2 s) to preserve liveness |
In Dynamic Adaptive Streaming over HTTP (DASH), video is segmented into short chunks (2–10 s) encoded at multiple bitrates and resolutions. The client downloads a manifest file (MPD) and dynamically switches quality levels chunk-by-chunk based on measured throughput and buffer occupancy, preventing rebuffering stalls. For real-time interactive media (VoIP, video conferencing), RTP (Real-time Transport Protocol) carries media over UDP with sequence numbers and timestamps, while RTCP provides out-of-band feedback on packet loss and jitter.
Chapter 15: Core Application Layer Protocols — HTTP, HTTPS and DNS
15.1 HTTP and HTTPS
The Hypertext Transfer Protocol (HTTP) is a stateless client-server request-response protocol operating over TCP port 80 (HTTP/1.1, HTTP/2) or QUIC/UDP port 443 (HTTP/3). HTTP/1.0 opened a fresh TCP connection per object (non-persistent), incurring 2 RTTs per asset. HTTP/1.1 introduced persistent connections (keep-alive) and pipelining. HTTP/2 added binary framing, header compression (HPACK), and multiplexed streams over a single TCP connection, while HTTP/3 replaces TCP with QUIC to eliminate head-of-line blocking.
- Common Methods:
GET(retrieve resource),POST(submit entity/create),PUT(replace resource),DELETE(remove resource),HEAD(headers only). - Status Codes:
1xxInformational,2xxSuccess (200 OK),3xxRedirection (301 Moved Permanently,304 Not Modified),4xxClient Error (404 Not Found),5xxServer Error (500 Internal Server Error). - State Management: HTTP cookies (
Set-Cookie/Cookieheaders) maintain user sessions across stateless requests. - HTTPS: Secures HTTP inside Transport Layer Security (TLS) on port 443. During the TLS handshake, the server presents an X.509 digital certificate signed by a trusted Certificate Authority (CA), both sides negotiate cipher suites and derive symmetric session keys via ECDHE, and subsequent HTTP traffic is encrypted and authenticated.
GET /index.html HTTP/1.1 Host: degreelive.in User-Agent: Mozilla/5.0 Accept: text/html Connection: keep-alive HTTP/1.1 200 OK Date: Sat, 06 Dec 2026 08:30:00 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 4096 Cache-Control: max-age=3600
15.2 Domain Name System (DNS)
DNS (UDP/TCP port 53) translates human-readable hostnames (e.g., www.keralauniversity.ac.in) into IP addresses using a hierarchical distributed database consisting of Root Name Servers (13 logical clusters), Top-Level Domain (TLD) Servers (.com, .org, .in), and Authoritative Name Servers.
- Recursive vs. Iterative Query: A stub resolver sends a recursive query to its local DNS resolver, asking for the final answer. The local resolver then performs iterative queries—asking Root, then TLD, then the Authoritative server—each returning a referral until the IP is resolved and cached according to its TTL.
- Resource Records:
A(IPv4 address),AAAA(IPv6 address),CNAME(canonical alias),MX(mail exchanger),NS(authoritative name server),PTR(reverse IP-to-name lookup).
Chapter 16: File Transfer Protocol (FTP) and Electronic Mail
16.1 File Transfer Protocol (FTP)
FTP (RFC 959) transfers files reliably between client and server using two separate TCP connections (out-of-band control):
- Control Connection (Port 21): Remains open for the entire session to carry ASCII commands (
USER,PASS,LIST,RETR,STOR,QUIT) and numeric reply codes (e.g.,220 Service Ready,331 Password Required,226 Transfer Complete). - Data Connection (Port 20 in Active Mode): Opened on demand for each file transfer or directory listing and closed immediately afterward. In Active Mode, the server initiates the data connection from port 20 to a client-specified port (often blocked by client NAT/firewalls). In Passive Mode (PASV), the client initiates both control and data connections to an ephemeral port announced by the server, working seamlessly through firewalls.
16.2 Electronic Mail Protocols (SMTP, POP3, IMAP)
Internet email architecture comprises three components: User Agents (mail clients), Mail Transfer Agents (MTAs), and Message Access Agents. SMTP (TCP port 25/587) pushes messages from sender client to mail servers and between mail servers using ASCII commands (HELO, MAIL FROM, RCPT TO, DATA, QUIT). Because SMTP originally supported only 7-bit ASCII text, MIME (Multipurpose Internet Mail Extensions) encodes binary attachments and non-ASCII characters using Base64. Recipients retrieve mail from their mailbox server using POP3 (port 110, download-and-delete) or IMAP (port 143, synchronized server-side folders across multiple devices).
16.3 Web Caching Validation and Load Balancing Algorithms
Web proxies and CDN edge caches must ensure cached objects do not become stale. HTTP supports Conditional GET validation: when a cached object's Cache-Control: max-age expires, the proxy sends a request containing If-Modified-Since: <timestamp> or If-None-Match: <ETag>. If the origin object has not changed, the origin responds with a tiny 304 Not Modified header (zero body bytes), saving substantial backbone bandwidth.
Inside server farms, Layer 4/7 Load Balancers distribute traffic using four common strategies:
- Round-Robin: Rotates requests sequentially across healthy backend nodes; simple, assumes homogeneous server capacity.
- Weighted Least-Connections: Routes new requests to the server with the fewest active TCP connections scaled by server weight, ideal for uneven request durations.
- Consistent Hashing: Maps both servers and request keys (URL or client IP) onto a virtual hash ring ( to ). When a server is added or removed, only of keys remap, preserving high cache hit ratios in distributed caches.
16.4 MPEG Video Coding, RTP/RTCP, and SIP Signaling
In MPEG video compression, frames are organized into a Group of Pictures (GOP) such as I B B P B B P. Because B-frames depend on future P-frames, transmission order differs from display order (P-frames are transmitted before the B-frames that reference them). During live streaming or VoIP over UDP, packets experience variable network delay known as jitter. The receiver places arriving RTP (Real-time Transport Protocol) packets into a Playout Buffer and delays initial playback by a target playout offset so late packets still arrive before their scheduled render timestamp.
Real-time multimedia calls use the Session Initiation Protocol (SIP, RFC 3261) on UDP/TCP port 5060 for call signaling: the caller sends an INVITE containing a Session Description Protocol (SDP) payload listing supported codecs and UDP ports; the callee rings (180 Ringing), accepts (200 OK), and the caller confirms (ACK). Media then flows directly peer-to-peer over RTP until one party sends BYE.
16.5 HTTP/2, HTTP/3 (QUIC), TLS 1.3 and DNS Message Format
While HTTP/1.1 suffered head-of-line (HoL) blocking (only one response per TCP connection at a time), HTTP/2 introduces a binary framing layer allowing dozens of concurrent request/response streams to be multiplexed over a single TCP connection, alongside HPACK header compression. HTTP/3 eliminates TCP-level HoL blocking entirely by running over QUIC (on UDP port 443), integrating TLS 1.3 encryption directly into the transport handshake for 1-RTT (and 0-RTT resumed) connection setup.
In DNS, every query and response shares a 12-byte fixed header (Transaction ID, Flags QR/Opcode/AA/TC/RD/RA/RCODE, Question Count, Answer RR Count, Authority RR Count, Additional RR Count) followed by variable-length Question and Resource Record (RR) sections. Modern networks increasingly secure DNS privacy using DNS over HTTPS (DoH) and DNS over TLS (DoT), while DNSSEC cryptographically signs RRs to prevent cache poisoning.
| Protocol | Port(s) | Transport | Primary Application Role |
|---|---|---|---|
| HTTP / HTTPS | 80 / 443 | TCP (or QUIC for HTTP/3) | Web page & REST API transfer (plaintext / TLS-encrypted) |
| DNS | 53 | UDP (queries) / TCP (zone transfers) | Hierarchical hostname-to-IP resolution |
| FTP | 21 (Control), 20 (Data) | TCP | Authenticated file upload, download, and directory listing |
| SMTP / IMAP / POP3 | 25, 587 / 143 / 110 | TCP | Email submission/relay (SMTP) and mailbox retrieval (IMAP/POP3) |
| DHCP | 67 (Server), 68 (Client) | UDP | Dynamic IPv4 address, mask, gateway, and DNS lease assignment |
16.6 Deep-Dive: TLS 1.3 Handshake and Public Key Infrastructure (PKI)
HTTPS relies on Transport Layer Security (TLS) to guarantee confidentiality, integrity, and server authentication. Modern TLS 1.3 (RFC 8446) streamlines connection establishment to a single round-trip (1-RTT) while deprecating weak legacy ciphers (RC4, SHA-1, static RSA key transport):
- ClientHello: The browser sends supported TLS versions, cipher suites (e.g.,
TLS_AES_128_GCM_SHA256), and an Ephemeral Elliptic Curve Diffie-Hellman (ECDHE) key share. - ServerHello + Encrypted Extensions + Certificate + Finished: The server selects the cipher suite, returns its ECDHE key share, and immediately derives shared session keys. All subsequent handshake messages—including the server's X.509 certificate chain and digital signature (
CertificateVerify)—are encrypted. - Client Verification & Finished: The client verifies the server's X.509 certificate signature up to a pre-installed trusted Root Certificate Authority (CA), validates domain matching (SAN) and expiration, and begins sending encrypted HTTP application data.
Because ECDHE generates fresh ephemeral keys per session, TLS 1.3 enforces Perfect Forward Secrecy (PFS): even if a server's long-term private key is compromised years later, past recorded traffic cannot be decrypted.
16.7 Deep-Dive: FTP Active vs. Passive Mode and Email Security
FTP's dual-connection design creates well-known firewall traversal challenges. In Active Mode, the client connects to server port 21 and sends a PORT command telling the server which client IP/port to connect back to; the server then initiates the data connection from port 20. Client-side NAT routers and stateful firewalls block unsolicited inbound connections, causing Active Mode to fail. In Passive Mode (PASV), the client sends PASV, the server opens an unprivileged ephemeral port (e.g., 50123) and replies with that port, and the client initiates the outbound data connection—succeeding cleanly behind NAT. For encrypted file transfers, organizations replace plaintext FTP with FTPS (FTP over TLS) or SFTP (SSH File Transfer Protocol over TCP port 22).
To combat phishing and domain spoofing in SMTP, mail administrators deploy three complementary DNS-based authentication records: SPF (Sender Policy Framework) lists authorized sending server IPs in a DNS TXT record; DKIM (DomainKeys Identified Mail) attaches a cryptographic RSA signature to email headers verifiable via the sender's public key in DNS; and DMARC instructs receiving MTAs whether to quarantine or reject messages failing SPF/DKIM alignment.
16.8 Worked Numerical 4.3: Playout Buffer and Adaptive Streaming Bitrate
A video streaming client downloads 4-second DASH segments encoded at 4 Mbps (HD) and 8 Mbps (4K). If the measured network throughput drops from 10 Mbps to 5 Mbps, how long does it take to download one 4-second 4K segment, and what should the ABR algorithm do?
Step 1: Size of one 4-second 4K segment = .
Step 2: At 5 Mbps throughput, download time = , which exceeds the 4-second playback duration and will drain the playout buffer, causing a stall.
Step 3: The Adaptive Bitrate (ABR) controller switches down to the 4 Mbps HD representation (), refilling the buffer smoothly without interruption.
| FTP Reply Code | Category | Meaning |
|---|---|---|
| 220 | Positive Completion | Service ready for new user on control connection |
| 226 | Positive Completion | Closing data connection; requested file transfer successful |
| 331 | Positive Intermediate | User name okay; password required |
| 425 | Transient Negative | Cannot open data connection (often Active-mode firewall block) |
| 530 | Permanent Negative | Not logged in (authentication failed) |
16.9 Deep-Dive: DNS Resolution Walkthrough and Record Types
When a browser requests https://portal.keralauniversity.ac.in, the operating system checks its local host cache (and hosts file). On a miss, it sends a recursive UDP query to its configured Local DNS Resolver (e.g., ISP resolver or 8.8.8.8). The resolver executes an iterative chain:
- Queries one of the 13 Root Name Server clusters (
.), which responds with a referral to the.inTop-Level Domain (TLD) servers. - Queries the
.inTLD server, which responds with a referral to theac.in/keralauniversity.ac.inauthoritative name servers (NSrecords). - Queries the authoritative name server for
portal.keralauniversity.ac.in, which returns the finalArecord (IPv4) orAAAArecord (IPv6) along with a Time-To-Live (TTL) in seconds.
| DNS Record Type | Full Name | Mapping / Purpose |
|---|---|---|
| A / AAAA | Address Record | Maps hostname to 32-bit IPv4 (A) or 128-bit IPv6 (AAAA) address. |
| CNAME | Canonical Name | Maps an alias hostname (e.g., www) to its canonical primary domain name. |
| MX | Mail Exchanger | Specifies the mail server hostname(s) and priority for a domain's email. |
| NS | Name Server | Delegates a DNS zone to an authoritative name server hostname. |
| PTR | Pointer Record | Maps an IP address back to a hostname (reverse DNS in in-addr.arpa). |
| TXT | Text Record | Stores arbitrary text metadata, widely used for SPF, DKIM, and domain verification. |
16.10 Deep-Dive: SMTP Dialogue Trace and MIME Encoding
Below is a complete SMTP client-to-server transaction demonstrating how an email message is pushed over TCP port 25:
S: 220 mail.degreelive.in ESMTP Postfix C: HELO client.keralauniversity.ac.in S: 250 Hello client.keralauniversity.ac.in C: MAIL FROM:<[email protected]> S: 250 2.1.0 Ok C: RCPT TO:<[email protected]> S: 250 2.1.5 Ok C: DATA S: 354 End data with <CR><LF>.<CR><LF> C: From: [email protected] C: To: [email protected] C: Subject: Lab Report Submission C: MIME-Version: 1.0 C: Content-Type: text/plain; charset=UTF-8 C: C: Please find the Computer Network lab verification attached. C: . S: 250 2.0.0 Ok: queued as 9F4A210C C: QUIT S: 221 2.0.0 Bye
Notice that SMTP is strictly a push protocol: the sender pushes the message to its outgoing MTA, which uses DNS MX lookups to push the message to the recipient's incoming MTA. To retrieve the email later, the recipient's client opens an IMAP (port 143/993) or POP3 (port 110/995) pull session.
16.11 Comparison of POP3 and IMAP4 Mail Retrieval
| Feature | POP3 (Post Office Protocol v3) | IMAP4 (Internet Message Access Protocol) |
|---|---|---|
| Default Ports | 110 (Plaintext), 995 (POP3S over TLS) | 143 (Plaintext/STARTTLS), 993 (IMAPS over TLS) |
| Storage Location | Downloads mail to local client and typically deletes from server | Keeps master mailbox on server; caches headers/bodies locally |
| Multi-Device Sync | Poor; read/deleted state is local to one device | Full synchronization of folders, flags, and read status across devices |
| Partial Fetch | Must download entire message including attachments | Supports fetching headers or specific MIME parts on demand |
16.12 RTP Packet Structure and Jitter Compensation
Real-time audio and video streams over UDP rely on the Real-time Transport Protocol (RTP, RFC 3550). Because UDP does not guarantee in-order delivery or timing, RTP prepends a 12-byte header containing: Payload Type (7 bits, identifying codec such as G.711 PCM, Opus, or H.264), Sequence Number (16 bits, incremented by 1 per packet to detect packet loss and restore order), Timestamp (32 bits, sampling instant of the first byte in the payload to synchronize playout and remove jitter), and SSRC (32-bit Synchronization Source identifier). Companion RTCP control packets periodically report fraction lost, cumulative packets lost, and interarrival jitter so senders can adapt encoding bitrates dynamically.
16.13 Worked Numerical 4.4: Non-Persistent vs. Persistent HTTP Latency
A web page consists of one base HTML file and 8 referenced images, each requiring 1 RTT for object transfer, with TCP handshake taking 1 RTT. Compute total page load time under: (a) Non-persistent HTTP/1.0 (serial connections), and (b) Persistent HTTP/1.1 with pipelining.
- Non-Persistent HTTP/1.0 (Serial): Each of the 9 objects needs 1 RTT (TCP) + 1 RTT (HTTP) = 2 RTTs. Total = .
- Persistent HTTP/1.1 (Pipelined): 1 RTT (TCP) + 1 RTT (HTML) + 1 RTT (all 8 images pipelined together) = —a 6x latency speedup.
16.14 CDN Request Routing and Edge Caching Architecture
Modern Content Delivery Networks (CDNs) such as Cloudflare, Akamai, and CloudFront combine Anycast BGP routing with tiered edge-shield caching. When a user requests https://cdn.example.com/video.mp4, DNS resolves to a regional Anycast IP shared by dozens of Edge PoPs; BGP automatically routes the user's TCP/QUIC packets to the topologically closest PoP. If the Edge PoP misses, instead of querying the origin server directly (which could overwhelm origin bandwidth during flash crowds), the Edge forwards the request to a regional Origin Shield cache. Only if the Origin Shield also misses does a single request reach the origin server—collapsing thousands of concurrent user misses into one origin fetch.
CDNs also terminate TLS 1.3 at the edge PoP, cutting handshake RTTs from ~150 ms down to ~10 ms, and apply on-the-fly Brotli/Gzip compression, image optimization (WebP/AVIF), and DDoS absorption at network scale.
16.15 Audio/Video Synchronization and Bitrate Planning
In multimedia conferencing, audio and video streams are transmitted as separate RTP sessions (each with its own SSRC and RTCP stream). Because audio and video use different sampling clocks (e.g., 48 kHz for Opus audio vs. 90 kHz for H.264 video), RTCP Sender Reports (SR) map each stream's relative RTP timestamp to a common wall-clock Network Time Protocol (NTP) timestamp, enabling receivers to maintain tight lip-synchronization within .
16.16 HTTP/1.1 vs. HTTP/2 vs. HTTP/3 Protocol Comparison
| Feature | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|
| Transport Protocol | TCP | TCP (single connection) | QUIC over UDP |
| Framing & Multiplexing | Plaintext; sequential per connection | Binary frames; multiplexed streams | Binary frames; independent QUIC streams |
| Head-of-Line Blocking | Application + TCP HoL blocking | Eliminates App HoL; TCP HoL remains | Eliminates both App and Transport HoL |
| Header Compression | None (verbose ASCII headers) | HPACK static/dynamic table | QPACK (out-of-order safe) |
16.17 HTTP Cookies and Stateless Session Tracking
Because HTTP itself is stateless—each request-response pair is independent—web applications use HTTP Cookies (RFC 6265) to maintain authenticated sessions, shopping carts, and user preferences. When a user logs in, the server includes a Set-Cookie: session_id=9a8f...; HttpOnly; Secure; SameSite=Lax header in its HTTP response. The browser stores this token and automatically attaches Cookie: session_id=9a8f... to subsequent requests to that origin. Setting HttpOnly blocks client-side JavaScript from reading the cookie (mitigating XSS theft), Secure restricts transmission to HTTPS, and SameSite defends against Cross-Site Request Forgery (CSRF).
16.18 Peer-to-Peer (P2P) Content Distribution vs. Client-Server
In classical client-server distribution, the origin server must upload copies of a file of size , yielding distribution time that grows linearly with peer count . In Peer-to-Peer (P2P) distribution (such as BitTorrent), each peer simultaneously downloads chunks and uploads already-received chunks to other peers, scaling aggregate upload capacity with so distribution time grows logarithmically rather than linearly—making P2P ideal for massive software ISOs and decentralized mirrors.
16.19 HTTP Status Code Reference Table
| Status Code | Reason Phrase | Class & Meaning |
|---|---|---|
| 200 | OK | 2xx Success: Request succeeded and payload returned |
| 301 | Moved Permanently | 3xx Redirection: Resource permanently relocated to new URI |
| 304 | Not Modified | 3xx Redirection: Cached copy is still valid; zero body sent |
| 403 | Forbidden | 4xx Client Error: Server understood request but refuses authorization |
| 404 | Not Found | 4xx Client Error: Requested resource does not exist on server |
| 500 | Internal Server Error | 5xx Server Error: Unhandled exception on origin/application server |
| 503 | Service Unavailable | 5xx Server Error: Server temporarily overloaded or under maintenance |
Module V: Session/Presentation Layers, OSPF/BGP, DTN and Lab Experiments
Chapter 17: Session and Presentation Layers
17.1 Session Layer Functions
OSI Layer 5 (Session Layer) establishes, coordinates, and terminates logical dialogues between communicating applications across two hosts. While TCP/IP merges these duties into the Application Layer, understanding Session Layer primitives is essential for database transactions, remote procedure calls (RPC), and multimedia conferencing:
- Session Management: Handles user authentication, session establishment, orderly release, and binding multiple transport connections into a unified application session.
- Dialog Control: Enforces whether communication proceeds in half-duplex (alternating turns) or full-duplex (simultaneous bidirectional) mode.
- Token Management: Prevents two parties from attempting the same critical operation simultaneously (such as writing to a shared record) by passing a virtual control token.
- Synchronization (Checkpointing): Inserts numbered synchronization points into long data streams. If a network crash occurs mid-transfer (e.g., at byte 50,000 of a 100 MB file), the session rolls back only to the last acknowledged minor or major checkpoint rather than restarting from zero.
17.2 Presentation Layer Functions
OSI Layer 6 (Presentation Layer) guarantees that information sent by the Application Layer of one system is readable by the Application Layer of another, resolving differences in internal data representation:
- Translation: Converts between platform-specific encodings (such as ASCII, EBCDIC, UTF-8, big-endian vs. little-endian integers) and a common network transfer syntax such as ASN.1, JSON, or Protocol Buffers.
- Encryption and Decryption: Protects confidentiality by transforming plaintext into ciphertext using symmetric algorithms (AES, ChaCha20) for bulk speed and asymmetric algorithms (RSA, Elliptic Curve Cryptography) for key exchange and digital signatures.
- Compression and Decompression: Reduces the number of bits transmitted over the network. Lossless compression (Huffman coding, Run-Length Encoding, LZW, gzip/Deflate) preserves exact bit-for-bit reconstruction for text and executables. Lossy compression (JPEG, MPEG, MP3) discards perceptually insignificant details to achieve high compression ratios for multimedia.
Worked Numerical 5.1: RSA Asymmetric Encryption Key Generation
Choose primes , . Compute and Euler totient . Choose public exponent (coprime to 40). Find private exponent such that (since ). Message encrypts to , and decrypts back via .
Chapter 18: Enterprise Routing Protocols — OSPF and BGP
18.1 Open Shortest Path First (OSPF)
OSPF is an Interior Gateway Protocol (IGP) operating within a single Autonomous System (AS) using the Link State paradigm (encapsulated directly in IP protocol 89). To scale across large enterprise networks, OSPF divides an AS into hierarchical Areas connected through a mandatory central backbone (Area 0). Area Border Routers (ABRs) summarize routes between areas, while Autonomous System Boundary Routers (ASBRs) exchange routes with external routing domains.
OSPF routers discover neighbors and maintain adjacencies using Hello packets, synchronize their Link State Databases (LSDBs) using Link State Advertisements (LSAs: Router LSA Type 1, Network LSA Type 2, Summary LSA Type 3), and run Dijkstra's Shortest Path First (SPF) algorithm using link bandwidth as the default inverse metric (Cost = Reference Bandwidth / Interface Bandwidth). On multi-access Ethernet segments, OSPF elects a Designated Router (DR) and Backup Designated Router (BDR) to reduce LSA flooding from to .
18.2 Border Gateway Protocol (BGP)
BGP-4 is the sole Exterior Gateway Protocol (EGP) interconnecting independent Autonomous Systems across the global Internet. Operating over reliable TCP port 179, BGP is a Path-Vector protocol: instead of advertising simple hop counts or link metrics, BGP updates carry the complete AS_PATH attribute—the ordered list of AS numbers traversed—which inherently prevents inter-AS routing loops (a router discards any update containing its own ASN).
- eBGP vs. iBGP: External BGP (eBGP) runs between routers in different Autonomous Systems; Internal BGP (iBGP) distributes learned external routes among routers within the same AS.
- Policy-Based Routing: Unlike OSPF, which strictly minimizes metric cost, BGP selects routes based on commercial peering agreements and administrative policies using attributes such as
LOCAL_PREF,AS_PATHlength,MED(Multi-Exit Discriminator), andNEXT_HOP.
| Attribute | OSPF | BGP-4 |
|---|---|---|
| Scope | Interior Gateway Protocol (Intra-AS) | Exterior Gateway Protocol (Inter-AS) |
| Algorithm Type | Link State (Dijkstra SPF) | Path Vector (Policy-driven) |
| Transport | Directly over IP (Protocol 89) | TCP Port 179 |
| Routing Metric | Bandwidth-based interface cost | Policy attributes (LOCAL_PREF, AS_PATH, MED) |
Chapter 19: Delay Tolerant Networking (DTN)
19.1 DTN Architecture
Conventional TCP/IP assumes an always-on, low-latency end-to-end path with symmetrical data rates and low bit-error rates. In challenged networks—such as deep-space interplanetary links, underwater acoustic networks, wildlife tracking sensors, and disaster-recovery zones—nodes experience extreme propagation delays (minutes to hours), frequent disconnections, and asymmetric links where TCP three-way handshakes time out before an acknowledgment can return.
Delay Tolerant Networking (DTN, RFC 4838) overcomes these limits by inserting an overlay layer above the transport layer and employing store-carry-forward switching. DTN nodes persist entire self-contained messages in non-volatile storage until a scheduled or opportunistic contact window opens with the next hop. Custody transfer delegates retransmission responsibility hop-by-hop rather than relying on fragile end-to-end acknowledgments.
19.2 The Bundle Protocol
The Bundle Protocol (BP / BPv7, RFC 9171) is the core DTN protocol. Application data units are encapsulated into variable-length bundles identified by Endpoint Identifiers (EIDs, formatted as URIs such as dtn://mars-rover/telemetry). Each bundle contains a Primary Block (source/destination EIDs, creation timestamp, lifetime), optional Extension Blocks (bundle security, hop count), and a Payload Block. A Convergence Layer Adapter (CLA) maps bundles onto whatever underlying transport is available on a given link (TCP, UDP, Bluetooth, or space proximity protocols).
Chapter 20: Practical Network Administration and Lab Experiments
20.1 Inspecting Network Settings and IP Configuration (Labs 1, 2 & 4)
Every networked host requires an IPv4/IPv6 address, subnet mask, default gateway, and DNS server address. On Windows, ipconfig displays active interface parameters; on Linux, ip addr show and ip route serve the same purpose. Static IP addresses are assigned manually for servers and infrastructure devices, whereas client workstations typically obtain leases automatically via DHCP.
# Lab 1 & 2: Inspect IP configuration, MAC address, Gateway, and DNS ipconfig /all # Windows: full NIC, MAC, DHCP, DNS details ipconfig /release # Release current DHCP lease ipconfig /renew # Request fresh DHCP lease ipconfig /flushdns # Clear local DNS resolver cache ip addr show # Linux: view interfaces and IP addresses # Lab 4: Assign a Static IPv4 Address (Windows netsh & Linux ip) netsh interface ip set address "Ethernet" static 192.168.1.50 255.255.255.0 192.168.1.1 sudo ip addr add 192.168.1.50/24 dev eth0 sudo ip route add default via 192.168.1.1
20.2 Connectivity Testing and Bandwidth Measurement (Labs 3 & 5)
The ping utility verifies Layer 3 reachability by sending ICMP Echo Request packets and measuring Echo Reply round-trip time (RTT), packet loss percentage, and Time-To-Live (TTL). To measure actual achievable TCP or UDP throughput between two hosts, engineers deploy iperf3 in client-server mode.
# Lab 3: Test connectivity and measure RTT ping -n 5 8.8.8.8 # Windows: send 5 ICMP Echo Requests ping -c 5 192.168.1.1 # Linux: ping default gateway 5 times # Lab 5: Measure network bandwidth using iperf3 # On Host A (Server): iperf3 -s # On Host B (Client, 10-second TCP test): iperf3 -c 192.168.1.10 -t 10 # On Host B (UDP test at 100 Mbps): iperf3 -c 192.168.1.10 -u -b 100M
20.3 HTTP Server, DHCP and Wireless Network Setup (Labs 6, 7 & 8)
HTTP Server (Lab 6): A lightweight web server can be launched from any directory containing index.html using Python's built-in module (python -m http.server 8080) and accessed from another host on the LAN via http://<server-ip>:8080.
DHCP Configuration and Testing (Lab 7): Dynamic Host Configuration Protocol (UDP ports 67/68) automates IP assignment using the four-step DORA sequence: (1) Discover (client broadcasts), (2) Offer (server proposes IP + lease), (3) Request (client accepts offer), and (4) Acknowledge (server commits lease). Administrators define an address pool (e.g., 192.168.1.100–200), subnet mask, gateway, and DNS, then verify client lease acquisition via ipconfig /release followed by ipconfig /renew.
Wireless Network Setup (Lab 8): Configuring a Wi-Fi Access Point (IEEE 802.11n/ac/ax) involves setting a unique Service Set Identifier (SSID), selecting a non-overlapping channel (1, 6, or 11 on 2.4 GHz), enabling strong encryption (WPA2-AES or WPA3-SAE, avoiding deprecated WEP), enabling the integrated DHCP server, and verifying wireless client association and gateway pinging.
20.4 Deep-Dive: OSPF Neighbor States and BGP Best-Path Selection
In enterprise routing (Chapter 18), two OSPF routers form a full adjacency by progressing through seven states: Down → Init (Hello received) → 2-Way (bidirectional communication confirmed; DR/BDR elected on broadcast LANs) → ExStart (master/slave roles chosen) → Exchange (Database Description DBD packets exchanged) → Loading (LSR/LSU requests for missing LSAs) → Full (synchronized LSDBs). OSPF calculates interface cost using ; with default 100 Mbps reference, a 100 Mbps FastEthernet link has cost 1, whereas a 10 Mbps link has cost 10.
For inter-AS routing, BGP-4 uses four message types over TCP port 179: OPEN (negotiates ASNs and Hold Time), UPDATE (advertises reachable prefixes with path attributes or withdraws unreachable routes), KEEPALIVE (periodic heartbeat), and NOTIFICATION (closes session on error). When multiple routes exist to a destination prefix, BGP selects the best path deterministically by evaluating: (1) highest Weight (local), (2) highest LOCAL_PREF, (3) locally originated routes, (4) shortest AS_PATH, (5) lowest ORIGIN type (IGP < EGP < Incomplete), (6) lowest MED, (7) eBGP preferred over iBGP, (8) lowest IGP cost to NEXT_HOP, and (9) lowest BGP Router ID.
20.5 Deep-Dive: Huffman Compression and DTN Custody Transfer
In Presentation Layer lossless compression (Chapter 17), Huffman Coding assigns variable-length prefix-free binary codes to symbols based on their frequency—frequent symbols receive shorter codes and rare symbols receive longer codes. For example, given symbols A(0.5), B(0.25), C(0.15), D(0.10), fixed-length encoding needs 2 bits/symbol, whereas Huffman assigns A=0, B=10, C=110, D=111, yielding average length (a 12.5% reduction).
In Delay Tolerant Networking (Chapter 19), Custody Transfer ensures reliability across disconnected hops: when Node A forwards a bundle to Node B with the Custody Transfer Requested flag set, Node A retains a persistent copy until Node B validates the bundle, stores it safely, and returns a Custody Signal (Succeeded). Once Node B accepts custody, Node A may free its storage buffer. For security in challenged environments, BPSec (Bundle Protocol Security) provides hop-by-hop or end-to-end integrity via Block Integrity Blocks (BIB) and confidentiality via Block Confidentiality Blocks (BCB).
20.6 Detailed Lab Verification Procedures and Sample Outputs
Students executing Labs 1–8 should verify each experiment using the following diagnostic outputs:
# Lab 2 & 7: Expected ipconfig /all excerpt after DHCP DORA lease Ethernet adapter Ethernet: Physical Address. . . . . . . . . : D8-BB-C1-4A-92-10 DHCP Enabled. . . . . . . . . . . : Yes IPv4 Address. . . . . . . . . . . : 192.168.1.104(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 DHCP Server . . . . . . . . . . . : 192.168.1.1 DNS Servers . . . . . . . . . . . : 8.8.8.8 # Lab 3: Expected ping summary Reply from 192.168.1.1: bytes=32 time=2ms TTL=64 Packets: Sent = 5, Received = 5, Lost = 0 (0% loss) # Lab 5: Expected iperf3 TCP throughput summary [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.09 GBytes 938 Mbits/sec 0 sender
If ping returns Request timed out, students should verify physical link LEDs, confirm both hosts share the same IP subnet or have a valid default gateway, and check that host firewall rules permit ICMPv4 Echo Requests. For iperf3, ensure TCP port 5201 is open on the server host.
20.7 Deep-Dive: Presentation Layer ASN.1, RLE and LZW Compression
Beyond Huffman coding, the Presentation Layer employs structured transfer syntaxes and dictionary compression:
- ASN.1 (Abstract Syntax Notation One): Provides a platform-independent schema language for defining data structures (used in X.509 certificates, SNMP, and LDAP). Its Basic Encoding Rules (BER) encode every field as a Tag-Length-Value (TLV) triplet, ensuring big-endian and little-endian architectures interpret integers and strings identically.
- Run-Length Encoding (RLE): Replaces consecutive runs of identical symbols with a count-value pair (e.g.,
AAAAAAABBBBCCbecomes7A4B2C), highly effective for monochrome bitmaps and fax transmissions. - Lempel-Ziv-Welch (LZW): Builds a dynamic dictionary of recurring substrings on the fly during a single pass without transmitting the dictionary itself; the decoder reconstructs the identical dictionary synchronously as it reads compressed codes (used in GIF, TIFF, and Unix
compress).
20.8 Deep-Dive: OSPF Area Types and LSA Hierarchy
To prevent routing tables and SPF recalculations from growing unboundedly in large autonomous systems, OSPF supports specialized area designs:
| LSA Type | Name | Generated By | Flooding Scope |
|---|---|---|---|
| Type 1 | Router LSA | Every OSPF router | Within its own Area only |
| Type 2 | Network LSA | Designated Router (DR) | Within multi-access Area only |
| Type 3 | Summary LSA | Area Border Router (ABR) | Across Areas into/from Area 0 |
| Type 4 | ASBR Summary LSA | Area Border Router (ABR) | Advertises reachability to ASBR |
| Type 5 | AS External LSA | AS Boundary Router (ASBR) | Entire Autonomous System (except Stub Areas) |
20.9 Complete Step-by-Step Lab Execution Checklist (Labs 1–8)
To complete the practical component of UK5DSCCAP301 cleanly in a college laboratory:
- Lab 1 (Network Settings): Open Network Connections / Settings → Adapter Properties → IPv4 Properties; identify NIC vendor, link speed (100/1000 Mbps), MAC address, and whether DHCP or manual IP is active.
- Lab 2 (
ipconfig): Executeipconfig /allandipconfig /displaydns; record IPv4, Subnet Mask, Default Gateway, Lease Obtained/Expires timestamps, and DNS servers. - Lab 3 (
ping): Ping loopback (127.0.0.1) to verify local TCP/IP stack, ping Default Gateway to verify LAN link, and ping external IP (8.8.8.8) and hostname (google.com) to verify Internet routing and DNS. - Lab 4 (Configure Static IP): Assign
192.168.50.10/24on Host A and192.168.50.11/24on Host B vianetshornmcli, then verify mutual reachability withping. - Lab 5 (Bandwidth Measurement): Run
iperf3 -son Host A andiperf3 -c 192.168.50.10 -t 15 -P 4on Host B to measure multi-stream TCP throughput and jitter/loss with-u. - Lab 6 (Simple HTTP Server): Create
index.htmlin a lab folder, runpython -m http.server 8080, and fetch the page from Host B's browser orcurl http://192.168.50.10:8080. - Lab 7 (DHCP Server & Testing): Configure a router or local DHCP daemon with pool
192.168.50.100–150, set Host B to Obtain IP Automatically, runipconfig /release && ipconfig /renew, and confirm lease assignment. - Lab 8 (Wireless Network Setup): Configure an AP with SSID
BCA-Lab-Net, WPA2-PSK (AES), non-overlapping Channel 6 (2.4 GHz) or Channel 36 (5 GHz), connect a laptop/phone, and verify DHCP lease and HTTP server access over Wi-Fi.
20.10 Deep-Dive: DTN Bundle Protocol Architecture and Block Structure
In Delay Tolerant Networking (BPv7, RFC 9171), every transmitted message is formatted as a self-contained Bundle encoded using Concise Binary Object Representation (CBOR). Because end-to-end paths may never exist simultaneously, each bundle carries complete routing, lifetime, and security metadata inside its own headers:
| Bundle Block | Mandatory? | Key Fields and Operational Role |
|---|---|---|
| Primary Block | Yes (First) | BP version, bundle processing flags, Destination EID, Source EID, Report-To EID, Creation Timestamp, Lifetime (TTL), and CRC. |
| Previous Node Block | Optional | EID of the most recent forwarding DTN node; prevents immediate ping-pong routing loops. |
| Bundle Age Block | Optional | Tracks elapsed time since creation for nodes lacking synchronized UTC clocks. |
| Hop Count Block | Optional | Limits maximum DTN store-carry-forward hops to prevent endless circulation. |
| Payload Block | Yes (Last) | Encapsulates the actual application-layer telemetry, file, or message bytes. |
When a DTN node receives a bundle, it checks the Destination EID against its local Contact Graph—a schedule of predicted or opportunistic link contacts (e.g., when a Low-Earth-Orbit satellite passes over a ground station). If no next-hop contact is currently active, the bundle is written to persistent flash/disk storage until the scheduled contact window opens, ensuring zero data loss across multi-hour blackouts.
20.11 Deep-Dive: Session Synchronization and Dialog Control Trace
To illustrate OSI Session Layer (Layer 5) checkpointing during a large file transfer over an unreliable link, suppose Host A sends a 10 MB dataset to Host B with minor synchronization points inserted every 1 MB:
Host A (Sender) Host B (Receiver) | --- Data [0 MB - 1 MB] ------------> | | --- Minor Sync Point #1 (S-SYNC) --> | | <-- Minor Sync Ack #1 -------------- | [1 MB safely committed to disk] | --- Data [1 MB - 2 MB] ------------> | | --- Minor Sync Point #2 (S-SYNC) --> | | <-- Minor Sync Ack #2 -------------- | [2 MB safely committed to disk] | --- Data [2 MB - 2.6 MB] --X (Link drops!) | | | [Transport reconnects; Session resumes via S-RESYNCHRONIZE] | --- Resync to Checkpoint #2 -------> | | <-- Resync Confirm (#2) ------------ | | --- Data [2 MB - 3 MB] ------------> | [Only 0.6 MB re-sent, not 2.6 MB!]
In addition to minor checkpoints (which roll back partially), major synchronization points delimit completely independent logical units of work (such as individual database transactions) beyond which rollback is prohibited.
20.12 Worked Numerical 5.2: Symmetric vs. Asymmetric Key Overhead
In Presentation Layer security, symmetric ciphers (AES-256) encrypt bulk data at gigabits per second using a single shared secret key, whereas asymmetric ciphers (RSA-2048) are ~1,000 times slower due to modular exponentiation over 2048-bit integers. Therefore, hybrid protocols (TLS, PGP, S/MIME) use RSA or ECDHE strictly to exchange a short 256-bit symmetric session key, then encrypt the entire megabyte payload with AES-GCM—combining asymmetric key distribution with symmetric bulk speed.
20.13 Deep-Dive: OSPF vs. RIP vs. BGP Routing Summary
| Characteristic | RIP (RIPv2) | OSPF (OSPFv2/v3) | BGP-4 |
|---|---|---|---|
| Category | IGP (Distance Vector) | IGP (Link State) | EGP (Path Vector) |
| Metric / Path Criteria | Hop Count (max 15 hops) | Bandwidth-based Cost | Policy Attributes (LOCAL_PREF, AS_PATH) |
| Convergence Speed | Slow (periodic 30 s broadcasts) | Fast (triggered LSA flooding + SPF) | Moderate (event-driven incremental updates) |
| Transport Encapsulation | UDP Port 520 | IP Protocol 89 | TCP Port 179 |
| Loop Prevention | Split Horizon, Poison Reverse, Max 15 | Complete LSDB topology graph | AS_PATH loop detection |
20.14 Deep-Dive: Convergence Layer Adapters and DTN Applications
Because the Bundle Protocol sits as an overlay above heterogeneous link technologies, a Convergence Layer Adapter (CLA) translates generic bundle forwarding into link-specific transport:
- TCPCL (TCP Convergence Layer): Used on terrestrial Internet or reliable Wi-Fi/LTE links where brief TCP sessions can stream bundles efficiently.
- LTP (Licklider Transmission Protocol): Designed specifically for deep-space RF and optical links with multi-minute one-way propagation delays and asymmetric bandwidth, providing selective retransmission without TCP's RTT-sensitive congestion collapse.
- Real-World Deployments: NASA's Deep Impact Network Experiment (DINET) and the International Space Station (ISS) run BPv7 to relay scientific telemetry across orbital blackouts. On Earth, DTN supports Arctic wildlife sensor collars, underwater acoustic autonomous vehicles, and emergency messaging apps when cellular towers fail during cyclones or earthquakes.
20.15 Lab Troubleshooting Reference Matrix
| Observed Symptom | Diagnostic Command | Likely Root Cause & Resolution |
|---|---|---|
APIPA address (169.254.x.x) |
ipconfig /all |
DHCP server unreachable; verify physical link, VLAN, or run ipconfig /renew. |
| Can ping IP, cannot browse domain | nslookup / ipconfig /flushdns |
DNS server misconfigured or stale cache; configure valid DNS (e.g., 8.8.8.8). |
iperf3 connection refused |
iperf3 -s / firewall check |
Server daemon not running or TCP port 5201 blocked by host firewall. |
| Wi-Fi connects but no Internet | ping <gateway> |
Missing default gateway, NAT failure on AP, or upstream WAN link down. |
20.16 Worked Numerical 5.3: OSPF Path Cost Selection
Suppose Router R1 can reach Destination Network 10.50.0.0/16 via two OSPF paths within Area 0 using default Reference Bandwidth :
- Path 1: Two 100 Mbps FastEthernet links in series. Cost per link = . Total Path 1 Cost = .
- Path 2: One 10 Mbps Ethernet link directly to the destination router. Cost = .
Even though Path 2 has fewer hops (1 hop vs. 2 hops), OSPF selects Path 1 because its cumulative bandwidth cost (2) is strictly lower than Path 2 (10). To differentiate 1 Gbps and 10 Gbps links, administrators raise the OSPF reference bandwidth via auto-cost reference-bandwidth 10000.
20.17 Summary of Flexi Module V Protocols and Ports
In summary, Flexi Module V bridges upper-layer OSI abstractions with production Internet infrastructure: Session and Presentation Layers govern dialog synchronization, ASN.1 encoding, compression, and cryptography; OSPF and BGP coordinate intra-domain and inter-domain routing; Delay Tolerant Networking extends reliable store-carry-forward bundle delivery into space and challenged terrestrial environments; and Hands-on Labs 1–8 build operational fluency with ipconfig, ping, iperf3, HTTP servers, DHCP DORA leases, and Wi-Fi security.
20.18 Lab 7 Packet-Level Verification: DHCP DORA Message Sequence
When a workstation boots on an Ethernet LAN with DHCP enabled, students can observe four UDP broadcast/unicast messages on ports 67 (server) and 68 (client):
- DHCPDISCOVER (Client → Broadcast
255.255.255.255): Client uses source IP0.0.0.0and its 48-bit MAC address to locate available DHCP servers. - DHCPOFFER (Server → Client): Server proposes an available IPv4 address from its pool, along with Subnet Mask, Default Gateway (Option 3), DNS Server (Option 6), and Lease Duration (Option 51).
- DHCPREQUEST (Client → Broadcast): Client formally requests the offered IPv4 address (notifying any other DHCP servers that their offers were declined).
- DHCPACK (Server → Client): Server commits the binding in its lease database and confirms the client may configure its TCP/IP interface.
20.19 Lab 8 Wireless Security Standards: WEP vs. WPA2 vs. WPA3
When configuring a wireless Access Point in Lab 8, selecting the security protocol is critical for confidentiality and authentication:
- WEP (Wired Equivalent Privacy): Legacy 802.11 standard using RC4 with a short 24-bit Initialization Vector (IV); trivially cracked in seconds and strictly prohibited on modern networks.
- WPA2 (Wi-Fi Protected Access 2): Mandates AES-CCMP encryption (128-bit) and either Pre-Shared Key (PSK) authentication for home/lab networks or 802.1X/RADIUS Enterprise authentication.
- WPA3: Replaces WPA2's 4-way PSK handshake with Simultaneous Authentication of Equals (SAE), neutralizing offline dictionary attacks and enforcing Forward Secrecy and Protected Management Frames (PMF).
20.20 Lab 1–4 Network Interface and Routing Table Inspection
In addition to ipconfig and ping, administrators inspect local Layer 2/Layer 3 tables using arp -a (displays the cached IPv4-to-MAC address mappings learned on the local Ethernet/Wi-Fi segment) and route print (or ip route show on Linux, which displays the host's routing table including the 0.0.0.0/0 default gateway route). Checking arp -a after pinging a peer immediately confirms whether Layer 2 MAC resolution succeeded even if higher-layer application ports are blocked by a firewall.
20.21 Lab 3 Extended Diagnostics: Path Tracing with tracert
When ping to a remote Internet host fails, students use tracert (Windows) or traceroute (Linux) to pinpoint the exact router hop where packets are dropped or delayed. The utility sends probes with incrementing IPv4 TTL values (TTL = 1, 2, 3, ...). Each router along the path decrements TTL to zero and returns an ICMP Time Exceeded message revealing its IP address and per-hop RTT, until the final destination responds with an ICMP Echo Reply (or UDP Port Unreachable).
University of Kerala FYUGP Academic Framework
Syllabus details for BCA Semester 5 under official University of Kerala regulations.
Assessment comprises a 70-mark End-Semester Examination (2.5 Hours) and 30-mark Continuous Internal Evaluation.
About Computer Network (University of Kerala BCA Sem 5)
Computer Network (UK5DSCCAP301 • 4 Credits • 60 Hours (4 Hrs/Week)) is a DSC offering under the Bachelor of Computer Applications (BCA) Four-Year Undergraduate Programme (UoK FYUGP Regulations 2024 / 2025) at the University of Kerala. Structured across five sequentially integrated instructional modules, the course builds solid theoretical foundations and hands-on technical proficiency in computer network. Students engage with core computing principles, structured problem-solving, implementation techniques, and modern industry practices aligned with Kerala State Higher Education Council outcome-based education standards.
Computer Network Module-by-Module Curriculum Breakdown
Official syllabus unit modules prescribed by the University of Kerala FYUGP framework:
Reference Models, Physical Layer and Multiplexing
A computer network is an interconnected collection of autonomous computing devices capable of exchanging data and sharing hardware, software, and informational resources over guided or unguided transmission media. Two devices are considered networked when a process running on one device can exchange information with a process running on another device through a well-defined communication protocol.
Data Link Layer, Error Control and LAN Standards
The Data Link Layer (Layer 2) sits directly above the Physical Layer and provides a well-defined service interface to the Network Layer. While the Physical Layer moves raw bits without understanding their structure, the Data Link Layer groups bits into discrete frames, regulates transmission speed so a fast sender does not overwhelm a slow receiver ( flow control ), detects or corrects transmission errors ( error control ), and arbitrates shared channel access in broadcast LANs ( media access control ).
Network Layer, Routing and Transport Protocols
Data traverses wide-area networks using three classical switching paradigms: Within packet switching, Datagram networks route each packet independently using its destination IP address—packets from the same flow may take different paths and arrive out of order. In contrast, Virtual Circuit (VC) networks (such as ATM, Frame Relay, and MPLS) establish a logical path during a signaling setup phase and forward packets using short local VC identifiers, preserving packet ordering.
Application Layer, Content Delivery and Streaming
Modern Internet traffic is heavily dominated by web objects, cloud APIs, software distribution, and multimedia streaming rather than uniform peer-to-peer text transfers. Empirically, content popularity follows a skewed Zipf distribution, where the k -th most popular object receives requests proportional to 1/ k α —meaning a tiny fraction of popular videos and web assets accounts for the vast majority of total requests.
Session/Presentation Layers, OSPF/BGP, DTN and Lab Experiments
OSI Layer 5 (Session Layer) establishes, coordinates, and terminates logical dialogues between communicating applications across two hosts. While TCP/IP merges these duties into the Application Layer, understanding Session Layer primitives is essential for database transactions, remote procedure calls (RPC), and multimedia conferencing: OSI Layer 6 (Presentation Layer) guarantees that information sent by the Application Layer of one system is readable by the Application Layer of another, resolving differences in internal data representation:
Core Curriculum & Key Topics
- Fundamentals of Computer Networks and Topologies
- 1 Definition and Components of Data Communication
- 2 Network Criteria: Performance, Reliability, and Security
- 3 Types of Connections
- 4 Network Topologies
- 5 Categories of Networks and the Internet
- Network Reference Models (OSI and TCP/IP)
- 1 Layered Architecture Principles
Learning Outcomes
- Demonstrate authoritative comprehension of the foundational concepts, architectures, and principles of computer network.
- Apply algorithmic, programming, or analytical techniques to design and evaluate practical computing solutions.
- Analyze system trade-offs, security considerations, and industry standards relevant to modern software and IT environments.
- Implement, test, and document structured technical workflows aligned with professional computing practices.
- Achieve exam-ready mastery of University of Kerala FYUGP BCA question patterns across short concepts, technical comparisons, and comprehensive essays.
University of Kerala Examination Scheme for Computer Network
The evaluation framework for Computer Network (UK5DSCCAP301) under University of Kerala FYUGP regulations combines Continuous Internal Evaluation (30 Marks) with the university End-Semester Examination (70 Marks) for a total of 100 Marks (2.5 Hours duration):
10 Questions × 3 Marks (Maximum ceiling 24 Marks). Short definitional and conceptual questions covering all 5 syllabus modules.
8 Questions × 6 Marks (Maximum ceiling 36 Marks). Paragraph questions, comparative evaluations, and analytical problems.
2 Questions × 10 Marks (Answer any 1 for 10 Marks). Long-form essay or comprehensive numerical workout problem.
Exam Preparation Strategy:
To score top marks in the University of Kerala UK5DSCCAP301 (Computer Network) examination: 1. Sketch Layered Architectures & Protocol Flows: Draw neat block diagrams for OSI/TCP-IP layers, OS process state transitions, CPU scheduling Gantt charts, or cryptographic handshakes. 2. Solve Numerical & Scheduling Workouts Cleanly: Show step-by-step calculations for FCFS/SJF/Round Robin waiting times, subnetting, or cipher key transformations. 3. Cite Standards, Protocols & Statutes Accurately: Reference exact protocol numbers, IT Act provisions, or cloud service models (IaaS, PaaS, SaaS) clearly. 4. Balance All 5 Modules: University of Kerala question papers sample definitions, protocol comparisons, and architecture essays across every module.
Exam Preparation & Study Guides — Computer Network
What is Computer Network & Data Communication Components and why is it important in Computer Network?
An interconnected collection of autonomous computing devices exchanging data over guided or unguided media via standardized protocols.
What are the core elements of TCP/IP Reference Model (4/5 Layers) in Computer Network?
Practical Internet protocol architecture merging OSI Session and Presentation into Application, and Physical/Data Link into Network Access.
What is Error Detection & Correction and why is it important in Computer Network?
Redundant bits added to k data bits form an n-bit codeword; single-bit errors flip one bit whereas burst errors corrupt two or more consecutive bits.
What is IPv4/IPv6 Addressing & Subnetting and why is it important in Computer Network?
Logical Layer 3 addressing, CIDR prefix notation, and NAT translation.
What is Streaming Audio & Video and why is it important in Computer Network?
Digitization, perceptual/spatial/temporal compression, and adaptive network playout.
What is the official course code and credit structure for Computer Network at University of Kerala?
Computer Network carries the official course code UK5DSCCAP301 under the University of Kerala FYUGP BCA framework. It is awarded 4 credits (60 Hours (4 Hrs/Week)), evaluated through 30 marks Continuous Internal Evaluation (CIE) and 70 marks End-Semester Examination (ESE).
Where can students download free PDF notes for Computer Network?
Students can read all 5 module notes online and download verified chapter-wise PDFs, combined exam notes, and quick revision sheets for Computer Network (UK5DSCCAP301) directly from DegreeLive (degreelive.in) with zero paywalls or sign-ups.
Course outlines and study notes follow official University of Kerala curricula. Curated by Anoop (Thiruvananthapuram).
For feedback or corrections, contact [email protected].
Related Study Resources & Student Support
Related Semester 5 Subjects
Browse study notes for other courses in BCA Sem 5:
Financial Aid & Grants 2026-27
Check eligibility criteria and deadlines for Kerala government and merit scholarships (e-Grantz 3.0, KSHEC, DCE).
Request Notes
Can't find what you're looking for? Let us know which subject notes you need.