Comprehensive Study Notes on Computer Networks Architecture and Fundamentals

Course Overview and Recommended Literature

  • Recommended Textbooks and References:
    • Larry L. Peterson & B. S. Davie, Computer Networks: A Systems Approach, 4th Edition, Morgan Kaufmann Publishers.
    • William Stallings, Data and Computer Communications, Pearson Education Publishers.
    • Tenenbaum A. S, Computer Networks, 4th Edition, Prentice Hall.
    • Keshav, An Engineering Approach to Computer Networks, Addison Wesley.
  • Course Content and Topics:
    • Network requirements, network architecture, implementing network software, and performance metrics.
    • Direct link networks: encoding, framing, error detection, reliable transmission, Ethernet, token rings, and wireless networks.
    • Packet switching: forwarding mechanisms, bridges, cell switching, internetworking, datagram forwarding, Address Resolution Protocol (ARP), Dynamic Host Configuration Protocol (DHCP), routing algorithms, and multicast.
    • End-to-end protocols: User Datagram Protocol (UDP), Transmission Control Protocol (TCP), Remote Procedure Call (RPC), congestion control, congestion avoidance, and Quality of Service (QoS).
    • Presentation formatting, data compression, cryptographic algorithms, security mechanisms, firewalls, name service, and higher-level applications.
    • Network Management and practical aspects of networking.

Fundamentals of Computer Networks

  • Heterogeneous Systems Communication:
    • Heterogeneous computing systems must interact across shared infrastructure.
    • Physical Media Options:
    • Wired media: twisted pair, coaxial cable, and optical fiber.
    • Wireless media: radio frequency communication.
    • Network Topology: The physical layout and logical arrangement of network links and nodes.
    • Protocols and Software: Standardized rules and software layers enabling interoperability across different machine architectures.

Core Network Requirements: Connectivity

  • Fundamental Network Requirements:
    • Connectivity.
    • Cost-Effective Resource Sharing.
    • Support for Common Services.
  • Scope of Connectivity:
    • Provides communication paths among a collection of computers.
    • Limited Networks: Connect a restricted set of select machines for privacy, security, or corporate operational requirements.
    • Scalable Networks: Designed to grow and scale, offering potential global connectivity across all computers worldwide (e.g., the Internet).
  • Links and Nodes:
    • Link: The physical transmission medium directly connecting two or more devices (e.g., coaxial cable, optical fiber).
    • Node: A specialized computing device or general-purpose computer connected to the network.
  • Direct Link Types:
    • Point-to-Point Link: A physical link restricted to connecting exactly two nodes.
    • Multiple Access Link: A shared physical link connecting more than two nodes simultaneously.
  • Limitations of Direct Links:
    • If networks required every host pair to be directly connected over a common physical medium:
    • Networks would be extremely limited in total host capacity.
    • The physical cabling required per host would become financially cost-prohibitive and physically unmanageable.
    • Solution: Indirect connectivity achieved through cooperating intermediate nodes.
  • Switched Networks:
    • A set of intermediate nodes attached to point-to-point links running forwarding software.
    • Circuit Switched Networks:
    • Historically used by traditional telephone systems.
    • Requires establishing a dedicated physical circuit across links before data transmission begins.
    • Transmits a continuous bit stream across the dedicated circuit.
    • Packet Switched Networks:
    • Dominant architecture in modern computer networks.
    • Sends discrete blocks of data called packets or messages, corresponding to application data (e.g., files, emails, images).
    • Employs a store-and-forward strategy: each intermediate node receives a complete packet, stores it in internal memory, and then forwards it to the next node.
    • Offers significantly higher bandwidth efficiency compared to circuit switching.
  • The Network Cloud Abstraction:
    • Represents any underlying network structure, whether a single point-to-point link, a multiple-access link, or a complex switched network.
    • Primary role of switches within the cloud is to store and forward packets.
  • Interconnection of Networks (Internetworking):
    • Interconnecting independent networks (clouds) forms an internetwork, or internet.
    • Router or Gateway: A specialized node connected to two or more distinct networks that forwards messages between them.
    • The global Internet is an internetwork constructed recursively by interconnecting smaller internetworks.
  • Addressing and Routing:
    • Address: A unique byte string assigned to each node, allowing the network to distinguish individual machines.
    • Routing: The systematic process of determining how to forward messages through intermediate switches and routers toward a destination node based on its address.
    • Message Delivery Patterns:
    • Unicast: Delivering a message to a single specific destination node.
    • Broadcast: Delivering a message to all nodes connected to the network.
    • Multicast: Delivering a message to a specific subset of destination nodes.

Core Network Requirements: Cost-Effective Resource Sharing

  • Resource Sharing via Multiplexing:
    • Enables multiple host pairs to share physical links and network resources concurrently.
    • Analogy: Similar to time-sharing operating systems.
    • Multi-flow setup: Multiple senders (S1S_1, S2S_2, S3S_3) transmit data to receivers (R1R_1, R2R_2, R3R_3) over intermediate switches connected by a single shared link.
  • Traditional Multiplexing Techniques:
    • Synchronous Time Division Multiplexing (STDM):
    • Divides time into equal-sized time quanta.
    • Assigns quanta in round-robin fashion (S1→R1S_1 \rightarrow R_1 in time quantum 11, S2→R2S_2 \rightarrow R_2 in quantum 22, S3→R3S_3 \rightarrow R_3 in quantum 33).
    • Frequency Division Multiplexing (FDM):
    • Transmits flows simultaneously over distinct frequency bands across the physical link (analogous to cable television).
  • Limitations of STDM and FDM:
    • Wasted Capacity: If a flow has no data to send, its allocated time quantum or frequency band sits idle, even if other flows have pending data.
    • Computer network traffic is inherently bursty; idle duration dominates (e.g., reading a web page versus downloading it).
    • Fixed Capacity: Total available flows are fixed in advance, making dynamic resizing of quanta or adding new frequencies non-viable.
  • Statistical Multiplexing:
    • Shares physical links over time dynamically on demand rather than through fixed time slots.
    • If only one flow has data to send, it transmits continuously without waiting for idle quanta of other flows to pass.
    • Avoidance of idle capacity gives packet switching its superior efficiency.
  • Packets and Interleaving:
    • To prevent a single flow from monopolizing the shared physical link indefinitely, an upper bound is enforced on transmission block size.
    • Packet: The maximum size-limited block of data permitted for single transmission.
    • Message Fragmentation and Reassembly: Hosts fragment large application messages into multiple packets for transmission and reassemble them at the receiving host.
    • Interleaving: Packets from multiple active flows are interleaved on shared physical links on a packet-by-packet basis.
  • Switching Decisions and Quality of Service (QoS):
    • Switches make forwarding decisions independently per packet.
    • Scheduling algorithms: First-In-First-Out (FIFO) queueing or Round-Robin scheduling.
    • Quality of Service (QoS): Specific switch features designed to guarantee explicit bandwidth allocations or bound packet delays for specified flows.
  • Switch Congestion:
    • Occurs when packets arrive at a switch faster than the outgoing link can transmit them.
    • Excess packets are stored in internal switch buffer memory.
    • Extended rate mismatches deplete switch buffer space, forcing the switch to drop incoming packets (congested state).

Core Network Requirements: Support for Common Services and Reliability

  • Service Channels ("Pipes"):
    • Networks establish logical channels connecting application processes across hosts.
    • Common communication patterns are factored out of individual application implementations and built directly into reusable network channels.
  • Common Application Communication Patterns:
    • Request/Reply Channels:
    • Used by remote file access protocols (File Transfer Protocol - FTP, Network File System - NFS) and digital library applications.
    • Client process sends a small request message; server process returns a response message (e.g., large file data or write confirmation).
    • Properties: Guarantees delivery of every message, prevents duplicate delivery (delivers exactly one copy), and maintains privacy/integrity against unauthorized interception or tampering.
    • Message Stream Channels:
    • Used by real-time audio/video applications (Videoconferencing, Video-on-Demand).
    • Parameterized for one-way or two-way traffic and strict delay constraints.
    • Tolerates occasional packet drops (video quality remains acceptable without total frame loss protection).
    • Supports multicast to transmit stream data to multiple recipients simultaneously.
  • Architectural Placement Tradeoffs:
    • Bit Pipe Model: The network underlying host-to-host connectivity acts as a simple bit pipe. Intermediate switches remain simple packet forwarders while end hosts assume all high-level semantically rich channel support.
    • Smart Network Model: Pushes complex semantic functionality onto switches, permitting end hosts to function as dumb devices.
  • Network Failure Modes and Reliability:
    • Bit-Level Failures:
    • Bit Inversion: Corruption turning a 11 into a 00 or vice versa.
    • Burst Error: Corruption affecting multiple consecutive bits.
    • Causes: Physical phenomena such as lightning strikes, power surges, and microwave oven interference.
    • Measured Error Rates:
      • Copper cable: Typically 11 error per 10610^6 to 10710^7 bits.
      • Optical fiber: Typically 11 error per 101210^{12} to 101410^{14} bits.
    • Handling: Error detection codes; damaged packets exceeding repair capabilities are discarded, prompting retransmission by the sender.
    • Packet-Level Failures:
    • Loss of complete packets caused by uncorrectable bit errors, switch buffer overflows during congestion, or software forwarding bugs.
    • Challenge: Distinguishing between a packet that is genuinely lost versus one that is delayed in transit.
    • Node and Link Failures:
    • Physical link cuts (e.g., backhoe operator damage), machine crashes, power loss, or device misconfigurations.
    • Mitigation: Packet-switched networks dynamically route packets around failed links and nodes.

Network Architecture Concepts and Layering

  • Purpose of Network Architecture:
    • Serves as a standard blueprint guiding the design, implementation, and interoperability of complex networking systems.
  • Abstraction and Layering:
    • System complexity is managed by introducing progressive abstractions.
    • Lower layers execute basic hardware operations; higher layers build upon these to offer richer service abstractions.
    • Benefits:
    • Problem Decomposition: Divides system implementation into manageable pieces.
    • Modularity: Allows individual layer implementations to be updated or replaced without modifying surrounding layers.
  • Multiple Abstractions per Layer:
    • A single system layer can offer multiple alternative services to higher layers (e.g., offering both Request/Reply and Message Stream abstractions over shared host-to-host connectivity).

Protocol Graphs, Encapsulation, and Multiplexing

  • Definition of Protocols:
    • Abstract software and hardware objects that constitute network layers and export communication services.
  • Protocol Interfaces:
    • Service Interface: Local interface on a single machine defining operations that local objects can invoke on the protocol (e.g., HTTP service interface fetching web pages).
    • Peer Interface: Formatting and structural rules governing messages exchanged between protocol instances running on different machines (e.g., formatting an HTTP GET command).
  • Interfaces versus Modules:
    • Protocol Interface: Abstract specification of operations and message formats.
    • Protocol Module: The actual software or hardware implementation of a protocol interface.
    • Interoperability: The capacity of two distinct protocol module implementations of the same specification to communicate correctly.
  • Protocol Graphs:
    • A directed acyclic graph where nodes represent protocols and edges represent dependencies.
    • Example: Request/Reply Protocol (RRP) and Message Stream Protocol (MSP) both depend on Host-to-Host Protocol (HHP).
  • Encapsulation:
    • Application data passed to a protocol is treated as an uninterpreted byte string (payload/body).
    • Control Information:
    • Header: Control structure attached to the front of a payload.
    • Trailer: Control structure attached to the end of a payload.
    • Process: High-level messages are encapsulated inside low-level protocol messages. Destination hosts strip headers in reverse order as data ascends the protocol graph.
    • Transformations: Protocols can transform entire payload bodies (e.g., applying data compression or encryption) including headers from higher protocols.
  • Multiplexing and Demultiplexing in Protocols:
    • Multiplexing merges data streams from multiple upper-layer protocols over a single lower-layer protocol.
    • Demultiplexing Key (Demux Key): Header field recording which high-level protocol or application owns the enclosed message.
    • Demux Key Variations:
    • Field sizes vary across protocols: 8-bit8\text{-bit} (supporting up to 256256 protocols), 16-bit16\text{-bit}, or 32-bit32\text{-bit} fields.
    • Single key field vs. paired key fields (where each side uses a distinct key to identify upper-layer protocols).

Open Systems Interconnection (OSI) Reference Model

  • Model Overview:
    • Standardized by the International Organization for Standardization (ISO) and International Telecommunication Union (ITU) ("Xdot" series including X.25, X.400, X.500).
    • Partitioned into seven distinct functionality layers.
  • The Seven OSI Layers:
    • Layer 1: Physical Layer: Handles physical transmission of raw bits over communication links.
    • Layer 2: Data Link Layer: Collects raw bits into structured frames; implemented in network adapters and OS device drivers.
    • Layer 3: Network Layer: Manages packet routing across network nodes; data unit is a packet.
    • Layer 4: Transport Layer: Implements process-to-process channels; data unit is a message.
    • Layer 5: Session Layer: Manages namespaces and ties together distinct transport streams belonging to a single application (e.g., combining audio and video streams in teleconferencing).
    • Layer 6: Presentation Layer: Handles data formatting and representation differences between peers (e.g., 16-bit16\text{-bit}, 32-bit32\text{-bit}, or 64-bit64\text{-bit} integer lengths, big-endian vs. little-endian byte ordering, video stream formats).
    • Layer 7: Application Layer: High-level application protocols (e.g., File Transfer Protocol - FTP).
  • Implementation Topology:
    • Lower three layers (Physical, Data Link, Network) run on all network nodes, including intermediate switches/routers.
    • Upper four layers (Transport, Session, Presentation, Application) execute exclusively on end hosts.

Internet (TCP/IP) Architecture

  • Historical Background:
    • Funded by the Advanced Research Projects Agency (ARPA) of the U.S. Department of Defense.
    • Evolved through practical deployment experience on the ARPANET, predating the OSI architecture.
  • Four-Layer Model Structure:
    • Subnetwork / Link Layer: Hardware network adapters and device drivers (e.g., Ethernet, Fiber Distributed Data Interface - FDDI).
    • Internet Layer: Internet Protocol (IP), unifying disparate subnetwork technologies into a logical internetwork.
    • Transport Layer: End-to-end transport protocols providing process channels.
    • Transmission Control Protocol (TCP): Offers a reliable, ordered byte-stream channel.
    • User Datagram Protocol (UDP): Offers an unreliable datagram delivery channel.
    • Application Layer: Protocols such as FTP, Trivial File Transfer Protocol (TFTP), Telnet (remote login), Simple Mail Transfer Protocol (SMTP), and Hypertext Transfer Protocol (HTTP).
  • Key Features and Design Philosophy:
    • Flexible Layering: Does not enforce strict layering; applications can bypass transport protocols to access IP or underlying subnetworks directly.
    • Hourglass Architecture: IP serves as the narrow focal point in the middle. Above IP, arbitrarily many transport protocols can be developed; below IP, arbitrarily many subnetwork technologies can be integrated.
    • Practical Implementation Culture: Managed by the Internet Engineering Task Force (IETF). Standardizing a new protocol officially requires a complete specification alongside at least one or two working implementations to ensure efficiency and interoperability.