Overview
This chapter introduces Computer Networks — systems that connect two or more computers to share resources and exchange information. It explains why networks are essential in modern life (internet, email, cloud services, online collaboration) and how they enable communication, resource sharing and distributed computing. The chapter covers fundamental concepts such as network types (LAN, MAN, WAN, PAN), topologies (bus, star, ring, mesh), transmission media (twisted pair, coaxial, fiber, wireless), data transmission modes (simplex, half-duplex, full-duplex), and network devices (hub, switch, router, modem, NIC). Key theoretical frameworks — the OSI and TCP/IP models — are presented to show how communication is structured into layers; common protocols (HTTP, FTP, SMTP, POP/IMAP, TCP, UDP, IP) are mapped to these layers and their roles are explained. Addressing concepts (IPv4 addressing, subnet mask, public vs private addresses, DNS) and basic differences between packet switching and circuit switching are covered. The chapter also introduces network services (web, email, file transfer), basic network security concepts (encryption, authentication, firewalls, VPNs) and practical…
Learning Objectives
- Define the terms network, node, host, and link in the context of computer networks.
- Explain types of computer networks (LAN, MAN, WAN, PAN, CAN) with typical use cases.
- Compare common network topologies (bus, star, ring, mesh, tree) and state their advantages and limitations.
- Describe the OSI and TCP/IP models and explain the functions of each layer.
- Explain the roles and working principles of network devices: hub, switch, router, bridge, gateway, modem, repeater, and access point.
- Differentiate between MAC and IP addresses and compare IPv4 and IPv6 addressing schemes.
- Calculate subnet masks, network IDs, host ranges and broadcast addresses given an IPv4 address and prefix length.
- Configure basic IPv4 settings (IP address, subnet mask, default gateway, DNS) on a host and verify connectivity.
Topics in this chapter
20 topics · tap a topic title to jump straight to it.
Introduction to Computer Networks
Introduction to Computer Networks
Key Point: Transmission time (s) = Data size (bits) / Bandwidth (bits per second). Example: 10 MB = 80,000,000 bits; over 10 Mbps link: 80,000,000 / 10,000,000 = 8 s.
What is a Computer Network?
A computer network is a collection of two or more interconnected devices (computers, servers, printers, routers, switches, IoT devices) that can communicate and share resources (files, printers, internet connection). Networks enable data exchange using standardized rules called protocols.
Why networks?
To share resources and information, centralize data, communicate (email, chat, video call), and provide services (web, file transfer, remote access). Networks reduce cost, improve collaboration, and enable distributed computing.
Basic components
- End devices (hosts): PCs, smartphones, servers.
- Transmission media: Copper cable, optical fiber, wireless (Wi‑Fi, cellular).
- Intermediary devices: Switches (link-layer), routers (network-layer), hubs, access points.
- Protocols: Rules for communication, e.g., TCP/IP, HTTP, DNS.
Types of networks by scale
- PAN (Personal Area Network) – very small, e.g., Bluetooth devices.
- LAN (Local Area Network) – single building or campus, e.g., school network.
- MAN (Metropolitan Area Network) – city-wide.
- WAN (Wide Area Network) – covers large geographic areas, e.g., the Internet.
Topologies (physical/logical layouts): Bus, Star, Ring, Mesh, Tree. Choice affects performance, fault tolerance and cost.
Switching techniques
- Circuit switching: A dedicated path is reserved for the duration of a connection (e.g., traditional telephone networks).
- Packet switching: Data is broken into packets routed independently; efficient and robust (used on the Internet).
Network models
- OSI model: 7 layers (Application, Presentation, Session, Transport, Network, Data Link, Physical) — conceptual for learning.
- TCP/IP model: 4 layers (Application, Transport, Internet, Network Access) — practical for the Internet.
Addressing and naming
- MAC address: Hardware address assigned to network interface (link-layer).
- IP address: Logical address for routing (IPv4: dotted decimal, IPv6: hexadecimal).
- DNS: Domain Name System maps human-friendly names to IP addresses.
Common services and applications: Web browsing (HTTP/HTTPS), email (SMTP/IMAP/POP), file transfer (FTP/SFTP), remote login (SSH), streaming, VoIP, online gaming.
Performance metrics (brief): Bandwidth (capacity), Throughput (actual data rate), Latency (delay), Jitter (variability of delay), Packet loss. These determine user experience for applications like video conferencing and gaming.
Security basics: Authentication, encryption (TLS/SSL), firewalls, access control, VPNs. Security protects confidentiality, integrity and availability of data.
Advantages of networking: Resource sharing, centralized management, improved communication, scalability. Disadvantages: Security risks, complexity, potential congestion and single points of failure if not designed well.
- School LAN: Computers in classrooms and labs connected to a central server and printer via switches; students access shared resources and the Internet.
- Home Wi‑Fi: Multiple devices (phones, laptops, smart TV) connect wirelessly to a home router that provides Internet access from the ISP.
- Online video call: Uses packet switching over the Internet; low latency and jitter are critical for good quality.
- Cellular network: Mobile phones connect to base stations; calls and data are routed through the provider's core network (example of wide-area networking).
- Smart home IoT: Sensors and smart bulbs communicate via Wi‑Fi or Zigbee to a home hub, enabling remote control and automation.
- \[Transmission time (s) = Data size (bits) / Bandwidth (bits per second)\]\[Example: 10 MB = 80,000,000 bits\]\[over 10 Mbps link: 80,000,000 / 10,000,000 = 8 s.\]
- \[Propagation delay (s) = Distance (m) / Propagation speed (m/s)\]\[Example: 2,000 km ≈ 2,000,000 m\]\[speed in fiber ≈ 2×10^8 m/s → 0.01 s (10 ms).\]
- \[Round‑Trip Time (RTT) ≈ 2 × Propagation delay + Transmission delay + Queuing/processing delays.\]
- \[Bandwidth‑delay product (bits) = Bandwidth (bits/s) × RTT (s)\]\[It indicates how much data 'fills' the link (useful for buffer sizing).\]
- \[Channel capacity (Shannon) C (bits/s) = B × log2(1 + S/N)\]\[where B = bandwidth (Hz)\]\[S/N = signal-to-noise ratio (linear).\]
- \[Bit rate from modulation: Bit rate = Baud rate × log2(M)\]\[where M = number of signal levels\]\[Example: QPSK has M=4 → 2 bits per symbol.\]
Types of Networks
Types of Networks
Key Point: Transmission time = Data size (bits) / Bandwidth (bits per second). Example: sending a 10 Mb (10,000,000 bits) file over a 10 Mbps link takes 10,000,000 / 10,000,000 = 1 second.
A computer network is a set of devices connected to share resources and exchange data. Networks are classified mainly by their geographic scope, ownership and purpose. The common types are:
- Personal Area Network (PAN): Very small network around one person (range ~1–10 m). Typically uses Bluetooth, USB or Zigbee to connect a smartphone, headset, keyboard, or smartwatch.
- Local Area Network (LAN): Connects devices within a limited area such as a home, office or school (range ~10 m to a few km). Often uses Ethernet or Wi‑Fi. LANs are usually owned and managed by a single organization and provide high data rates.
- Campus/Corporate Area Network (CAN): Larger than a LAN, covering a campus or business complex (tens of km). Connects multiple buildings using high‑speed links and often centralized services.
- Metropolitan Area Network (MAN): Spans a city or metropolitan area (up to ~50 km). MANs connect multiple LANs and are typically provided by a municipality or telecom provider using fiber‑optic backbones.
- Wide Area Network (WAN): Covers large geographic areas — regions, countries or continents. WANs interconnect LANs and MANs using leased lines, satellite links or long‑distance fiber. The Internet is an example of a global WAN.
- Global/Internet (GAN): A network of networks spanning the globe. The Internet is the primary example: it interconnects many WANs and MANs to provide worldwide communication.
- Storage Area Network (SAN): A specialized high‑speed network that provides block‑level storage access, typically inside data centers to connect servers and storage devices.
Key distinguishing factors: coverage area (range), ownership/administration (private vs public), typical technologies, and typical data rates. Smaller networks (PAN, LAN) give higher speeds and more direct control; larger networks (MAN, WAN) cover greater distances but rely on intermediate providers and often have higher latency.
Related concepts often shown with types of networks: typical topologies used inside networks (star, bus, ring, mesh) and common devices (NICs, switches, routers, modems) that connect different network types.
- PAN: Connecting a smartphone to wireless earbuds or a Bluetooth mouse to a laptop.
- LAN: Office network using Ethernet switches and Wi‑Fi access points to connect PCs and printers in a building.
- CAN: University campus network linking lecture halls, labs and administration buildings with fiber backbone and shared servers.
- MAN: City government network connecting public libraries, municipal offices and CCTV systems across the city.
- WAN: A bank’s branches across the country connected through leased MPLS links; the Internet connecting websites and users worldwide.
- SAN: Data center where multiple servers access a shared storage array over Fibre Channel or iSCSI.
- \[Transmission time = Data size (bits) / Bandwidth (bits per second)\]\[Example: sending a 10 Mb (10,000,000 bits) file over a 10 Mbps link takes 10,000,000 / 10,000,000 = 1 second.\]
- \[Propagation delay = Distance / Propagation speed\]\[Example: 2,000 km over fiber (~2 × 10^8 m/s) → 2,000,000 m / 2×10^8 m/s = 0.01 s (10 ms).\]
- \[Bandwidth–delay product = Bandwidth (bits/s) × Round‑trip delay (s)\]\[It indicates how many bits can be 'in flight' on the link.\]
- \[Throughput = Useful data delivered / Total time taken. (Used to measure effective data rate.)\]
- \[Utilization (%) = (Throughput / Link bandwidth) × 100.\]
Network Topologies
Network Topologies
Key Point: Star topology: number of point-to-central links = n - 1 (for n nodes, each node has one link to the central device).
Definition: Network topology is the arrangement or layout of nodes (computers, printers, switches, routers) and the physical or logical connections between them. Topology affects performance, fault tolerance, cost and scalability of a network.
Common topologies:
- Bus topology: All devices share a single central cable (backbone). Each device is connected to the backbone via a drop line. Easy and cheap for small networks but performance and reliability degrade with more nodes; requires terminators at ends.
- Star topology: Every node connects to a central device (hub/switch). If a peripheral node fails, only that node is affected; if the central device fails, the whole network goes down. Easy to manage and expand.
- Ring topology: Nodes form a closed loop; each node connects to two neighbors. Data travels in one or both directions. Predictable performance, but a single break can disrupt the network unless there is redundancy (dual ring).
- Mesh topology: Every node has a link to every other node (full mesh) or some nodes have multiple interconnections (partial mesh). Provides high redundancy and fault tolerance but high cost and cabling complexity.
- Tree (hierarchical) topology: Combination of star topologies arranged in levels (rooted tree). Useful for large networks with clear hierarchy (campus, organization networks).
- Hybrid topology: Any combination of two or more topologies (e.g., star–bus, star–ring). Chosen to meet specific requirements for cost, performance and reliability.
Key characteristics to compare:
- Cost (cabling, devices)
- Scalability (ease of adding nodes)
- Reliability and fault tolerance
- Performance (collision domains, latency)
- Ease of maintenance and troubleshooting
Advantages / Disadvantages (summary):
- Bus: inexpensive for small nets; hard to troubleshoot and limited cable length.
- Star: easy to manage and extend; depends on central device.
- Ring: orderly access with predictable delays; vulnerable to break unless redundant.
- Mesh: excellent redundancy and minimal single-point failures; expensive and complex.
- Tree: scalable and easy to expand; depends on higher-level nodes (partial single points of failure).
- Hybrid: flexible to meet needs; complexity varies with combination.
When to choose which topology: For small home or office networks, star (switch/Wi‑Fi) is most common. For high-availability backbones, partial/full mesh is preferred. Tree/hierarchical suits campuses and large organizations. Bus is mostly historical (older Ethernet coax, simple fieldbuses) and is rarely used for new installations.
- Home Wi‑Fi / Ethernet via a router or switch — Star topology (each device connects to a central router/switch).
- Traditional Ethernet over coax (10BASE2) and some fieldbus systems — Bus topology (single backbone with terminators).
- SONET rings and IBM Token Ring networks — Ring topology (traffic circulates around a closed loop).
- Internet backbone links and critical WAN connections between data centers — Partial or full Mesh topology for redundancy.
- University or corporate LAN with departmental switches connected to a core — Tree (hierarchical) topology.
- Wireless mesh networks for community Wi‑Fi or IoT deployments — Mesh topology (multiple wireless relays with alternate routes).
- \[Star topology: number of point-to-central links = n - 1 (for n nodes\]\[each node has one link to the central device).\]
- \[Ring topology: number of links (edges) = n (each node connects to two neighbours\]\[total distinct links equals number of nodes).\]
- \[Bus topology: backbone segments = 1 (single shared medium)\]\[attachments = n (n drop lines to the backbone).\]
- \[Full Mesh topology: number of direct links = n(n - 1)/2 (undirected links between every pair of n nodes).\]
- \[Tree (any connected acyclic graph with n nodes): number of links (edges) = n - 1.\]
- \[Hybrid topology: link count and complexity depend on constituent topologies (no single universal formula).\]
Network Devices
Network Devices
Key Point: Transmission delay = L / R (where L = packet length in bits, R = link bandwidth in bits/sec)
Overview
Network devices are hardware components that connect computers and other devices to form a network, forward data, control traffic, and provide services (security, access, translation). Each device operates at one or more OSI layers and has specific functions and intelligence.
Common Network Devices and Their Roles
- Network Interface Card (NIC) (Layer 1/2): Physical adapter in a computer that converts data to electrical/optical/radio signals and provides a MAC address for frames.
- Repeater (Layer 1): Regenerates and amplifies signals to extend transmission distance; no filtering or addressing.
- Hub (Layer 1): Multiport repeater; broadcasts incoming frames to all ports (creates single collision domain).
- Bridge (Layer 2): Connects two LAN segments, filters traffic by MAC address, reduces collision domains.
- Switch (Layer 2, sometimes Layer 3): Forwards frames to specific ports using a MAC address table; isolates collision domains; Layer 3 switches add routing between VLANs.
- Router (Layer 3): Routes packets between different networks/subnets using IP addresses and routing tables; performs path selection and packet forwarding.
- Modem (Layer 1/2): Modulates digital signals to analog for transmission over phone lines/cable and demodulates on reception — used by ISPs to connect homes to the network.
- Gateway (Multi-layer / Application): Translates between different protocols or architectures (e.g., email gateway, VoIP gateway). Often operates at higher OSI layers.
- Wireless Access Point (AP) (Layer 2/1): Provides wireless clients access to a wired network; manages RF, authentication (often works with a controller).
- Firewall (Layer 3–7): Enforces security policies by filtering traffic based on IP/port/application rules; can be packet-filtering, stateful, or application firewall.
- Proxy Server (Application Layer): Intermediary for client requests, used for caching, filtering and logging.
- Load Balancer (Layer 4–7): Distributes incoming traffic across multiple servers to improve availability and performance.
Key Properties to Compare
- OSI Layer(s) of operation (intelligence increases at higher layers)
- Forwarding decision basis: electrical signal, MAC, IP, application data
- Domain control: collision domains vs broadcast domains
- Typical use: home (modem+router+AP) vs enterprise (core switches, routers, firewalls)
How They Work Together (simple flow)
In a typical home setup: NIC (PC) ↔ AP/switch ↔ router (NAT & DHCP) ↔ modem ↔ ISP network. In enterprise: hosts → access switches → distribution switches → core routers → Internet/DMZ, with firewalls and load balancers protecting services.
Practical Notes
- Switches divide collision domains; routers divide broadcast domains (subnets).
- Choose devices by scale and features: unmanaged vs managed switches, consumer vs enterprise firewalls/routers.
- Performance metrics: throughput, latency, port density, supported protocols (VLANs, QoS).
- Home: A modem connects your ISP line to your home router; the router provides NAT/DHCP and forwards packets; a Wi‑Fi access point (often built into the router) connects phones and laptops.
- Office LAN: PCs connect to access switches; switches forward frames to a distribution switch; a router connects the LAN to the Internet; a firewall inspects traffic and blocks malicious packets.
- Internet edge: An ISP uses high-performance routers to forward traffic between customer networks and backbone links; load balancers distribute incoming web requests across multiple web servers.
- \[Transmission delay = L / R (where L = packet length in bits\]\[R = link bandwidth in bits/sec)\]
- \[Propagation delay = d / s (where d = distance\]\[s = signal propagation speed ≈ 2×10^8 m/s in copper/fiber)\]
- \[Bandwidth-Delay Product = bandwidth (bits/sec) × round-trip time (sec) — amount of data 'in flight' on a link\]
- \[Total end-to-end delay ≈ processing delay + queueing delay + transmission delay + propagation delay\]
Transmission Media
Transmission Media
Key Point: Shannon–Hartley Capacity: C = B × log2(1 + S/N) — C is channel capacity (bits/s), B is bandwidth (Hz), S/N is signal-to-noise power ratio (linear).
What is Transmission Media?
Transmission media are the physical pathways that connect computers, devices and networks so that data can be transmitted from one point to another. They determine the speed, distance, cost and reliability of communications.
Classification
- Guided (Wired) Media – Signals are confined to a physical conductor or optical fibre.
- Twisted Pair Cable (UTP/STP): Pairs of insulated copper wires twisted to reduce interference. Used for telephone lines, Ethernet (LAN). Pros: cheap, easy to install. Cons: limited bandwidth, susceptible to EMI.
- Coaxial Cable: Inner conductor, insulating layer, metallic shield and outer jacket. Used for cable TV, broadband. Pros: better shielding and bandwidth than twisted pair. Cons: bulkier, more expensive than UTP.
- Optical Fibre: Glass or plastic fibres that transmit light. Types: single-mode (long distance) and multi-mode (shorter distance). Pros: very high bandwidth, low attenuation, immune to EMI, secure. Cons: higher installation cost and fragility.
- Unguided (Wireless) Media – Signals propagate through the air or space without a physical conductor.
- Radio Waves (including Wi-Fi, broadcast): Low-to-medium frequency, long range, penetrates obstacles depending on frequency.
- Microwave (point-to-point, satellite uplinks): Higher frequency, line-of-sight, used for long-distance terrestrial links and satellite communication.
- Infrared (IR): Short-range, line-of-sight, used for remote controls and short-range device links.
- Bluetooth: Short-range (≈10 m), low-power wireless for peripheral devices and PANs.
- Satellite: Uses microwave frequencies to cover very large areas and provide global links.
Key Characteristics & Selection Criteria
- Bandwidth (capacity): How much data can be carried per second. Fibre > coax > twisted pair > wireless (varies).
- Attenuation: Signal loss with distance; optical fibre has very low attenuation.
- Noise and Interference: Electromagnetic interference (EMI) affects copper cables more than fibre; wireless is affected by interference and fading.
- Latency: Time delay in transmission — affected by medium and distance (satellite introduces high latency).
- Cost & Installation: UTP is cheapest; fibre and satellite are costlier to install but may offer better long-term performance.
- Security: Guided media (especially fibre) are harder to tap; wireless is easier to intercept unless encrypted.
Typical Uses (CBSE perspective)
- UTP: LANs, telephones, office networks (Ethernet).
- Coaxial: Cable TV, broadband access.
- Optical Fibre: Internet backbone, long-distance telecom, data centres.
- Wi-Fi: Home/office wireless networking.
- Bluetooth: Peripheral device connectivity (headphones, mice).
- Satellite/Microwave: Remote area connectivity, TV broadcasting, global links.
Summary: Choice of transmission media depends on required bandwidth, distance, cost, environment and security. Fibre optics provide the highest performance for modern high-speed networks, while copper and wireless solutions remain common for local and mobile connectivity.
- Home Ethernet using UTP (Cat5e/Cat6) cables to connect computers to a router for wired LAN.
- Cable TV and cable internet delivered over coaxial cable to households.
- Internet backbone connections and long-distance links using optical fibre between cities and data centres.
- Wi‑Fi (radio waves) providing wireless internet access in homes, schools and cafes.
- Bluetooth connecting a phone to wireless headphones or a wireless keyboard.
- Satellite TV and satellite internet providing service to remote regions where terrestrial cables are unavailable.
- \[Shannon–Hartley Capacity: C = B × log2(1 + S/N) — C is channel capacity (bits/s)\]\[B is bandwidth (Hz)\]\[S/N is signal-to-noise power ratio (linear).\]
- \[Wavelength: λ = v / f — λ (meters) is wavelength\]\[v is wave speed (≈3×10^8 m/s in vacuum/air)\]\[f is frequency (Hz).\]
- \[Decibel (power ratio): dB = 10 × log10(P2 / P1) — to express power gain or loss in decibels.\]
- \[Attenuation (exponential model): P(d) = P0 × e^(−αd) — P(d) is power at distance d\]\[P0 is initial power, α is attenuation constant (1/length).\]
- \[SNR in dB: SNR(dB) = 10 × log10(SNR_linear) — convert linear SNR to decibels.\]
Data Transmission Modes and Switching
Data Transmission Modes and Switching
Key Point: Transmission time (Tx) = Message size (L in bits) / Link bandwidth (R in bits/sec).
Overview: Data transmission modes describe how data flows between two devices on a communication link. Switching techniques describe how a network forwards data from source to destination across intermediate nodes. Both are fundamental to understanding how networks carry information.
1. Transmission (Direction) Modes
- Simplex: Data flows in only one direction; the sender always transmits and the receiver only receives. Example: broadcast TV. Key point: no return channel.
- Half-duplex: Data flows in both directions but not at the same time. Devices take turns transmitting. Example: walkie-talkies, CB radios. Key point: shared medium, collision/turn-taking control required.
- Full-duplex (Duplex): Data flows simultaneously in both directions. Example: telephone calls, modern Ethernet switches, mobile phones. Key point: requires separate channels or echo cancellation.
2. Data Transfer Types
- Serial vs Parallel
- Serial: Bits sent sequentially over one channel (or pair). Used for long-distance links (USB, Ethernet, fiber).
- Parallel: Multiple bits sent simultaneously over multiple wires. Used for short distances (older printer ports, memory buses). Parallel wires can suffer from skew at higher speeds.
- Asynchronous vs Synchronous
- Asynchronous: Data sent character-by-character with start/stop bits; receiver uses these to frame each character (example: keyboard serial). Good for irregular traffic.
- Synchronous: Data sent as a continuous stream with shared clocking; framing uses special sync patterns (example: streaming audio/video, high-speed backbone links). Efficient for large, steady transfers.
3. Switching Techniques
- Circuit Switching
- A dedicated path (circuit) is established between sender and receiver before data transfer and released after the session (example: traditional PSTN telephone networks).
- Characteristics: setup delay, constant bandwidth reserved, low jitter during call, inefficient resource use if idle.
- Message Switching
- Entire message is sent to an intermediate node, stored, then forwarded to the next node (store-and-forward). No dedicated path; variable delay. Example: early telegraph/telex and some store-and-forward email relays.
- Characteristics: no need for continuous path, can handle variable-length messages, can cause long delays and requires storage at nodes.
- Packet Switching
- Messages are divided into smaller packets. Each packet is routed independently; nodes perform store-and-forward per packet. Example: the Internet (IP packets).
- Characteristics: efficient resource sharing, better for bursty traffic, variable latency and possible reordering of packets. Two approaches: connectionless (datagram) and connection-oriented (virtual circuit).
When to use which: Circuit switching suits continuous, real-time streams with reserved bandwidth (e.g., voice calls in older networks). Packet switching is preferred for data networks with bursty traffic and efficient multiplexing (e.g., web, email, streaming over IP).
Important practical notes:
- Modern networks mix concepts: e.g., mobile networks use virtual circuits internally but carry IP packets; Ethernet switched links provide full-duplex serial communication.
- Choice between serial/parallel and async/sync depends on distance, speed, and traffic pattern.
- Simplex: TV broadcast (one-way). Keyboard to CPU (keyboard sends keystrokes to computer only).
- Half-duplex: Walkie-talkie — one speaks while others listen, then switch roles.
- Full-duplex: Telephone or mobile phone calls where both parties speak simultaneously.
- Serial vs Parallel: USB (serial) for peripherals; old parallel printer port (parallel) for short-distance printer connection.
- Asynchronous vs Synchronous: Asynchronous serial terminal input (start/stop bits) vs synchronous streaming between routers using a shared clocking protocol.
- Circuit switching: Traditional PSTN telephone network establishes a dedicated circuit for a call.
- \[Transmission time (Tx) = Message size (L in bits) / Link bandwidth (R in bits/sec).\]
- \[Propagation delay (Td) = Distance (d in meters) / Propagation speed (s in meters/sec, ~2x10^8 m/s in copper/fiber).\]
- \[End-to-end latency ≈ Transmission delay + Propagation delay + Queuing delay + Processing delay.\]
- \[Bandwidth–delay product = R * Td (represents number of bits 'in flight').\]
- \[Baud and bit rate: bit rate = baud rate * bits_per_symbol. (If each symbol encodes multiple bits\]\[bit rate > baud.)\]
- \[Stop-and-wait channel utilization (approx) U = Tx / (Tx + 2*Td)\]\[where Tx = L/R and Td = one-way propagation delay.\]
Network Models
Network Models
Key Point: Transmission delay (t_tx) = Packet size (bits) / Bandwidth (bits/s)
What are Network Models?
Network models are standardized layered frameworks that describe how data is transmitted across a network. They divide network communication into smaller, well-defined tasks (layers). Each layer provides services to the layer above and uses services of the layer below. Models ensure interoperability between different hardware, software and vendors by defining functions and protocols at each layer.
Why use models?
- Abstraction: hides lower-layer details from upper layers.
- Interoperability: standardizes protocols and interfaces.
- Modularity: allows independent development and troubleshooting.
Two main models studied in Class 12:
1. OSI (Open Systems Interconnection) Model — 7 layers
- Application (Layer 7): Interface for user applications (e.g., email client, web browser). Protocols: HTTP, SMTP, FTP.
- Presentation (6): Data translation, encryption, compression (e.g., SSL/TLS does encryption; converts formats like JPEG).
- Session (5): Manages sessions/communications (establish, maintain, terminate). Examples: RPC, NetBIOS.
- Transport (4): End-to-end delivery, segmentation, error control, flow control. Protocols: TCP (reliable), UDP (unreliable).
- Network (3): Logical addressing and routing between networks. Protocols: IP, ICMP. Responsible for packet forwarding and routing decisions.
- Data Link (2): Framing, MAC addressing, error detection/correction on a single link. Sub-layers: LLC and MAC. Protocols/tech: Ethernet, PPP, ARP.
- Physical (1): Transmission of raw bit stream over physical medium: cables, voltages, bit rates, connectors.
Key OSI concepts: encapsulation (each layer adds header/trailer), headers contain control information for corresponding layer.
2. TCP/IP (Internet) Model — 4 layers
- Application: Combines OSI Application/Presentation/Session. Protocols: HTTP, SMTP, FTP, DNS.
- Transport: TCP/UDP — segmentation, reliability (TCP), multiplexing via ports.
- Internet (Network): IP — logical addressing (IPv4/IPv6), routing, packet delivery.
- Link (Network Access/Host-to-Network): Physical + Data Link responsibilities — Ethernet, Wi-Fi, ARP.
Mapping OSI to TCP/IP: Application (OSI 5–7), Transport (OSI 4), Internet (OSI 3), Link (OSI 1–2).
Encapsulation example (sending an HTTP request):
- Application layer creates HTTP request (text).
- Transport (TCP) splits into segments, adds TCP header (source/dest ports, seq/ack).
- Network (IP) packages segments into IP packets, adds IP header (source/dest IPs).
- Data Link frames the packet, adds MAC addresses and frame check sequence.
- Physical layer transmits bits over the medium.
How models help in troubleshooting: When network issues arise, technicians identify the affected layer (e.g., no physical link → Physical layer; incorrect IP routing → Network layer; DNS resolution failure → Application layer).
Summary: Network models (OSI, TCP/IP) provide layered blueprints for designing, implementing and troubleshooting networks. They define where protocols operate and how data is packaged, routed and delivered across heterogeneous systems.
- Web browsing: Browser (Application) sends an HTTP request. TCP ensures reliable delivery (Transport), IP routes packets across the internet (Network), Ethernet/Wi‑Fi handles the local link (Data Link/Physical).
- Sending email: Mail client uses SMTP (Application). Messages are handed to TCP, addressed by IP, and transmitted over a LAN link.
- Video streaming: Application uses HTTP/RTSP; transport may use TCP for reliability or UDP for low latency. Network layer routes packets; QoS considerations at transport/network affect playback.
- VoIP call: Uses SIP (signaling at Application) and RTP over UDP (Transport) for real‑time audio. Low latency requirements make Transport/Network behavior critical.
- File transfer in LAN: FTP or SMB at Application, reliable TCP transport, fast local delivery via Ethernet (Link/Physical).
- \[Transmission delay (t_tx) = Packet size (bits) / Bandwidth (bits/s)\]
- \[Propagation delay (t_prop) = Distance (m) / Propagation speed (m/s) (e.g.\]\[speed of light in cable ≈ 2×10^8 m/s)\]
- \[End-to-end latency ≈ t_tx + t_prop + processing delay + queuing delay\]
- \[Bandwidth-delay product = Bandwidth (bits/s) × Round-trip time (s) (useful for buffer sizing)\]
- \[Throughput = Total data transferred (bits) / Transfer time (s)\]
- \[Stop-and-wait efficiency ≈ (t_tx) / (t_tx + 2×t_prop) (shows inefficiency on long-delay links)\]
Protocols and Standards
Protocols and Standards
Key Point: Bandwidth-Delay Product (bits) = Bandwidth (bits/s) × Round-Trip Time (s)
Protocols are agreed rules and procedures that two or more communicating entities follow to exchange information correctly and reliably. A protocol defines the syntax (format of data), semantics (meaning of each section of bits), and timing (when data is sent and how fast).
Standards are formal documents published by recognized bodies that specify how protocols, hardware and formats must behave so different vendors and systems interoperate. Standards ensure compatibility, safety, quality and wide adoption.
Why they are needed:
- Interoperability: devices from different vendors can communicate.
- Reliability: error detection, retransmission and ordering rules.
- Scalability: consistent addressing and routing across large networks.
- Security: agreed mechanisms (e.g., TLS) for confidentiality and integrity.
Key properties of protocols:
- Connection-oriented vs connectionless (e.g., TCP is connection-oriented; UDP is connectionless).
- Stateful vs stateless (HTTP is stateless unless session mechanisms are used).
- Layered operation: protocols operate at specific layers of a model (OSI or TCP/IP).
Common protocols by layer (examples):
- Application: HTTP/HTTPS (web), FTP (file transfer), SMTP/IMAP/POP3 (email), DNS (name resolution)
- Transport: TCP (reliable, ordered delivery), UDP (fast, unreliable), SCTP
- Network: IP (routing and addressing), ICMP (control messages), ARP (address resolution)
- Data Link / Physical: Ethernet (IEEE 802.3), Wi‑Fi (IEEE 802.11), PPP
- Security: TLS/SSL (secure channels), IPSec (secure IP)
Standards organizations: IETF (RFCs), IEEE (802.x family), ISO (OSI standards), ITU, W3C. Example standards: IEEE 802.3 specifies Ethernet; IEEE 802.11 specifies Wi‑Fi; RFCs define many Internet protocols.
How protocols work — typical tasks:
- Encapsulation: data is wrapped with headers/footers at each layer (Data → Segment → Packet → Frame → Bits).
- Addressing and routing: IP addresses, MAC addresses and routing tables deliver packets to the destination.
- Error detection and correction: parity, checksum, CRC; retransmission on error (e.g., TCP).
- Flow and congestion control: prevent sender from overwhelming receiver or network (TCP windowing, congestion algorithms).
Example protocol interaction — TCP three-way handshake:
- Client sends SYN (synchronize) with initial sequence number.
- Server replies SYN-ACK (synchronize-acknowledge).
- Client replies ACK (acknowledge). Connection established.
Error detection methods (brief):
- Parity bit — simple odd/even parity for single-bit error detection.
- Checksum — sum of bytes/words modulo a value (used in simple protocols).
- CRC (Cyclic Redundancy Check) — polynomial division method with high error-detection capability.
Importance in everyday life: Without agreed protocols and standards, web pages, email, VoIP calls, streaming video and secure transactions would not work reliably across different devices and networks.
- Web browsing: DNS resolves site name, TCP establishes a connection, HTTP/HTTPS requests and receives web pages.
- Email: SMTP is used to send mail, and IMAP/POP3 are used to retrieve mail from a server.
- Video streaming: Adaptive streaming often uses HTTP/TCP for content delivery; live VoIP calls use RTP over UDP for low latency.
- Local network: Ethernet (IEEE 802.3) frames travel over cables; Wi‑Fi (IEEE 802.11) frames travel over the air — both follow link-layer standards.
- Secure transactions: HTTPS uses TLS (a security protocol) on top of TCP to provide confidentiality and integrity for online banking.
- \[Bandwidth-Delay Product (bits) = Bandwidth (bits/s) × Round-Trip Time (s)\]
- \[Approximate throughput (for window-based flow control) ≈ Window Size (bits) / RTT (s)\]
- \[Stop-and-wait utilization U = (L / R) / (RTT + L / R)\]\[where L = packet size (bits)\]\[R = link rate (bits/s)\]\[RTT = round-trip time (s)\]
- \[Simple checksum (example) = (sum of payload bytes) mod 256\]
- \[CRC concept (high level) = remainder of (message polynomial ÷ generator polynomial)\]\[remainder appended to message\]
IP Addressing and Subnetting
IP Addressing and Subnetting
Key Point: Total addresses in a block = 2^(host_bits)
What is an IP address?
An IP (Internet Protocol) address is a 32-bit number (IPv4) used to uniquely identify a host on an IP network. It is usually written in dotted-decimal form: four octets (bytes) separated by dots, e.g. 192.168.1.10.
Binary structure and parts
An IPv4 address has 32 bits divided into a network portion and a host portion. Which bits belong to each portion depends on the subnet mask (or prefix).
Notation
- Dotted decimal: 192.168.1.10
- CIDR (prefix) notation: 192.168.1.10/24 (means the first 24 bits are network bits)
Classful addressing (historical, for understanding)
Classes defined ranges and default masks:
- Class A: 1.0.0.0 – 126.255.255.255, default mask /8 (255.0.0.0)
- Class B: 128.0.0.0 – 191.255.255.255, default mask /16 (255.255.0.0)
- Class C: 192.0.0.0 – 223.255.255.255, default mask /24 (255.255.255.0)
- Class D: 224.0.0.0 – 239.255.255.255 (multicast)
- Class E: 240.0.0.0 – 255.255.255.255 (experimental)
Private addresses
RFC 1918 reserved ranges for private networks (not routed on the public internet): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
Special addresses
- Network address: all host bits 0 (identifies the subnet)
- Broadcast address: all host bits 1 (sent to all hosts in subnet)
- Loopback: 127.0.0.1
Subnetting — why and how
Subnetting divides a larger network into smaller sub-networks (subnets). This improves management, security and reduces broadcast domains.
Subnet mask and prefix
The subnet mask is also 32 bits and shows which bits are network bits (1s) and host bits (0s). Example masks: 255.255.255.0 = /24, 255.255.255.192 = /26.
Basic steps to subnet
- Identify the original network and its prefix (for example 192.168.10.0/24).
- Decide how many subnets or how many hosts per subnet are required.
- Borrow bits from host portion to make more subnets. If you borrow s bits, new prefix = original_prefix + s.
- Number of subnets = 2^s. Number of usable hosts per subnet = 2^(host_bits) - 2 (subtract network and broadcast).
- Find subnet increments (block size) in the octet where mask changes: increment = 256 - value_of_mask_octet.
Calculating network and broadcast addresses
Network address = (IP address) AND (subnet mask)
Broadcast address = (network address) OR (invert(subnet mask)). Use bitwise operations or work in the octet with the block size.
CIDR and aggregation
Classless Inter-Domain Routing (CIDR) uses prefixes like /20 to allocate blocks of addresses without class boundaries, allowing efficient use of address space.
Example summary
If you split 192.168.10.0/24 into /26 subnets, you borrow 2 bits (24 -> 26), so you get 2^2 = 4 subnets. Host bits = 6, usable hosts per subnet = 2^6 - 2 = 62. Subnets are: 192.168.10.0/26 (hosts .1–.62, broadcast .63), 192.168.10.64/26 (hosts .65–.126, broadcast .127), 192.168.10.128/26, 192.168.10.192/26.
VLSM (Variable Length Subnet Mask)
VLSM allows using different subnet sizes on the same network to allocate addresses efficiently (useful in routing and WAN links).
Practical points for Class 12
Understand binary conversion of octets, how to apply masks, how to compute network/broadcast addresses, and how many subnets/hosts result from changing the prefix.
- Example 1 (simple subnetting): Given 192.168.10.0/24, create /26 subnets. Borrowed bits = 2, subnets = 2^2 = 4, hosts per subnet = 2^(32-26) - 2 = 62. Subnets: 192.168.10.0/26 (broadcast .63), 192.168.10.64/26, 192.168.10.128/26, 192.168.10.192/26.
- Example 2 (find network and broadcast): IP 172.16.5.46 with mask 255.255.255.240 (/28). Host bits = 4. Block size = 16 (256 - 240). Subnet ranges: 172.16.5.0/28, .16/28, .32/28, .48/28. IP 172.16.5.46 belongs to 172.16.5.32/28; usable hosts .33–.46? (note .46 is the broadcast for .32/28? actually for /28 broadcast is .47), so usable hosts are .33–.46 and broadcast is .47.
- Example 3 (home vs office): Home router uses 192.168.1.0/24; it gives addresses to devices via DHCP (e.g., 192.168.1.2–192.168.1.254). An office might subnet 10.0.0.0/8 into many /24 or /26 subnets to separate departments (HR, Finance, Guest Wi-Fi) to limit broadcasts and apply policies.
- Example 4 (ISP allocation): An ISP may allocate a customer a block 203.0.113.0/29 (8 addresses). Usable hosts = 6 (network and broadcast reserved). Small business uses /29 for a few public IPs.
- \[Total addresses in a block = 2^(host_bits)\]
- \[Usable hosts per subnet = 2^(host_bits) - 2 (subtract network and broadcast\]\[exception: /31 and /32 special cases)\]
- \[Number of new subnets when borrowing s bits = 2^s\]
- \[New prefix = original_prefix + s\]
- \[Block size (in the octet where mask changes) = 256 - value_of_mask_octet\]
- \[Subnet mask from prefix /n: set n ones then (32-n) zeros\]\[convert each 8-bit group to decimal\]\[Example /26 -> 11111111.11111111.11111111.11000000 -> 255.255.255.192\]
Routing and Switching
Routing and Switching
Key Point: Transmission delay = L / R (L = packet length in bits, R = link bandwidth in bits/s)
Overview
Routing and switching are two complementary functions used to move data across networks. Switching is the process inside a local network (LAN) that forwards frames between devices. Routing is the process used between networks (WAN or internetworks) to determine optimal paths and forward packets from source to destination across multiple networks.
Switching (Layer 2 and below)
- Definition: Forwarding of frames within a network segment based primarily on MAC addresses (Layer 2) or circuit connections (layer 1).
- Types of switching:
- Circuit switching: A dedicated path is established for the duration of a session (example: traditional telephone network).
- Packet switching: Data is split into packets which are routed independently; each packet may follow a different path (example: the Internet).
- Message switching: Whole messages are sent and stored at intermediate nodes and forwarded when possible (store-and-forward).
- Ethernet switch behavior:
- MAC learning: switch builds a MAC address table by observing source addresses and associates them with ports.
- Forwarding methods: store-and-forward (checks CRC then forwards), cut-through (starts forwarding once destination MAC seen), fragment-free (checks first 64 bytes to avoid collisions).
- Switch vs Hub: Switch forwards to specific port (reduces collisions), hub repeats to all ports.
Routing (Layer 3)
- Definition: Selecting paths in a network along which to send packets from source to destination using IP addresses and routing tables.
- Routing functions:
- Build and maintain routing tables.
- Forward packets to next-hop based on destination IP and route lookup.
- Static vs Dynamic routing:
- Static: Admin configures fixed routes. Simple and predictable but not adaptive.
- Dynamic: Routers exchange routing information using protocols (RIP, OSPF, BGP) to adapt to topology changes.
- Routing metrics: Hop count, bandwidth, delay, reliability, cost, load. Routing protocols use metrics to choose best path.
- Routing algorithms (brief):
- Distance Vector (e.g., RIP): Each router maintains a vector of distances to all destinations; routers iteratively exchange vectors with neighbors (uses Bellman-Ford principle).
- Link State (e.g., OSPF): Each router builds complete map of network topology by flooding link-state advertisements and computes shortest paths with Dijkstra's algorithm.
- Forwarding vs Routing: Routing decides the path (control plane). Forwarding moves packets to the next hop using the routing table (data plane).
Performance & Delays — Useful relations
Packet delivery time across a link is affected by several components:
- Transmission delay = packet length (L in bits) / link bandwidth (R in bits/s)
- Propagation delay = distance (d) / propagation speed (s)
- Processing delay = time router/switch takes to examine header (variable)
- Queuing delay = time packet waits in queue (depends on congestion)
- End-to-end delay = sum over all links of (transmission + propagation + processing + queuing)
Practical notes
Routers connect different IP networks and perform NAT, filtering, and route aggregation. Switches segment collision domains, provide VLANs, and operate at wire speed for local traffic. In modern networks, devices can be combined (layer 3 switches).
Summary
Switching handles local delivery of frames; routing determines inter-network paths. Packet switching and routing are fundamental to how the Internet moves data; choice of switching/routing methods affects latency, reliability and bandwidth usage.
- Circuit switching: Traditional landline phone call reserves a dedicated end-to-end channel for the call duration.
- Packet switching: Browsing a website — the web page is split into packets that travel independently through routers and are reassembled at the client.
- Ethernet switching in LAN: A campus switch learns MAC addresses and forwards frames only to the correct port, reducing unnecessary traffic.
- Home router: Connects multiple devices (LAN) to the ISP (WAN), uses NAT and routing table to forward outbound packets and route inbound responses.
- VoIP: Uses packet switching with low-delay requirements; often uses QoS rules on routers and switches to prioritize voice packets.
- \[Transmission delay = L / R (L = packet length in bits\]\[R = link bandwidth in bits/s)\]
- \[Propagation delay = d / s (d = link length\]\[s = propagation speed ≈ 2x10^8 m/s in copper/fiber)\]
- \[End-to-end delay (approx) = Σ(transmission_delay + propagation_delay + processing_delay + queuing_delay) over all hops\]
- \[Path cost = Σ(cost_i) for links i on the path (used by many routing protocols to compare routes)\]
- \[Bellman-Ford (distance vector) update: D_x(y) = min over neighbors v { c(x,v) + D_v(y) } (distance from x to y)\]
- \[Hop-count minimization: choose path that minimizes number of hops (no arithmetic formula beyond counting hops)\]
Network Services and Applications
Network Services and Applications
Key Point: Data transfer time = File size (bits) / Bandwidth (bits per second). Example: 100 MB file = 800 Mb; at 20 Mbps → time = 800 / 20 = 40 seconds.
Overview
Network services and applications are the software services and end-user programs that run on top of computer networks to provide communication, resource sharing and information access. These operate largely at the Application Layer of the TCP/IP model and use transport (TCP/UDP) and lower-layer services to move data between hosts.
Major categories
- Web services (HTTP/HTTPS): Accessing web pages and REST/APIs. Browser (client) sends an HTTP request to a server; the server responds with status codes (200 OK, 404 Not Found, 301 Moved) and content. HTTPS adds TLS/SSL for encryption and authentication.
- Email (SMTP, POP3, IMAP): Sending uses SMTP between Mail User Agent (MUA) and Mail Transfer Agent (MTA). Receiving can use POP3 (download & optionally delete) or IMAP (server-side folder management). Components: MUA, MTA, MDA (Mail Delivery Agent).
- File transfer (FTP, SFTP): Upload/download of files. FTP uses control (port 21) and data connections (active vs passive modes). SFTP/FTPS provide secure file transfer over SSH/TLS.
- Remote login/management (Telnet, SSH, RDP): Remote shell and desktop access. SSH is encrypted and preferred for secure administration; Telnet is unencrypted (deprecated for secure use).
- Name resolution (DNS): Translates domain names to IP addresses via iterative/recursive queries and caching. DNS is critical for virtually all internet services.
- Dynamic addressing (DHCP): Automatically assigns IP addresses and network configuration (gateway, DNS server) to hosts on a network for easy management.
- Real-time communication (VoIP, Video conferencing): Voice and video over IP using RTP/RTCP on top of UDP (often with SIP for session control). Requires low latency, jitter control and sufficient bandwidth.
- Streaming media: Audio/video delivered via progressive download or adaptive streaming (HLS, DASH). Content Delivery Networks (CDNs) cache content near users to reduce latency and load.
- Instant messaging / presence: Text, file sharing and presence info using XMPP, proprietary protocols (WhatsApp, Telegram). Often use persistent TCP/WebSocket connections and encryption.
- Network management & security services: SNMP for management, DHCP for addressing, firewalls and proxies for security, NAT for address translation, SSL/TLS for encrypted channels, VPN for secure remote networks.
How they work — key principles
- Client-Server model: Clients request resources; servers respond and host resources (websites, mailboxes, files).
- Peer-to-Peer (P2P): End systems act both as client and server (file-sharing, some VoIP architectures).
- Protocols: Define message formats, request/response flows, error handling and security (examples: HTTP, SMTP, DNS, FTP, SIP, RTP).
- Performance concerns: Bandwidth, latency, jitter, packet loss — different applications have different tolerances (e.g., VoIP requires low latency; bulk file transfer tolerates higher latency but benefits from high bandwidth).
Security and reliability
Applications often use TLS/SSL for confidentiality and integrity (HTTPS, SMTPS, IMAPS). Firewalls, proxies, intrusion detection/prevention, and authentication/authorization mechanisms protect services. Redundancy (multiple servers, load balancers, CDNs) improves availability.
Common real-life scenarios
Browsing websites, sending/receiving email, using cloud storage (Google Drive, OneDrive), video calls (Zoom/Meet), streaming (Netflix/YouTube), remote server administration (SSH), online gaming, IoT device telemetry and firmware updates.
- Web browsing: User enters https://www.example.com, browser makes DNS lookup, TCP connection, TLS handshake, then HTTP GET; server responds with HTML/CSS/JS. Example: visiting a bank website uses HTTPS for encryption.
- Email exchange: Alice's MUA submits mail to her SMTP server (MTA). MTA routes it across the internet to Bob's MTA which delivers to Bob's mailbox (MDA). Bob reads via IMAP from his MUA. Example: Sending mail via Gmail (SMTP) and reading via Outlook (IMAP).
- File transfer: A web developer uploads website files using SFTP to a remote web host (secure file transfer over SSH).
- Remote administration: A sysadmin connects using SSH to update packages on a Linux server securely instead of using Telnet.
- Video conferencing: Participants connect via a service (Zoom/Google Meet) that uses SIP-like signaling and RTP for media streams; low latency and jitter buffering are crucial.
- Streaming: Netflix uses adaptive bitrate streaming and CDNs to deliver video; the client adjusts quality based on measured bandwidth.
- \[Data transfer time = File size (bits) / Bandwidth (bits per second)\]\[Example: 100 MB file = 800 Mb\]\[at 20 Mbps → time = 800 / 20 = 40 seconds.\]
- \[Throughput = Useful data transferred / Total transfer time (bits/sec).\]
- \[Propagation delay = Distance (meters) / Propagation speed (usually ~2×10^8 m/s in cable or ~3×10^8 m/s in vacuum).\]
- \[Bandwidth–Delay Product = Bandwidth (bits/sec) × Round-Trip Time (sec)\]\[It indicates amount of data "in flight" the network can hold.\]
- \[Bandwidth conversions: 1 byte = 8 bits\]\[1 KB ≈ 1024 bytes, 1 Mb = 10^6 bits (often marketing uses decimal Mbps).\]
- \[Latency impact on transactions ≈ (RTT × number_of_round_trips) + transmission_time\]\[Example: HTTPS often needs multiple round-trips (TCP + TLS + HTTP).\]
Sockets, Ports and Client-Server Communication
Sockets, Ports and Client-Server Communication
Key Point: Port range: 0..65535 (total 65536 ports)
Overview
A socket is a software endpoint used for network communication. A port is a numerical identifier on a host that lets the operating system direct incoming network packets to the correct application. Client-server communication uses sockets and ports so clients can connect to servers, exchange data, and terminate connections.
What is a socket?
A socket is defined by an IP address, a port number and a protocol (TCP or UDP). It provides the interface for sending and receiving data over a network. For TCP, a socket represents an end of a reliable, ordered byte stream. For UDP, a socket sends and receives independent datagrams.
Ports and their ranges
- Port numbers range from 0 to 65535.
- Well-known ports: 0–1023 (HTTP 80, HTTPS 443, SSH 22, SMTP 25).
- Registered ports: 1024–49151 (used by applications registered with IANA).
- Dynamic / private (ephemeral) ports: 49152–65535 (client-side ephemeral ports).
How client-server communication works
Typical steps (TCP):
- Server: create a socket, bind it to a local IP and port, listen for connections.
- Client: create a socket and connect to the server's IP and port.
- Server: accept the connection (returns a new socket for that client), then both sides exchange data using send/receive calls.
- Either side closes the connection when done.
Socket API sequence (common calls)
Server side (conceptual):
socket()
bind(address, port)
listen(backlog)
while (true):
client_socket = accept()
recv/send on client_socket
close(client_socket)
close(server_socket)
Client side (conceptual):
socket() connect(server_address, server_port) send/recv close(socket)
TCP vs UDP
- TCP: connection-oriented, reliable, ordered, uses a three-way handshake (SYN, SYN-ACK, ACK) to establish a connection and a defined teardown (FIN/ACK). Used for HTTP, SSH, SMTP.
- UDP: connectionless, low overhead, no guarantee of delivery or order. Used for DNS queries, streaming, VoIP, real-time games.
Identifying a connection
A TCP connection is uniquely identified by the 4-tuple (source IP, source port, destination IP, destination port). Including protocol (TCP/UDP) gives the 5-tuple used in network tools and firewalls.
Multiplexing and multiple clients
A server listens on one well-known port but can handle many clients: accept() returns a new socket per client connection (different source ports), letting the server maintain multiple simultaneous sessions.
Security and firewalls
Firewalls and NATs inspect port numbers to allow or block traffic. Servers must bind to ports permitted by the OS and firewall rules; clients usually use ephemeral ports assigned by the OS.
Common pitfalls & best practices
- Remember to close sockets to free resources.
- Use TLS/SSL for sensitive data even if using TCP.
- Be aware of port conflicts—only one process can bind to a port on a given IP:port pair.
- Handle partial reads/writes with TCP streams (loops until all bytes sent/received).
- Web browsing: Browser (client) connects to web server on port 80 (HTTP) or 443 (HTTPS) using TCP. Client socket uses an ephemeral source port; server listens on port 80/443 and accepts connections.
- DNS query: A resolver uses UDP to send a query to DNS server at port 53; responses are datagrams, no connection established.
- SSH remote login: Client connects to SSH server on TCP port 22. TCP ensures reliability; SSH runs over this secure channel.
- Online multiplayer game: Game client sends and receives frequent small updates over UDP sockets to minimize latency; server listens on a fixed port and tracks players by (IP, port) pairs.
- Email delivery: Mail Transfer Agents use SMTP on TCP port 25 to establish a connection and transfer messages reliably.
- \[Port range: 0..65535 (total 65536 ports)\]
- \[Connection identifier (4-tuple): (sourceIP\]\[sourcePort\]\[destIP\]\[destPort)\]\[Including protocol gives 5-tuple.\]
- \[Throughput = Total data transferred / Transfer time (useful when measuring socket performance).\]
- \[Round-Trip Time (RTT) ≈ transmission delay + propagation delay + processing delay + queuing delay (approximate decomposition).\]
- \[Maximum simultaneous listening sockets on one IP:port pair = 1 (but server can accept many client sockets via accept()).\]
Wireless Networking and Mobile Communication
Wireless Networking and Mobile Communication
Key Point: Wavelength: λ = c / f (where c ≈ 3×10^8 m/s, f in Hz).
Overview
Wireless networking and mobile communication enable devices to exchange data without physical cables using radio waves or infrared. Wireless networks can be short-range (PAN), local (WLAN/Wi‑Fi), metropolitan (WiMAX), or wide-area (cellular and satellite). Mobile communication deals with supporting nodes that move while maintaining connectivity (handover, roaming).
Key components
- Mobile Station (MS) — the user device (phone, tablet, laptop).
- Base Station / Access Point (BS/AP) — radio node that provides wireless coverage for a cell or WLAN.
- Base Station Controller / Controller — manages multiple base stations.
- Mobile Switching Centre (MSC) / Core Network — routes calls/data and interacts with databases (HLR, VLR).
- Home Location Register (HLR) & Visitor Location Register (VLR) — databases to track subscriber profiles and location.
Types of wireless networks
- PAN (Bluetooth, ZigBee) — short range (~1–100 m) for peripherals and sensors.
- WLAN (Wi‑Fi, IEEE 802.11 family) — local area wireless for homes, offices, hotspots.
- Cellular networks (1G → 5G) — wide-area mobile coverage organized into cells served by base stations.
- WiMAX / LTE — metropolitan and broadband mobile data technologies.
- Satellite — global coverage useful where terrestrial infrastructure is absent.
Wireless LAN (Wi‑Fi) essentials
- Modes: Infrastructure (clients ↔ AP ↔ wired network) and Ad‑hoc (peer‑to‑peer).
- Access method: CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance).
- Security: WEP (obsolete), WPA/WPA2/WPA3 — encryption & authentication protocols.
- SSID identifies the network; channels/frequencies (2.4 GHz, 5 GHz, 6 GHz) affect interference and bandwidth.
Cellular systems and mobility
- Cells: geographic areas served by a base station; frequency reuse allows capacity scaling.
- Handover (handoff): transfer of an active connection from one base station to another as a user moves. Types: hard (break before make) and soft (make before break).
- Roaming: allowing a subscriber to use services outside the home network via inter‑operator agreements.
- Generations: 1G (analog voice) → 2G (digital voice, SMS) → 3G (mobile data) → 4G/LTE (IP-based high-speed data) → 5G (very high throughput, low latency, massive IoT).
Radio propagation and performance factors
- Path loss: signal power decreases with distance and obstacles (free‑space loss, shadowing, multipath fading).
- Interference and noise reduce effective data rates; techniques like OFDM and MIMO mitigate these effects.
- Throughput vs latency: capacity (how much data per second) and delay (time to deliver a packet) are key QoS metrics.
Protocols and technologies
- Bluetooth: short range, pairing for audio and peripherals.
- NFC: very short range for contactless payments.
- Mobile IP / cellular signaling: manage mobility, authentication, billing.
- LTE and 5G use advanced radio techniques (OFDMA, MIMO, carrier aggregation) to increase spectral efficiency.
Practical considerations
- Site planning: cell placement, antenna height, and power affect coverage and capacity.
- Security: always secure Wi‑Fi with WPA2/WPA3, use VPN on public networks, keep firmware updated.
- Power and battery: wireless radios consume power—important for mobile device design.
Summary
Wireless networking provides flexible connectivity across scales from personal devices to global coverage. Mobile communication adds mechanisms to maintain service while users move (handover, roaming) and requires specialized infrastructure (cells, MSC, HLR). Understanding radio behavior, protocols, and security is essential for reliable wireless services.
- Home Wi‑Fi: A wireless router (AP) provides internet access to laptops, phones, and smart TVs using IEEE 802.11 standards. Devices connect to the SSID and obtain IP addresses from the router’s DHCP server.
- Bluetooth headphones: A smartphone connects to wireless earphones in a PAN using Bluetooth pairing; short range (≈10 m) and low power.
- Mobile call handover: While driving, a phone moves from one cell to another; the network performs a handover so the call continues without dropping.
- Public hotspot: A café offers Wi‑Fi (open or password protected); many users share the same AP and available bandwidth.
- Contactless payment: NFC in a phone communicates with a payment terminal at very short range (<10 cm) for secure transactions.
- Cellular data (LTE/5G): Streaming video on a phone uses LTE or 5G networks that provide high data rates and low latency compared to earlier 3G systems.
- \[Wavelength: λ = c / f (where c ≈ 3×10^8 m/s\]\[f in Hz).\]
- \[Free‑space path loss (dB): FSPL(dB) = 20·log10(d) + 20·log10(f) + 32.44 (d in km\]\[f in MHz).\]
- \[Received power (dB): Pr(dBm) = Pt(dBm) + Gt(dBi) + Gr(dBi) − Lp(dB) − other_losses(dB).\]
- \[Shannon capacity: C = B · log2(1 + SNR) (C in bits/s\]\[B bandwidth in Hz\]\[SNR linear).\]
- \[Path‑loss power relation (simplified): Pr ∝ Pt · (1 / d^n) (n = path loss exponent\]\[typically 2–4).\]
Network Security
Network Security
Key Point: Number of possible symmetric keys of length k bits: 2^k (e.g., for k=128, possible keys = 2^128).
What is Network Security?
Network security is the set of policies, practices and technologies used to protect computer networks and the data transmitted over them from unauthorized access, misuse, modification or denial of service. Its main goals are confidentiality, integrity and availability (the CIA triad).
Core objectives (CIA triad)
- Confidentiality — ensure that only authorized users can read data (e.g., encryption).
- Integrity — ensure that data is not altered or tampered with (e.g., hashes, digital signatures).
- Availability — ensure services and data are available when needed (e.g., protection against DoS attacks).
Types of threats
- Passive attacks: eavesdropping, traffic analysis (attacker listens but does not alter traffic).
- Active attacks: modification of messages, replay attacks, man-in-the-middle (MITM), spoofing, session hijacking.
- Malware: viruses, worms, trojans, ransomware that compromise hosts and networks.
- Denial of Service (DoS/DDoS): overload a service so legitimate users cannot access it.
- Phishing & social engineering: trick users into revealing credentials or installing malware.
Basic security mechanisms
- Encryption: symmetric (same key for encrypt/decrypt; fast) and asymmetric (public/private keys; used for secure key exchange and signatures).
- Authentication: verifying identity using passwords, certificates, biometrics, or two‑factor authentication (2FA).
- Integrity checks: cryptographic hash functions (e.g., SHA family) and digital signatures to detect tampering.
- Access control: firewalls, routers, and ACLs that limit which users or IPs access network resources.
- Secure protocols: TLS/SSL for web security (HTTPS), SSH for secure remote login, IPsec for secure IP-layer communication, WPA2/WPA3 for Wi‑Fi security.
- Monitoring & detection: Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS) to detect and respond to attacks.
- Network segmentation and DMZ: separate parts of the network (e.g., public web servers in a DMZ) to limit damage from breaches.
- Backup and patch management: regular backups and timely software updates reduce vulnerability and speed recovery.
Example: How TLS (HTTPS) protects web traffic
- Client and server negotiate cipher suite and exchange keys (using asymmetric cryptography) to establish a secure session key.
- Once keys are exchanged, symmetric encryption protects confidentiality and MACs/hashes ensure integrity for subsequent data.
- Certificates (signed by Certificate Authorities) authenticate the server to the client.
Best practices for network security (Class 12 level)
- Use strong, unique passwords and enable two-factor authentication where possible.
- Keep operating systems and applications up to date with security patches.
- Enable firewalls and configure them to restrict unnecessary inbound/outbound traffic.
- Use HTTPS and secure Wi‑Fi standards (WPA2/WPA3) for wireless networks.
- Educate users about phishing and social engineering risks.
- Regularly back up important data and test restore procedures.
For exam-level understanding, focus on the goals (CIA), common attacks, basic countermeasures (encryption, authentication, firewalls, VPN/TLS), and simple examples like HTTPS and Wi‑Fi security.
- HTTPS protects data between your browser and a website using TLS — when you see the padlock icon, the connection is encrypted and the server is authenticated.
- A home router firewall blocks unsolicited incoming traffic; port forwarding is required to allow specific services through the firewall.
- VPN (Virtual Private Network) creates an encrypted tunnel between a remote user and the corporate network, protecting data over an untrusted internet connection.
- WPA2/WPA3 encrypt Wi‑Fi traffic so a neighbour cannot eavesdrop on your wireless communications.
- Phishing: an attacker sends a fake email that looks like a bank request to trick a user into revealing credentials — prevented by user awareness and email filtering.
- DDoS: an attacker uses many compromised devices (botnet) to flood a server with traffic, making a web service unavailable — mitigated by traffic filtering and rate limiting.
- \[Number of possible symmetric keys of length k bits: 2^k (e.g.\]\[for k=128\]\[possible keys = 2^128).\]
- \[Estimated brute-force time (seconds) = 2^k / R\]\[where k = key length in bits and R = attempts per second (shows exponential growth of security with key length).\]
- \[RSA key fundamentals: n = p * q (two large primes)\]\[φ(n) = (p−1)(q−1)\]\[choose e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1\]\[find d such that e * d ≡ 1 (mod φ(n))\]\[Encryption: c ≡ m^e (mod n)\]\[Decryption: m ≡ c^d (mod n).\]
- \[Diffie–Hellman shared key: given prime p and base g\]\[A sends g^a mod p\]\[B sends g^b mod p\]\[shared key = (g^b)^a mod p = (g^a)^b mod p = g^{ab} mod p.\]
- \[Hash property (key idea): collision resistance means it is computationally infeasible to find x ≠ y such that H(x) = H(y)\]\[no simple algebraic formula but important for integrity checks.\]
Performance and QoS
Performance and QoS
Key Point: Throughput = (Total data successfully delivered) / (Time interval) (e.g., bits per second)
Performance and QoS (Quality of Service) in computer networks describe how well a network carries data and how reliably it meets the needs of different applications. Performance is measured by numeric metrics such as bandwidth, throughput, delay and packet loss. QoS is a set of techniques and policies that control and guarantee certain performance levels for traffic classes (for example, voice, video, or file transfer).
Key performance metrics
- Bandwidth (Capacity): The maximum data rate a link can carry, typically in bits per second (bps).
- Throughput: The actual rate at which data is successfully delivered across the network (bps). Throughput ≤ bandwidth.
- Delay (Latency): Time taken for a packet to travel from source to destination. Components include:
- Transmission delay = packet size / link bandwidth
- Propagation delay = distance / propagation speed (speed of signal in medium)
- Processing delay = time for routers/switches to examine packet headers
- Queuing delay = time a packet waits in queue at a router (variable, depends on congestion)
- Jitter: Variation in packet delay; important for real-time apps such as VoIP and video conferencing.
- Packet loss: Fraction or rate of packets dropped due to errors or congestion.
- Availability and Reliability: Percent of time network services are up; reliability often measured with MTBF/MTTR.
Why QoS matters
- Different applications have different needs: voice/video need low delay and low jitter; file transfer needs high throughput but can tolerate delay.
- QoS mechanisms prioritize, shape, or reserve resources so critical traffic gets required performance even when the network is congested.
Common QoS techniques
- Classification and marking: Identify traffic (e.g., voice, video, best-effort) and mark packets for treatment.
- Prioritization: Give high-priority queues to delay-sensitive traffic.
- Traffic shaping and policing: Smooth bursts and limit rate to agreed levels.
- Resource reservation: Reserve bandwidth for critical flows (e.g., IntServ/RSVP concepts).
- DiffServ: Simple scalable model that marks packets into classes and routers apply per-class policies.
- Congestion control: Mechanisms (often in transport layer, e.g., TCP) that reduce sending rate when loss or delay indicates congestion.
- Caching, load balancing and link aggregation: Improve perceived performance and throughput by distributing load or combining links.
Trade-offs
- Improving one metric can affect others: prioritizing voice may reduce throughput available for bulk transfer.
- Complex QoS (fine-grained reservations) is harder to scale; simpler class-based schemes sacrifice strict guarantees for scalability.
Understanding these ideas helps design and manage networks to meet users expectations for speed, responsiveness and reliability.
- Video streaming (Netflix): requires sustained throughput and low variability; adaptive bitrate streaming changes video quality to match available throughput.
- VoIP (Skype/WhatsApp calls): requires low latency and low jitter; QoS gives voice packets priority so conversation remains natural even under congestion.
- Online gaming: needs very low latency and low jitter to keep gameplay responsive; dropped or late packets cause lag.
- File download/backup: throughput-oriented; can tolerate delay but benefits from high bandwidth and reliability.
- Video conference (Zoom/Teams): needs a balance of throughput (for video quality), low latency and low jitter; QoS on corporate networks prioritizes meeting traffic.
- \[Throughput = (Total data successfully delivered) / (Time interval) (e.g.\]\[bits per second)\]
- \[Transmission delay = Packet size (bits) / Link bandwidth (bits per second)\]
- \[Propagation delay = Distance / Propagation speed (e.g.\]\[meters / meters per second)\]
- \[Round-Trip Time (RTT) = Sum of forward and return path delays (including processing and queuing)\]
- \[Bandwidth-Delay Product = Bandwidth × RTT (bits in flight\]\[useful for window sizing)\]
- \[Link utilization (ρ) = Arrival rate λ × Average packet length L / Link capacity R (often written ρ = λL/R)\]\[When ρ approaches 1\]\[queues grow and delay increases rapidly)\]
Error Detection and Correction
Error Detection and Correction
Key Point: Parity (even): parity_bit = (sum of data bits) mod 2 → choose parity bit so total 1s is even.
Overview
When digital data is transmitted or stored, noise and faults can flip one or more bits producing errors. Error detection locates the presence of errors; error correction reconstructs the original data without needing retransmission (or indicates that retransmission is needed). Techniques are used at different layers (link, transport, storage).
Types of errors
- Single-bit error: exactly one bit flipped.
- Multiple-bit error: two or more bits flipped (can be contiguous or random).
- Burst error: a sequence of consecutive bits corrupted.
Basic approaches
- Automatic Repeat reQuest (ARQ) — detection only (e.g., checksum/CRC); on detection receiver requests retransmission.
- Forward Error Correction (FEC) — send extra redundancy so receiver can correct some errors (e.g., Hamming codes, Reed–Solomon, convolutional codes).
Simple detection methods
- Parity bit: Add 1 bit so total number of 1s is even (even parity) or odd (odd parity). Detects any odd number of bit flips (1, 3, 5 ...), but fails for two-bit errors.
- Checksum: Break data into words, sum them (often modulo 2^16 or 2^32) and send one's complement. Used in IP/TCP. Detects many common errors but not all patterns.
- Cyclic Redundancy Check (CRC): Treat bit sequence as polynomial M(x), choose generator polynomial G(x). Append r zeros (r = degree of G), divide M(x)·x^r by G(x), remainder R(x) is CRC. Receiver divides received polynomial by G(x); nonzero remainder indicates error. Strong for burst errors.
CRC concept (brief)
If message bits represent polynomial M(x) and generator is G(x) of degree r, then transmitted codeword is C(x) = M(x)·x^r + R(x) where R(x) = (M(x)·x^r) mod G(x). Receiver computes C(x) mod G(x); if result ≠ 0 → error.
Error correction — Hamming code (single-bit correction)
- Hamming codes are linear block codes that can detect 2-bit errors and correct single-bit errors.
- Place parity bits at positions that are powers of two: 1, 2, 4, 8, ... Each parity bit covers positions whose binary index has that bit = 1.
- Number of parity bits r must satisfy: 2^r ≥ m + r + 1, where m = number of data bits; this ensures unique syndromes.
- At receiver, compute parity checks → form syndrome (binary number). If syndrome = 0 → no error; else syndrome value = position of the erroneous bit, which can be flipped to correct.
Hamming example (m=4)
Data bits: d1,d2,d3,d4 = 1,0,1,1 (for example). Place parity bits p1 at pos1, p2 at pos2, p3 at pos4 → positions: 1(p1),2(p2),3(d1),4(p3),5(d2),6(d3),7(d4). Compute p1,p2,p3 so covered parities are even. Transmit 7-bit codeword. Receiver recomputes parities; syndrome gives error position.
Hamming distance and capabilities
Hamming distance d between two codewords = number of bit positions in which they differ. A code with minimum distance d_min can detect up to (d_min − 1) bit errors and can correct up to floor((d_min − 1)/2) bit errors.
When to use which method
- Low-latency links with retransmission allowed: use CRC (detection) + ARQ.
- Real-time or one-way links (e.g., satellite, streaming, memory): use FEC (Hamming, Reed–Solomon).
- Storage (hard disks, RAM): ECC memory uses Hamming-like codes for single-bit correction and multi-bit detection.
Summary
Error detection finds corrupted data (parity, checksum, CRC). Error correction reconstructs original bits (Hamming, Reed–Solomon). CRC is powerful for detecting burst errors; Hamming is simple for single-bit correction. Choice depends on error characteristics, latency and overhead.
- File download over the internet: TCP uses checksums to detect errors and ARQ (retransmission) to get correct data. When a packet checksum fails, the packet is requested again.
- Wi‑Fi and cellular links: use CRC at link layer to detect frames corrupted by noise; higher-level protocols request retransmission or use FEC for streaming.
- QR codes and CDs/DVDs: use Reed–Solomon codes (FEC) so scanners/players can correct streaks or scratches without retransmission.
- ECC memory in servers: Hamming or extended Hamming codes correct single-bit errors and detect double-bit errors in RAM to prevent crashes.
- Barcodes and data storage: CRC-32 commonly used to detect accidental changes in blocks of data (e.g., ZIP file integrity).
- \[Parity (even): parity_bit = (sum of data bits) mod 2 → choose parity bit so total 1s is even.\]
- \[Hamming parity bits requirement: 2^r ≥ m + r + 1 (m = data bits\]\[r = parity bits).\]
- \[Hamming error-correcting capability: can correct up to t = floor((d_min - 1)/2) bit errors\]\[where d_min is minimum Hamming distance of the code.\]
- \[CRC codeword formation: Let M(x) be message polynomial\]\[G(x) generator of degree r\]\[Compute R(x) = (M(x)·x^r) mod G(x)\]\[Transmit C(x) = M(x)·x^r + R(x)\]\[Receiver checks: C(x) mod G(x) = 0 for no error.\]
- \[Syndrome (Hamming): syndrome bits = results of parity checks concatenated → binary value gives index of erroneous bit (0 means no error).\]
Multiplexing and Modulation
Multiplexing and Modulation
Key Point: Amplitude modulated signal (simple AM): s(t) = Ac [1 + ka m(t)] cos(2π f_c t) where Ac is carrier amplitude, ka is amplitude sensitivity, m(t) is message.
Multiplexing
Multiplexing is the technique of combining two or more signals for transmission over a single communication channel or medium so that the channel is utilized efficiently. At the receiver end, the signals are separated by demultiplexing. Multiplexing is used to share expensive resources (cables, fiber, wireless spectrum) among many users.
Why multiplexing is needed
- Reduce cost by sharing a high-capacity link among many low-rate channels.
- Efficient utilization of bandwidth and physical media.
- Support many simultaneous users or data streams.
Main types of multiplexing
- Frequency Division Multiplexing (FDM): Each signal modulates a different carrier frequency. The carriers are spaced to avoid overlap and guard bands reduce interference. Used in analog radio broadcasting and cable TV.
- Wavelength Division Multiplexing (WDM): Optical equivalent of FDM used in fiber optics. Different data channels are carried on different light wavelengths (colors).
- Time Division Multiplexing (TDM): Each user gets the entire channel capacity but only for a short time slot in a repeating frame. Can be synchronous TDM or statistical TDM (dynamic allocation). Used in digital telephony and digital data links.
- Code Division Multiplexing (CDM/CDMA): All users transmit simultaneously over the same frequency band but are separated by unique codes. Widely used in some cellular systems.
Modulation
Modulation is the process of modifying a high-frequency carrier signal with a lower-frequency information (message) signal so the message can be transmitted efficiently over a physical medium. The reverse process is demodulation.
Why modulation is needed
- Allow transmission of low-frequency signals over antennas and long distances.
- Enable frequency multiplexing of many signals on one medium.
- Improve signal propagation and reduce antenna size by using high carrier frequency.
Analog modulation
- Amplitude Modulation (AM): The amplitude of the carrier is varied in proportion to the message. Used in AM radio.
- Frequency Modulation (FM): The carrier frequency is varied according to the message amplitude. Used in FM radio.
- Phase Modulation (PM): The carrier phase is changed according to the message.
Digital modulation
- ASK (Amplitude Shift Keying) — discrete amplitude levels represent bits.
- FSK (Frequency Shift Keying) — different frequencies represent different bit values.
- PSK (Phase Shift Keying) — different carrier phases represent symbols (BPSK, QPSK).
- QAM (Quadrature Amplitude Modulation) — combines amplitude and phase variations to transmit multiple bits per symbol, used in modern modems and Wi-Fi.
How multiplexing and modulation work together
Multiplexing combines multiple signals into one channel. Modulation shifts signals to different carrier frequencies or encodes them for transmission. For example, in FDM each input signal is modulated onto a distinct carrier; in TDM the digital signals are placed in distinct time slots and then may be modulated for transmission over the physical medium.
Demultiplexing and demodulation
At the receiver, demodulation extracts the baseband message from its carrier, and demultiplexing separates the combined channels either by filtering (for FDM/WDM), by time slot extraction (for TDM), or by decoding (for CDMA).
Important practical notes
- Guard bands and filtering are necessary in FDM/WDM to avoid inter-channel interference.
- Synchronous TDM wastes bandwidth if slots are unused; statistical TDM allocates slots dynamically to improve utilization.
- Modern systems often use OFDM (orthogonal FDM) to pack carriers tightly without guard bands, used in Wi-Fi, LTE, and digital TV.
- AM radio broadcasting: audio modulates carrier amplitude; receivers demodulate to recover sound.
- FM radio: audio modulates carrier frequency for higher fidelity and noise resistance.
- Cable TV: uses FDM to transmit many TV channels simultaneously over coaxial cable.
- Telephone trunks: historically used TDM to carry many phone calls over one digital line (e.g., PCM and time slots).
- Optical fiber networks: WDM carries many wavelength channels (each a data stream) on the same fiber to increase capacity.
- Cellular systems: different generations use FDMA/TDMA/CDMA/OFDM combinations to allow many users to share spectrum.
- \[Amplitude modulated signal (simple AM): s(t) = Ac [1 + ka m(t)] cos(2π f_c t) where Ac is carrier amplitude\]\[ka is amplitude sensitivity\]\[m(t) is message.\]
- \[AM modulation index: m_a = (peak amplitude of message) / Ac or m_a = ka * max|m(t)|\]\[For linear AM, 0 ≤ m_a ≤ 1 to avoid distortion.\]
- \[AM bandwidth: B_AM = 2 f_m where f_m is the highest frequency present in the message signal (two sidebands).\]
- \[FM frequency deviation: Δf = kf * A_m where kf is FM sensitivity and A_m is message amplitude.\]
- \[FM modulation index: β = Δf / f_m where f_m is maximum modulating frequency.\]
- \[FM approximate bandwidth (Carson's rule): B_FM ≈ 2 (Δf + f_m).\]
Network Administration and Management
Network Administration and Management
Key Point: Throughput = Total data transferred (bits) / Time taken (seconds)
Overview
Network Administration and Management is the set of activities required to keep a computer network running reliably, securely and efficiently. It covers configuring devices, assigning addresses, controlling access, monitoring performance, backing up data, and responding to faults.
Key responsibilities
- User and account management: create/delete user accounts, set permissions and groups.
- IP address management: plan and assign static IPs and manage DHCP pools (using CIDR/subnetting).
- Device configuration: routers, switches, firewalls, wireless access points and servers.
- Security: implement firewalls, access controls, VPNs, authentication, patching and antivirus.
- Monitoring and logging: watch network traffic, device health, and logs to detect problems.
- Backup and recovery: regular backups of critical data and configuration, and disaster recovery plans.
- Performance management: measure throughput, latency and utilization; tune QoS and bandwidth allocations.
- Incident response and change management: procedures to handle failures and controlled rollout of changes.
Important protocols and tools
- DHCP — automatic IP assignment.
- DNS — name resolution (hostnames to IPs).
- SNMP — monitoring and management of devices.
- SSH/HTTPS — secure remote administration.
- RADIUS/LDAP/Active Directory — centralized authentication and authorization.
- Network monitoring tools — e.g., Nagios, Zabbix, SolarWinds, Wireshark for traffic analysis.
Security practices
- Least privilege: give users only required access.
- Segmentation: use VLANs or subnets to separate traffic (e.g., guest Wi‑Fi vs internal network).
- Firewalls & ACLs to control traffic entering/exiting network segments.
- Regular patching, strong passwords, two‑factor authentication, and logging/alerting.
IP addressing & subnetting (simple explanation)
IPv4 addresses have 32 bits. Subnetting divides an address space into smaller networks. In CIDR notation an address looks like 192.168.10.0/26 where /26 is the prefix (number of fixed network bits).
Number of usable hosts in a subnet = 2^(32 - prefix) - 2 (subtract network and broadcast addresses)
Monitoring & performance metrics
- Throughput (actual rate of successful data transfer).
- Bandwidth (maximum possible data rate of a link).
- Latency / RTT (time for a packet to travel round trip).
- Packet loss percentage and error rates.
- Device CPU, memory, interface utilization and uptime.
Typical workflows
- Onboarding a new user: create account → allocate IP and storage → assign permissions → add to monitoring.
- Handling an outage: detect via monitoring → isolate the fault → restore service (failover/backup) → post‑mortem and patch.
Best practices
- Document network design, configuration and change history.
- Automate repetitive tasks (scripting, configuration management).
- Keep backups of device configurations and critical data offsite.
- Test disaster recovery and failover procedures periodically.
- School computer lab: Admin assigns static IPs to servers, configures DHCP for student PCs, creates user accounts with limited permissions, segments the lab and staff networks using VLANs, and schedules nightly backups of important data.
- Small office: A network administrator configures a router with NAT and DHCP, sets up a Wi‑Fi access point with WPA2 and guest VLAN, uses a firewall to restrict inbound traffic, and monitors bandwidth usage to ensure VoIP calls remain clear.
- Internet Service Provider (ISP): Manages large IP pools with DHCP and NAT, uses BGP for routing between networks, monitors traffic using SNMP and NetFlow, and maintains redundancy with multiple links to ensure high uptime.
- University campus: Uses VLANs to segregate labs, faculty and student networks, centralizes authentication with RADIUS/LDAP, deploys QoS to prioritize video lectures, and uses monitoring tools to detect overloaded links or failing switches.
- \[Throughput = Total data transferred (bits) / Time taken (seconds)\]
- \[Bandwidth‑Delay Product (BDP) = Link bandwidth (bits/sec) × Round‑Trip Time (sec)\]
- \[Utilization (%) = (Throughput / Bandwidth) × 100\]
- \[Uptime (%) = ((Total time - Downtime) / Total time) × 100\]
- \[Number of usable hosts in IPv4 subnet = 2^(32 - prefix) - 2 (e.g., /26 → 2^(32-26)-2 = 62 hosts)\]
Internet Basics and Services
Internet Basics and Services
Key Point: Data transfer time (s) = File size (bits) / Bandwidth (bits per second). Example: 100 MB = 800 Mb; with 20 Mbps link: 800 Mb / 20 Mb/s = 40 s.
What is the Internet?
The Internet is a global system of interconnected computer networks that use the TCP/IP suite of protocols to communicate. It provides a platform for information exchange and services such as the World Wide Web, email, file transfer, streaming and many more.
Core components
- Hosts/Clients & Servers: End systems that request or provide services.
- Routers & Switches: Devices that forward packets through the network.
- Internet Service Provider (ISP): Provides access and connectivity.
- Protocols: Agreed rules for communication (TCP, IP, HTTP, FTP, SMTP, DNS, etc.).
- Domain Name System (DNS): Translates human-friendly domain names to IP addresses.
Key protocols & their roles
- IP (Internet Protocol): Packet addressing and forwarding (IPv4, IPv6).
- TCP (Transmission Control Protocol): Reliable, connection-oriented transport.
- UDP (User Datagram Protocol): Connectionless, low-overhead transport for real-time apps.
- HTTP/HTTPS: Web (hypertext) transfer; HTTPS adds TLS/SSL encryption for secure communication.
- SMTP, POP3, IMAP: Email delivery and retrieval.
- FTP/SFTP: File transfer (SFTP uses SSH for security).
How the Web works (simple request–response)
A user types a URL in a browser → DNS resolves domain to an IP → browser opens TCP connection (often TLS) to web server → browser sends an HTTP request → server responds with HTML/CSS/JS → browser renders page.
IP addressing & DNS
Each device on the internet has an IP address. IPv4 uses 32-bit addresses (e.g., 192.168.1.1); IPv6 uses 128-bit addresses. DNS maps readable names (example.com) to IP addresses so users don’t need to remember numeric addresses.
Types of internet connections
- Dial-up (obsolete), DSL, Cable, Fiber (FTTH), Mobile (3G/4G/5G), Satellite, and Wireless (Wi‑Fi).
Common Internet Services
- World Wide Web (WWW): Websites and web applications accessed via browsers.
- Email: Store-and-forward message service using SMTP/POP/IMAP.
- File Transfer: FTP, SFTP for uploading/downloading files.
- Search Engines: Index pages and return relevant results (Google, Bing).
- Streaming & VoIP: Video/audio streaming (YouTube, Netflix) and voice/video calls (Skype, WhatsApp) commonly use UDP or adaptive protocols.
- Cloud Services: Remote storage, computing (SaaS, PaaS, IaaS).
- Social Media, e-Commerce, Online Banking: Application-layer services that often require strong security.
Security & Privacy Basics
Important measures include TLS/SSL for encrypted web traffic (HTTPS), strong authentication (passwords, multi-factor), firewalls, antiviruses, and secure protocols (SFTP, SSH). Users must be aware of phishing, malware and data privacy concerns.
Performance concepts
- Bandwidth: Maximum data rate of a link (bps).
- Throughput: Actual achieved data rate (usually ≤ bandwidth).
- Latency (Delay): Time taken for a packet to travel from source to destination (ms).
- Jitter: Variation in packet delay — important for real-time apps.
Practical classroom points
- Understand roles of DNS, HTTP, TCP/IP and basic commands (ping, traceroute).
- Recognize difference between client-server and peer-to-peer models.
- Know examples of services and which protocols they use (e.g., email: SMTP/IMAP).
Summary
The Internet is a layered, protocol-driven global network enabling many services. Knowing how addressing, routing, protocols and security interact helps in understanding how everyday applications (web, email, streaming) function reliably and securely.
- Browsing a website: Type https://www.example.com, DNS resolves domain to an IP, browser establishes HTTPS (TCP + TLS) and requests webpage via HTTP.
- Sending email: Mail client submits message to outgoing server using SMTP; recipient's server stores it; recipient retrieves using IMAP or POP3.
- Streaming video on Netflix: Client requests segments; adaptive streaming adjusts bitrate according to available bandwidth to reduce buffering.
- File transfer to a remote server using SFTP: Securely uploads files over SSH-encrypted channel.
- Making a voice call over WhatsApp (VoIP): Audio captured, packetized and sent using UDP with real-time constraints and encryption.
- Using Google Maps on mobile: App requests map tiles and route data from servers via HTTP/HTTPS APIs; responses rendered on device.
- \[Data transfer time (s) = File size (bits) / Bandwidth (bits per second)\]\[Example: 100 MB = 800 Mb\]\[with 20 Mbps link: 800 Mb / 20 Mb/s = 40 s.\]
- \[Bandwidth (bits/s) conversions: 1 byte = 8 bits\]\[1 Kbps = 10^3 bps\]\[1 Mbps = 10^6 bps.\]
- \[Bandwidth-Delay Product (bits) = Bandwidth (bits/s) × Round-Trip Time (s)\]\[It estimates the amount of data 'in flight'.\]
- \[Throughput ≤ Bandwidth × (1 − overhead fraction)\]\[Overheads include headers\]\[retransmissions\]\[and protocol inefficiency.\]
- \[Utilization (%) = (Throughput / Bandwidth) × 100.\]
Practical Skills and Network Programming (CBSE Practical Focus)
Practical Skills and Network Programming (CBSE Practical Focus)
Key Point: Transmission time (seconds) = Packet size (bits) / Bandwidth (bits per second)
Overview
Practical Skills and Network Programming focuses on hands‑on abilities to build, test and debug networked applications and to use networking tools. The emphasis is on the client–server model, socket programming (TCP/UDP), simple web interaction, file transfer, basic debugging using command‑line tools and packet inspection, and on understanding protocol behaviour (handshakes, timeouts, retransmission).
What students should be able to do
- Use common network utilities: ping, traceroute, nslookup/dig, ifconfig/ip, netstat, telnet/openssl s_client.
- Write socket programs (TCP server/client and UDP sender/receiver), handle connections, message framing, timeouts and errors.
- Implement simple application protocols (e.g., text chat, file transfer, tiny HTTP server or client) and test them locally and across a LAN.
- Use packet capture tools (Wireshark/tcpdump) to observe protocol exchanges (TCP three‑way handshake, SYN/ACK, FIN).
- Apply basic security hygiene: avoid hard‑coded credentials, validate input, use TLS for sensitive data where possible.
Key concepts explained
- Sockets and ports: A socket is an endpoint identified by an IP and port. TCP provides reliable byte stream; UDP provides connectionless datagrams.
- Client–Server flow (TCP): Server binds to a port and listens; client connects; server accepts and a socket is created for that client; data exchanged; connection closed. Handle multiple clients by threads, processes, or I/O multiplexing (select/poll/async).
- Message framing: Because TCP is a stream, application messages need boundaries: use fixed‑length headers, newline delimiters, or length prefixes.
- File transfer basics: Split large files into chunks, send size or checksum metadata, acknowledge chunks, handle retransmission/timeouts.
- UDP use cases: Low-latency, loss-tolerant apps (like realtime sensors, simple discovery protocols). Add your own reliability if needed.
- Debugging & testing: Reproduce locally (localhost), on LAN, and across machines. Use Wireshark to view packet contents, check sequence numbers, flags, retransmissions.
Typical practical workflow (step-by-step)
- Define the protocol: message format, commands, fields, delimiters.
- Implement server: open socket, bind, listen, accept loop, per‑client handler (thread/async), parse requests, send responses, close connections gracefully.
- Implement client: connect, send requests, implement retry/timeout logic, receive and validate responses.
- Test small: unit test parsing and serialization, then integration tests (client↔server on same machine), then network tests (different hosts).
- Capture traffic: run Wireshark/tcpdump while testing, verify flags, payload, round‑trip behaviour.
- Measure and optimize: measure latency, throughput, and memory/CPU while increasing clients or message size. Optimize with pooling, non‑blocking I/O or batching.
Practical tips
- Always set socket timeouts to avoid blocking forever.
- Use length prefix or delimiter to avoid message concatenation problems with TCP.
- Close sockets in finally blocks/cleanup routines to free ports quickly.
- For file transfer, include file size and checksum (MD5/SHA1) to detect corruption.
- When teaching, show both blocking multithreaded server and single‑threaded async server to compare complexity/performance.
- Simple chat application: TCP server accepts multiple clients; each client sends text lines; server broadcasts to all connected clients. Demonstrates sockets, threads, message framing and concurrency.
- File transfer program: Client requests a file; server sends file in fixed‑size chunks with a 4‑byte length prefix and a final checksum. Demonstrates chunking, checksums, and retransmission on timeout.
- Tiny HTTP server: Accept HTTP GET, serve static files with correct headers and status codes. Use this to demonstrate application-layer protocol parsing and headers.
- UDP sensor streamer: Simulated sensor sends periodic UDP datagrams to a collector that computes running averages. Demonstrates datagram programming and lossy delivery handling.
- Network diagnostics lab: Use ping/traceroute to measure latency/hops to a host; use nslookup to resolve DNS; capture packets with Wireshark to see DNS/TCP handshakes.
- \[Transmission time (seconds) = Packet size (bits) / Bandwidth (bits per second)\]
- \[Propagation delay (seconds) = Distance (meters) / Propagation speed (m/s) (e.g., ~2x10^8 m/s in copper/fibre)\]
- \[Round‑trip time (approx) RTT ≈ 2 × Propagation delay + queuing/processing delays\]
- \[Bandwidth‑Delay Product (bits) = Bandwidth (bits/s) × RTT (s) — useful to size TCP window or buffer\]
- \[Throughput (bits/s) = Total data transmitted (bits) / Time taken (s)\]
- \[IPv4 subnet hosts: Number of usable hosts = 2^(32 − prefix) − 2 (example: /24 → 2^8 − 2 = 254 usable hosts)\]
Key Concepts
- Network
- A collection of two or more interconnected computers and devices that share resources and exchange data.
- Protocol
- A set of rules that governs how data is transmitted and received over a network.
- Topology
- The physical or logical arrangement of nodes and links in a network.
- LAN (Local Area Network)
- A network covering a small geographic area like a home, office, or school.
- WAN (Wide Area Network)
- A network that spans large geographical areas, connecting multiple LANs.
- Router
- A device that forwards data packets between different networks, often connecting LANs to the Internet.
- Switch
- A network device that connects multiple devices within a LAN and forwards frames based on MAC addresses.
- Hub
- A simple device that broadcasts incoming data to all ports; operates at the physical layer and does not filter traffic.
- Modem
- A device that modulates digital signals to analog for transmission over telephone or cable lines and demodulates back to digital.
- IP Address
- A numerical label assigned to each device on a network that identifies it and enables routing of packets.
- MAC Address
- A unique hardware identifier assigned to a network interface card (NIC) used for local network communication.
- DHCP (Dynamic Host Configuration Protocol)
- A protocol that automatically assigns IP addresses and other network configuration to devices on a network.
- DNS (Domain Name System)
- A service that translates human-readable domain names into IP addresses.
- HTTP (Hypertext Transfer Protocol)
- An application-layer protocol used to transfer web pages from servers to browsers.
- FTP (File Transfer Protocol)
- A protocol for transferring files between a client and a server over a network.
- SMTP (Simple Mail Transfer Protocol)
- A protocol used to send email messages from a client to a mail server or between mail servers.
- TCP (Transmission Control Protocol)
- A reliable, connection-oriented transport-layer protocol that ensures ordered delivery of data packets.
- UDP (User Datagram Protocol)
- A connectionless, lightweight transport-layer protocol that sends datagrams without guaranteed delivery.
- Packet Switching
- A method of data transmission where messages are broken into packets that are routed independently across the network.
- Bandwidth
- The maximum rate at which data can be transmitted over a network link, usually measured in bits per second (bps).
Practice Questions
-
Compare LAN and WAN on coverage and ownership. / कवरेज और स्वामित्व के आधार पर LAN और WAN की तुलना कीजिए।
Show answer
A LAN covers a small area (building/campus) and is usually owned by a single organization with high data rates; a WAN spans large geographic areas (regions/countries) using leased lines and is the Internet's scale. / LAN छोटे क्षेत्र (भवन/कैंपस) को कवर करता है और प्रायः एक संगठन के स्वामित्व में उच्च डेटा दर वाला होता है; WAN बड़े भौगोलिक क्षेत्रों (क्षेत्र/देश) तक लीज़्ड लाइनों से फैला होता है और इंटरनेट इसी पैमाने का है।
-
State the number of direct links in a full mesh topology of n nodes and one advantage of mesh. / n नोड्स की फुल मेश टोपोलॉजी में सीधे लिंक की संख्या तथा मेश का एक लाभ बताइए।
Show answer
Links = n(n-1)/2; its advantage is high redundancy and fault tolerance with minimal single points of failure. / लिंक = n(n-1)/2; इसका लाभ उच्च रिडंडेंसी और फॉल्ट टॉलरेंस है तथा एकल विफलता बिंदु न्यूनतम होते हैं।
-
List the four layers of the TCP/IP model in order. / TCP/IP मॉडल की चार परतें क्रम में सूचीबद्ध कीजिए।
Show answer
Application, Transport, Internet (Network), and Link (Network Access). / एप्लिकेशन, ट्रांसपोर्ट, इंटरनेट (नेटवर्क), तथा लिंक (नेटवर्क एक्सेस)।
-
Differentiate between a switch and a router based on OSI layer and forwarding basis. / OSI परत और फॉरवर्डिंग आधार के अनुसार स्विच और राउटर में अंतर बताइए।
Show answer
A switch works at Layer 2 forwarding frames using MAC addresses within a network; a router works at Layer 3 forwarding packets between different networks using IP addresses. / स्विच लेयर 2 पर कार्य करता है और नेटवर्क के भीतर MAC पतों से फ्रेम फॉरवर्ड करता है; राउटर लेयर 3 पर कार्य करता है और IP पतों से विभिन्न नेटवर्कों के बीच पैकेट फॉरवर्ड करता है।
-
Differentiate circuit switching from packet switching. / सर्किट स्विचिंग और पैकेट स्विचिंग में अंतर बताइए।
Show answer
Circuit switching reserves a dedicated path for the whole session (constant bandwidth, low jitter, used in PSTN); packet switching splits data into independently routed packets giving efficient sharing for bursty traffic (used on the Internet). / सर्किट स्विचिंग पूरे सत्र के लिए समर्पित पथ आरक्षित करती है (स्थिर बैंडविड्थ, कम जिटर, PSTN में); पैकेट स्विचिंग डेटा को स्वतंत्र रूप से रूट किए गए पैकेटों में बाँटती है जो बर्स्टी ट्रैफ़िक हेतु कुशल साझाकरण देती है (इंटरनेट में)।
-
Subnet 192.168.10.0/24 into /26 subnets: find the number of subnets and usable hosts per subnet. / 192.168.10.0/24 को /26 सबनेट में बाँटिए: सबनेट की संख्या और प्रति सबनेट उपयोग योग्य होस्ट ज्ञात कीजिए।
Show answer
Borrowed bits = 2, so subnets = 2^2 = 4; host bits = 6, so usable hosts = 2^6 - 2 = 62 per subnet. / उधार बिट्स = 2, अतः सबनेट = 2^2 = 4; होस्ट बिट्स = 6, अतः उपयोग योग्य होस्ट = 2^6 - 2 = 62 प्रति सबनेट।
-
Calculate the transmission time to send a 10 MB file over a 10 Mbps link. / 10 Mbps लिंक पर 10 MB फ़ाइल भेजने का ट्रांसमिशन समय ज्ञात कीजिए।
Show answer
10 MB = 80,000,000 bits; time = 80,000,000 / 10,000,000 = 8 seconds. / 10 MB = 80,000,000 बिट्स; समय = 80,000,000 / 10,000,000 = 8 सेकंड।
-
Describe the TCP three-way handshake. / TCP थ्री-वे हैंडशेक का वर्णन कीजिए।
Show answer
Client sends SYN, server replies SYN-ACK, then client sends ACK; the connection is then established. / क्लाइंट SYN भेजता है, सर्वर SYN-ACK से उत्तर देता है, फिर क्लाइंट ACK भेजता है; तत्पश्चात कनेक्शन स्थापित हो जाता है।
Related Laws & Principles
Explore allFoundational laws & principles connected to this chapter — tap to open in the Laws Explorer.