CSE306Semester 3 • 3 CreditsCore Subjects

Computer Networks

This subject covers computer network architectures, models, physical and data link layers, IP addressing, routing, transport and application layer protocols, congestion control, and wireless networking standards. It also develops practical skills in network configuration, subnetting, routing, IPv6, and server setup.

Syllabus PDF
6 Units • Notes • Model Answers • MCQs
Select Course Unit (6 Units)
Active: Unit 1
Unit 1:Unit 1: Introduction and Network Models
32 mins•High-Yield Unit Guide

Unit 1: Introduction and Network Models

Unit 1 Exam Focus & Core Takeaways

Review the core definitions, standard architectures, and syntax patterns below. Pay special attention to sections highlighted with bullet points for your mid-term and end-term subjective questions.

Unit 1: Introduction and Network Models


1. Fundamentals of Data Communications and Network Topologies

A computer network is an interconnected collection of autonomous computing devices capable of exchanging data, sharing physical resources, and executing distributed workflows via wired or wireless transmission media.

CODE
+------------------------------------------------------------------------------------------+
|                       FIVE CORE COMPONENTS OF DATA COMMUNICATION                         |
+------------------------------------------------------------------------------------------+
|                                                                                          |
|             [ SENDER ] -------------> ( MEDIUM / CHANNEL ) -------------> [ RECEIVER ]   |
|                 |                                                             |          |
|                 v                                                             v          |
|            [ Protocol ] <================= ( MESSAGE ) ================> [ Protocol ]   |
|                                                                                          |
|   1. Message: The operational data or payload to be transmitted (text, audio, video).    |
|   2. Sender: The transmitting computing device initiating communication.                 |
|   3. Receiver: The target node designed to accept and process the transmitted payload.   |
|   4. Transmission Medium: The physical conduit carrying signals (copper, fiber, radio).  |
|   5. Protocol: The normative set of formal rules governing data exchange syntax & timing.|
+------------------------------------------------------------------------------------------+

1.1 Transmission Modes (Directionality of Information Flow)

  1. Simplex Mode: Unidirectional communication. Only one terminal can transmit; the other can only receive (e.g., traditional broadcast television, keyboard to CPU).
  2. Half-Duplex Mode: Bidirectional communication, but only one entity can transmit at any given instant. When one node is transmitting, the other must wait (e.g., walkie-talkies, legacy hub-based Ethernet using CSMA/CD).
  3. Full-Duplex Mode (Duplex): Simultaneous bidirectional communication. Both endpoints can transmit and receive data concurrently over independent physical or logical channels (e.g., modern switched twisted-pair Ethernet, telephone networks).

1.2 Quantitative Network Performance Criteria

Network efficacy is evaluated through rigorous performance and operational metrics:

  • Bandwidth (BB): The maximum theoretical data-carrying capacity of a transmission link, quantified in bits per second (bps, Mbps, Gbps).
  • Throughput (TT): The actual rate of successful data delivery over a channel per unit of time (T≤BT \le B).
  • Latency / Round-Trip Time (RTT): The total temporal delay incurred in transporting data from source to destination:
    Latency=Propagation Delay+Transmission Delay+Queuing Delay+Processing Delay\text{Latency} = \text{Propagation Delay} + \text{Transmission Delay} + \text{Queuing Delay} + \text{Processing Delay}
    Propagation Delay=Distance (d)Propagation Speed (v),Transmission Delay=Packet Size (L)Bandwidth (R)\text{Propagation Delay} = \frac{\text{Distance } (d)}{\text{Propagation Speed } (v)}, \quad \text{Transmission Delay} = \frac{\text{Packet Size } (L)}{\text{Bandwidth } (R)}
  • Bandwidth-Delay Product (BDP): Quantifies the volume of data in transit (the pipe volume):
    BDP=Bandwidth (R)×Round-Trip Time (RTT)\text{BDP} = \text{Bandwidth } (R) \times \text{Round-Trip Time } (\text{RTT})
    Signifies the maximum unacknowledged data an in-flight TCP window can sustain.

1.3 Physical and Logical Network Topologies

A network's topology defines the geometric and logical arrangement of connected nodes and communication links.

CODE
+---------------------------------------------------------------------------------------------------------+
|                                  NETWORK TOPOLOGIES COMPARATIVE MATRIX                                  |
+---------------------------------------------------------------------------------------------------------+
| Topology     Structural Arrangement           Total Links (n nodes)  Fault Tolerance   Cost & Complexity|
+---------------------------------------------------------------------------------------------------------+
| Mesh (Full)  Dedicated point-to-point links   n(n - 1) / 2           Immune to single  Extremely high;  |
|              between every node pair                                 link failures     requires n-1 ports|
+---------------------------------------------------------------------------------------------------------+
| Star         Nodes connect radially to a      n                      Central device is Moderate; simple |
|              central switch or hub                                   single failure pt installation     |
+---------------------------------------------------------------------------------------------------------+
| Bus          Nodes tap into a shared single   1 shared backbone      Cable break cuts  Low cost; high   |
|              linear backbone with terminators                        entire segment    collision risk   |
+---------------------------------------------------------------------------------------------------------+
| Ring         Unidirectional or dual loop;     n                      Token ring breaks High maintenance;|
|              each node links to 2 neighbors                          unless dual ring  deterministic lat|
+---------------------------------------------------------------------------------------------------------+
| Tree         Hierarchical star clusters       n - 1                  Branch failure    Scalable; standard|
|              linked via distribution core                            isolates subnet   enterprise LANs  |
+---------------------------------------------------------------------------------------------------------+
  • Full-Mesh Link Formula:
    For nn devices in a full-mesh topology, every node requires (n−1)(n - 1) physical I/O ports, and the total number of duplex links required is:
    L=n(n−1)2L = \frac{n(n - 1)}{2}
    (For 8 nodes: L=8×72=28L = \frac{8 \times 7}{2} = 28 physical cables and 7 ports per device).

2. Internetworking Hardware and Segmentation Devices

Network infrastructure relies on dedicated hardware components operating at specific layers of the abstraction stack to forward signals, filter frames, and route packets.

CODE
+------------------------------------------------------------------------------------------+
|                             INTERNETWORKING HARDWARE SPECTRUM                            |
+------------------------------------------------------------------------------------------+
|                                                                                          |
|  [ LAYER 1: PHYSICAL ]        [ LAYER 2: DATA LINK ]        [ LAYER 3: NETWORK ]         |
|  Repeater / Multiport Hub     Bridge / Layer-2 Switch       Network Router               |
|  - Raw bit regeneration       - Frames, MAC filtering       - Packets, IP routing        |
|  - 1 Collision Domain         - Per-port Collision Domain   - Isolates Collision Domains |
|  - 1 Broadcast Domain         - 1 Broadcast Domain (VLAN)   - Isolates Broadcast Domains |
+------------------------------------------------------------------------------------------+

2.1 Layer-1 Devices: Repeaters and Hubs

  • Repeater: Amplifies and regenerates electrical or optical signals attenuated across long physical cable spans, overcoming distance limitations without inspecting bits.
  • Hub (Multiport Repeater): A physical-layer hub blindly copies incoming bit streams received on one port and retransmits them across all other active ports.
    • Collision Domain: All attached nodes share a single collision domain; simultaneous transmissions result in electrical interference (collisions).
    • Broadcast Domain: All devices share a single broadcast domain.
    • Operational Mode: Strictly half-duplex; throughput degrades rapidly under heavy traffic.

2.2 Layer-2 Devices: Bridges and Layer-2 Switches

  • Bridge: Connects and filters traffic between two distinct LAN segments based on physical MAC addresses.
  • Switch (Multiport Bridge): Maintains an internal Content Addressable Memory (CAM) Table mapping MAC addresses to physical switch ports:
    • Address Learning: Inspects the source MAC address of every ingress frame and records the arrival port in the CAM table with an aging timer.
    • Selective Forwarding: If the destination MAC address is present in the CAM table, the switch forwards the frame strictly out the designated egress port.
    • Flooding: If the destination MAC address is unknown, or if the frame is a broadcast (FF:FF:FF:FF:FF:FF), the switch floods the frame out all ports within that VLAN except the arrival port.
    • Collision Isolation: Every physical switch port creates an isolated collision domain. When operating in full-duplex mode, collisions are mathematically eliminated.
    • Switching Methods:
      • Store-and-Forward: Buffers the entire frame and computes the 32-bit CRC (Frame Check Sequence). Discards corrupted frames, introducing latency proportional to frame size.
      • Cut-Through: Begins forwarding immediately after reading the first 6 bytes (destination MAC address). Delivers lowest latency but propagates corrupted frames.
      • Fragment-Free: Reads the first 64 bytes (the minimum legal Ethernet frame collision window) before forwarding, filtering out collision runts while minimizing latency.

2.3 Layer-3 Devices: Routers

A router connects multiple heterogeneous logical IP subnets and directs packets across internetworks:

  • Routing Decisions: Inspects the destination IP address of incoming packets and consults its Routing Table using Longest Prefix Match (LPM) algorithms.
  • Broadcast Isolation: Routers do not forward Layer-2 Ethernet broadcast frames (FF:FF:FF:FF:FF:FF) across interfaces. Every router interface defines an independent broadcast domain.
  • Ancillary Services: Executes Network Address Translation (NAT), Access Control Lists (ACLs), Quality of Service (QoS) scheduling, and dynamic routing protocols (OSPF, BGP).

2.4 Collision vs. Broadcast Domain Calculation

To calculate domains in an arbitrary enterprise network topology:

  1. Collision Domains: Equal the total number of connected switch ports running in full/half duplex + each separate hub cluster (each hub with all attached PCs counts as 1 collision domain).
  2. Broadcast Domains: Equal the number of distinct router interfaces + each configured Virtual LAN (VLAN).

3. Network Software Architecture and Layering Principles

Layering abstracts complex distributed communications into modular, independent functional tiers, where each tier provides well-defined services to the layer above while remaining agnostic to the internal mechanics of the layers below.

CODE
+------------------------------------------------------------------------------------------+
|                          PROTOCOL DATA UNITS AND ENCAPSULATION                           |
+------------------------------------------------------------------------------------------+
|                                                                                          |
|  [ Layer 7-5: Application ]  ---> Application Data Payload                               |
|                                         |                                                |
|                                         v (Add TCP/UDP Header)                           |
|  [ Layer 4: Transport ]      ---> [ TH | Application Data ]              (SEGMENT)       |
|                                         |                                                |
|                                         v (Add IP Header)                                |
|  [ Layer 3: Network ]        ---> [ NH | TH | Application Data ]         (PACKET)        |
|                                         |                                                |
|                                         v (Add MAC Header & FCS Trailer)                 |
|  [ Layer 2: Data Link ]      ---> [ DH | NH | TH | Data | Trailer (FCS) ] (FRAME)         |
|                                         |                                                |
|                                         v (Physical Transmission)                        |
|  [ Layer 1: Physical ]       ---> 0110100101100010011010010111010001110011(BITS)        |
+------------------------------------------------------------------------------------------+

3.1 Key Architectural Definitions

  • Protocol: A formal set of rules, formats, and semantic definitions governing how peer entities on different machines communicate (e.g., HTTP, TCP).
  • Service: A set of operational capabilities that a layer offers to the layer immediately above it via an interface.
  • Service Access Point (SAP): The conceptual boundary point where a lower layer provides services to a higher layer (e.g., Port numbers in Transport, EtherType in Data Link).
  • Protocol Data Unit (PDU): The data unit exchanged between peer protocol entities across the network (Segment at Transport, Packet at Network, Frame at Data Link, Bits at Physical).
  • Encapsulation & Decapsulation:
    • Encapsulation: Moving down the transmitter's protocol stack, each layer prepends a protocol header (and sometimes appends a trailer) containing layer-specific metadata.
    • Decapsulation: Moving up the receiver's protocol stack, each layer parses, validates, and strips its corresponding header before passing the naked payload to the layer above.

4. The OSI 7-Layer Reference Model (ISO/IEC 7498)

The International Organization for Standardization (ISO) established the Open Systems Interconnection (OSI) model as a conceptual architectural blueprint standardizing vendor-neutral telecommunication functions.

CODE
+---------------------------------------------------------------------------------------------------------+
|                                  THE 7-LAYER OSI REFERENCE MODEL                                        |
+---------------------------------------------------------------------------------------------------------+
| Layer | Name         | Primary Functions                            | Representative Protocols / PDUs   |
+---------------------------------------------------------------------------------------------------------+
|   7   | Application  | Direct network interface for end-user apps;  | HTTP, DNS, SMTP, FTP, SSH, SNMP   |
|       |              | service advertisement and transaction syntax | PDU: Application Data             |
+---------------------------------------------------------------------------------------------------------+
|   6   | Presentation | Syntax conversion, ASCII/EBCDIC translation, | TLS/SSL, JPEG, MPEG, ASCII, ASN.1 |
|       |              | symmetric/asymmetric encryption, compression | PDU: Formatted Data               |
+---------------------------------------------------------------------------------------------------------+
|   5   | Session      | Session establishment, maintenance, token    | RPC, NetBIOS, PPTP, Sockets       |
|       |              | management, and checkpoint synchronization   | PDU: Synced Session Data          |
+---------------------------------------------------------------------------------------------------------+
|   4   | Transport    | End-to-end process delivery, port addressing,| TCP (Reliable), UDP (Datagram)    |
|       |              | segmentation, flow control, error recovery   | PDU: Segment (TCP) / Datagram(UDP)|
+---------------------------------------------------------------------------------------------------------+
|   3   | Network      | Logical IP addressing, route computation,    | IPv4, IPv6, ICMP, OSPF, BGP, IPsec|
|       |              | packet forwarding, and fragmentation         | PDU: Packet / Datagram            |
+---------------------------------------------------------------------------------------------------------+
|   2   | Data Link    | Physical framing, MAC addressing, link flow  | Ethernet (802.3), Wi-Fi (802.11)  |
|       |              | control, media access, error detection (CRC) | PDU: Frame                        |
+---------------------------------------------------------------------------------------------------------+
|   1   | Physical     | Bit-level transmission over physical media,  | Cat6 UTP, Optical Fiber, RS-232   |
|       |              | voltage levels, signaling rates, pinouts     | PDU: Bits                         |
+---------------------------------------------------------------------------------------------------------+

4.1 Detailed Functional Analysis of Each OSI Layer

  1. Physical Layer (Layer 1):
    • Transmits unstructured raw bitstreams over physical channels.
    • Defines electrical characteristics (voltage levels representing 0 and 1, signal rise times), optical properties, radio carrier frequencies, connectors (RJ-45), data rates, and synchronization clocks.
  2. Data Link Layer (Layer 2):
    • Transforms an error-prone physical transmission line into a reliable link.
    • Decomposed into two sublayers by IEEE 802:
      • Logical Link Control (LLC - 802.2): Manages flow control, acknowledgments, and multiplexes network layer protocols using Service Access Points.
      • Media Access Control (MAC - 802.3/802.11): Manages access to shared transmission media and attaches 48-bit physical MAC addresses.
    • Appends a Frame Check Sequence (FCS) using a 32-bit Cyclic Redundancy Check (CRC-32) to detect corrupt bits.
  3. Network Layer (Layer 3):
    • Implements logical network addressing independent of physical hardware architectures.
    • Resolves routing paths across heterogeneous multi-hop networks, handling packet forwarding, routing table lookups, and MTU fragmentation.
  4. Transport Layer (Layer 4):
    • Provides process-to-process delivery using 16-bit Port Numbers (0−655350 - 65535).
    • Segments large application payloads into MTU-compliant sizes at transmission and reassembles them at destination.
    • Provides reliability guarantees (connection-oriented TCP) via cumulative acknowledgments, sequence numbers, sliding-window flow control, and dynamic congestion control algorithms.
  5. Session Layer (Layer 5):
    • Controls communication dialogues between remote systems.
    • Implements Synchronization Checkpoints during large file transfers; if network connectivity drops midway, the transfer resumes from the last confirmed checkpoint rather than restarting from the beginning.
  6. Presentation Layer (Layer 6):
    • Handles the syntax, semantics, and format of exchanged information.
    • Translates disparate character encoding schemes (e.g., ASCII to EBCDIC), applies lossy or lossless compression, and handles cryptographic encryption/decryption (TLS/SSL).
  7. Application Layer (Layer 7):
    • Supplies network protocols and application services directly to user-facing software applications (web browsers, email clients, file synchronization tools).

5. The TCP/IP Protocol Suite (The Internet Model)

Developed through DARPA research, the TCP/IP suite represents the practical, battle-tested architectural framework upon which the global Internet operates.

CODE
+------------------------------------------------------------------------------------------+
|                         OSI 7-LAYER VERSUS TCP/IP 4-LAYER MODEL                          |
+------------------------------------------------------------------------------------------+
|                                                                                          |
|       OSI REFERENCE MODEL                       TCP/IP PROTOCOL SUITE                    |
|  +---------------------------+               +---------------------------+               |
|  | 7. Application            | \             |                           |               |
|  | 6. Presentation           | -- Merged --> |    APPLICATION LAYER      | (HTTP, DNS,   |
|  | 5. Session                | /             |                           |  SSH, SMTP)   |
|  +---------------------------+               +---------------------------+               |
|  | 4. Transport              | ------------> |    TRANSPORT LAYER        | (TCP, UDP)    |
|  +---------------------------+               +---------------------------+               |
|  | 3. Network                | ------------> |    INTERNET LAYER         | (IPv4, IPv6,  |
|  |                           |               |                           |  ICMP, ARP)   |
|  +---------------------------+               +---------------------------+               |
|  | 2. Data Link              | \             |                           |               |
|  | 1. Physical               | -- Merged --> |    NETWORK ACCESS LAYER   | (Ethernet,    |
|  |                           | /             | (LINK / PHYSICAL)         |  Wi-Fi, Fiber)|
|  +---------------------------+               +---------------------------+               |
+------------------------------------------------------------------------------------------+

5.1 The Hourglass Architecture

The TCP/IP suite is structured conceptually as an hourglass:

  • At the top: Hundreds of diverse application-layer protocols (HTTP, SMTP, SSH, DNS).
  • In the middle (The Narrow Waist): A single, universal unifying internetworking protocol—the Internet Protocol (IP). Every internet packet must pass through IP.
  • At the bottom: Diverse physical and data-link transmission media (Ethernet, Wi-Fi, DOCSIS cable, satellite, fiber optics).

5.2 Four Addressing Tiers in TCP/IP

  1. Physical (MAC) Addresses (48-bit / 6 bytes):
    • Hardcoded into Network Interface Cards (NICs), represented in hexadecimal: 00:1A:2B:3C:4D:5E.
    • Used exclusively for local frame delivery within a single broadcast/switched domain.
  2. Logical (IP) Addresses (32-bit IPv4 / 128-bit IPv6):
    • Hierarchical software addresses configured globally: 192.168.1.1 (IPv4) or 2001:0db8::1 (IPv6).
    • Used by routers for global end-to-end packet routing across networks.
  3. Port Addresses (16-bit / 2 bytes):
    • Uniquely identifies running application processes on an operating system (0−655350 - 65535).
    • Well-Known Ports (0−10230 - 1023): HTTP (80), HTTPS (443), DNS (53), SSH (22), SMTP (25), DHCP (67/68).
    • Registered Ports (1024−491511024 - 49151): Assigned by IANA for specific vendor services.
    • Dynamic / Ephemeral Ports (49152−6553549152 - 65535): Temporary ports allocated by operating systems for client sockets.
  4. Specific Application Addresses:
    • User-friendly identifiers resolved by application protocols: Uniform Resource Locators (URLs like https://www.lpu.in) and email addresses (user@domain.com), mapped to IP addresses via DNS.