Computer Networks
Computer networks connect autonomous computing devices so they can exchange data and share resources. From household Wi-Fi to global submarine cables that bring Pakistan its AAE-1 and SEA-ME-WE-5 capacity, networking is the backbone of the digital economy.
A collection of autonomous computers (or other devices) interconnected by communication links and protocols enabling data exchange and resource sharing.
Types of networks by scale
| Type | Range | Example |
|---|---|---|
| PAN | Few metres | Bluetooth pairing |
| LAN | Building / campus | Office Ethernet, Wi-Fi |
| MAN | City | Metro Ethernet, cable TV |
| WAN | Country / world | The Internet |
| GAN | Global | Inmarsat, Iridium |
Network topologies
- Bus — single backbone; failure of cable disrupts all.
- Star — central hub/switch; failure of hub disables network.
- Ring — each device connected to two neighbours; token-based access.
- Mesh — every device connected to every other; redundant, expensive.
- Tree — hierarchical star-of-stars.
- Hybrid — combinations.
The OSI reference model
Developed by ISO (1984), it has seven layers, top-down:
| # | Layer | Function | Example protocols/units |
|---|---|---|---|
| 7 | Application | User services | HTTP, SMTP, FTP, DNS |
| 6 | Presentation | Encoding, encryption | TLS, JPEG, ASCII |
| 5 | Session | Dialog control | NetBIOS, RPC |
| 4 | Transport | End-to-end delivery | TCP, UDP, segments |
| 3 | Network | Routing, addressing | IP, ICMP, packets |
| 2 | Data Link | Frame delivery | Ethernet, PPP, frames |
| 1 | Physical | Bits over medium | Cables, wireless, signals |
Mnemonic (top-down): All People Seem To Need Data Processing.
TCP/IP model
The Internet's de facto reference: four layers — Application, Transport, Internet, Network Access.
Layer mapping
- Application ↔ OSI layers 5-7.
- Transport ↔ OSI 4.
- Internet ↔ OSI 3.
- Network Access ↔ OSI 1-2.
- TCP is connection-oriented, reliable, ordered (uses 3-way handshake: SYN, SYN-ACK, ACK).
- UDP is connectionless, unreliable, unordered — used for DNS, VoIP, video streaming, gaming.
- IPv4 is 32 bits (~4.3 billion addresses); IPv6 is 128 bits (effectively unlimited).
- The Internet is a "network of networks" interconnected by routers running BGP.
IP addressing
IPv4
- 32 bits in 4 dotted-decimal octets (e.g., 192.168.1.1).
- Classes A, B, C, D (multicast), E (reserved).
- CIDR notation replaces classful (e.g., 10.0.0.0/8).
- Private ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
- Loopback: 127.0.0.0/8.
IPv6
- 128 bits in 8 groups of hexadecimal (e.g., 2001:0db8:85a3::8a2e:0370:7334).
- Pakistan's IPv6 adoption is rising, driven by PTCL and mobile operators.
Subnetting
Splitting a network into smaller ones with a subnet mask. For /24, the first 24 bits are network, leaving 8 bits (254 usable) for hosts.
Important protocols
Application layer
- HTTP/HTTPS — web (ports 80/443).
- DNS — name resolution (port 53).
- SMTP/POP3/IMAP — email (25/110/143; secure: 465/995/993).
- FTP/SFTP — file transfer (21/22).
- SSH — secure shell (22).
- DHCP — automatic IP assignment.
Transport layer
- TCP — congestion control, flow control, retransmission.
- UDP — lightweight, no guarantees.
- QUIC — UDP-based, used by HTTP/3.
Network layer
- IP (v4 and v6).
- ICMP — control and diagnostics (ping, traceroute).
- ARP — IP-to-MAC resolution.
- Routing protocols: RIP, OSPF, EIGRP, BGP.
Data link
- Ethernet (IEEE 802.3).
- Wi-Fi (IEEE 802.11) — variants a/b/g/n/ac/ax (Wi-Fi 6).
- PPP for serial links.
- VLAN (802.1Q) for logical segmentation.
Switching and routing
- Hubs (Layer 1) — repeat signals; rarely used today.
- Switches (Layer 2) — forward frames by MAC.
- Routers (Layer 3) — forward packets by IP; run routing protocols.
- Layer-3 switches combine both functions in enterprise LANs.
Routing algorithms
- Distance-vector — RIP; based on hop count.
- Link-state — OSPF; floods topology, runs Dijkstra.
- Path-vector — BGP; policy-driven, used between ASes.
Network performance
Key metrics:
- Bandwidth — capacity (bps).
- Throughput — actual rate achieved.
- Latency — delay (ms).
- Jitter — variation in delay.
- Packet loss — discarded packets (%).
- MTU — Maximum Transmission Unit (typically 1500 bytes for Ethernet).
Wireless and mobile
- Wi-Fi 6 (802.11ax) — higher throughput, OFDMA, MU-MIMO.
- Cellular generations: 1G (analog), 2G (GSM), 3G (UMTS), 4G (LTE), 5G (mmWave, sub-6 GHz). Pakistan launched 5G trials but is yet to issue commercial 5G spectrum (status as of 2025).
- Pakistan's mobile operators: Jazz, Zong, Telenor, Ufone-PTCL. Combined teledensity exceeds 85%.
Network security
- Confidentiality — keep data secret (encryption).
- Integrity — prevent tampering (hashes, MAC).
- Availability — resist DoS/DDoS.
- Authentication — verify identity.
- Non-repudiation — sender cannot deny.
Common attacks
- DoS / DDoS — flood resources.
- MITM — intercept communication.
- ARP spoofing, DNS poisoning.
- SQL injection, XSS, CSRF (web).
- Phishing, ransomware.
Defences
- Firewalls — packet filtering, stateful, application-layer.
- IDS/IPS — intrusion detection/prevention.
- VPN — secure tunnels (IPsec, SSL/TLS).
- TLS — secures HTTP, SMTP, IMAP, etc.
- PKI — public-key infrastructure with X.509 certificates.
For CSS short-answer questions, learn the TCP three-way handshake in detail: SYN (client → server), SYN-ACK (server → client), ACK (client → server). Examiners frequently ask candidates to draw a diagram and identify why the third ACK is necessary.
Cloud and the future
- Cloud computing models: IaaS, PaaS, SaaS; major providers AWS, Azure, Google Cloud.
- SDN (Software-Defined Networking) — programmable control plane.
- NFV (Network Function Virtualisation) — virtualised firewalls, routers.
- 6G research — terahertz frequencies, AI-native networking.
- Pakistan's MoITT Cloud-First Policy mandates public-sector cloud adoption.
A confident grasp of OSI vs. TCP/IP, IP addressing, common protocols and security threats is what distinguishes a serious CSS aspirant from a candidate who has merely memorised acronyms.