Computer Networks

The Invisible
Mega-Structure

Computer Networks connect independent computers to share resources and data. From the fiber cables under the ocean to the Wi-Fi signals in the air.

It is a layered abstraction. Each layer solves a specific problem—converting signals to bits, bits to packets, routing packets across the world, and ensuring applications understand the data.

01.1 / Structure

Network Topologies

Topology defines the physical or logical layout of a network. It determines how devices connect and data flows.

Star Topology

All devices connect to a central Hub/Switch. Easy to troubleshoot, but if the Hub fails, the network goes down.

Mesh Topology

Devices interconnect redundantly. High reliability and fault tolerance, but expensive and complex cabling.

Bus Topology

Single cable (backbone) connects all devices. Easy to install, but a cable break stops the whole network.

Ring Topology

Devices connect in a circle. Data travels in one direction. Token passing controls access.

Tree Topology

Hierarchical structure with a root node. Scalable and manageable, often used in WANs.

Hybrid Topology

Integration of two or more different topologies (e.g., Star-Ring). Flexible but complex to design.

01.2 / Scope

Network Types

Networks are classified by their geographical scope, from a few meters (PAN) to the entire globe (WAN).

PAN

Person

Personal Area Network. Smallest range (approx. 10m). Connects personal devices.

Bluetooth, Zigbee

LAN

Local

Local Area Network. Connects devices in a single location like a home, office, or building. High speed.

Ethernet (802.3)

WLAN

Wireless

Wireless LAN. Uses radio waves to connect devices without cables. Flexible but subject to interference.

Wi-Fi (802.11)

CAN

Campus

Campus Area Network. Interconnects multiple LANs within a specific area like a university or military base.

Fiber Backbones

MAN

Metro

Metropolitan Area Network. Spans an entire city or large campus. Connects multiple LANs.

Cable TV, Metro Ethernet

WAN

Wide

Wide Area Network. Spans countries or continents. The Internet is the largest WAN.

Satellites, Fiber Optic

SAN

Storage

Storage Area Network. High-speed network providing block-level access to storage. Appears as local drives.

Fibre Channel

VPN

Virtual

Virtual Private Network. Extends a private network across a public one (Internet). Encrypted tunnel.

IPsec, OpenVPN
01 / Abstraction

The OSI Model (7 Layers)

The Open Systems Interconnection (OSI) model standardizes communication functions into 7 distinct layers.

Why Layering?

  • Interoperability: Different hardware and software can communicate if they follow the same standard protocols.
  • Abstraction: Complex details are hidden. A browser (L7) doesn't need to know about fiber optics (L1).
  • Troubleshooting: Helps isolate problems (e.g., "Is it a physical cable issue or a wrong IP address?").
L1 Physical
L2 Data Link
L3 Network
L4 Transport
L5 Session
L6 Presentation
L7 Application
Selected Layer

Select a Layer

Interact with the stack on the left to explore each layer's specific responsibilities in the network model.

Data Unit -
Examples -
01.3 / Data Flow

Encapsulation

As data moves down the stack, each layer adds a "Header" (and sometimes a Footer). This process is called Encapsulation.

User Data
Application
TCP H.
Data
Segment
IP Header
TCP
Data
Packet
MAC
..
..
FCS
Frame
02 / Transport

TCP/IP & Packet Switching

The Internet runs on TCP/IP. Data is broken into packets, routed independently, and reassembled at the destination.

The TCP 3-Way Handshake

Before data transfers, TCP guarantees a reliable connection:

1. SYN (Hello?)
2. SYN-ACK (Hello! I hear you.)
3. ACK (Great, let's connect.)
Client
Server
R1
R2
R3
02.1 / Addressing & Switching

Network Layer: IP & Switching

The Network Layer is responsible for logical addressing (IP) and routing packets from source to destination appropriately.

Packet Switching

Datagram Approach

Connectionless. Each packet is treated independently. Packets may take different paths and arrive out of order.

Used by: The Internet (IP)
Virtual Circuit

Connection-oriented. A pre-defined path is established before data transfer. All packets follow the same path.

Used by: ATM, Frame Relay

IP Addressing (IPv4 vs IPv6)

IPv4 Packet Header

Version
IHL
ToS
Total Length
Identification
Fragment Offset
TTL
Protocol
Header Checksum
Source IP Address (32 bits)
Destination IP Address (32 bits)
IPv4
  • Size: 32-bit (approx 4.3 billion addresses)
  • Format: Dotted Decimal (192.168.1.1)
  • Header: Variable length (20-60 bytes)
  • Config: Manual or DHCP
IPv6
  • Size: 128-bit (Undecillions of addresses)
  • Format: Hexadecimal (2001:0db8::1)
  • Header: Fixed length (40 bytes), Simpler processing
  • Config: Auto-configuration (SLAAC) built-in
CIDR Notation

Classless Inter-Domain Routing.

192.168.1.0/24
  • /24 = 255.255.255.0 (Subnet Mask)
  • 254 Usable Hosts
Private Ranges (RFC 1918)

Not routable on the internet.

  • 10.0.0.0/8 (Enterprise)
  • 172.16.0.0/12 (AWS/Cloud)
  • 192.168.0.0/16 (Home)
02.2 / Routing

Routing Protocols & Algorithms

How routers decide the best path for a packet. Algorithms build the map, protocols share the map.

Core Algorithms

Interactive Dijkstra (Shortest Path)
A
B
C
D
4 2 1 5 8
Find shortest path from A to D.
Result: ?
Distance Vector (DVR)

Bellman-Ford Algorithm. Routers define path by "Distance" (Metric) and "Vector" (Direction/Next Hop).

Issue: Count-to-Infinity problem.
Link State (LSR)

Dijkstra's Algorithm. Every router knows the complete graph (topology) of the network.

Heavy computation, fast convergence.
Path Vector (PVR)

Similar to DVR but stores the entire path history to prevent loops. Used between Autonomous Systems.

Unicast Routing Protocols

Protocol Type Metric Use Case
RIP (v1/v2) Distance Vector Hop Count (Max 15) Small Networks, LANs
OSPF Link State Cost (Bandwidth) Large Enterprise (Intra-AS)
BGP Path Vector Policy/Attributes Internet Core (Inter-AS)

Multicast Routing: MOSPF

Multicast Extensions to OSPF. Uses the Link State database to calculate a "Source-Based Tree" for efficient one-to-many delivery.

Pruning Grafting IGMP
02.3 / Protocols

Key Protocols

Interactive DNS Resolver

Trace path will appear here...

HTTP / HTTPS

80 443

HyperText Transfer Protocol. Application layer protocol for transmitting hypermedia documents (HTML).

GET POST PUT
Status Codes
200 OK
301 Moved
404 Not Found

DHCP

Dynamic Host Configuration Protocol. Automatically assigns IP addresses to devices on a network.

Telnet

Port 23

Telecommunications Network. Older protocol for remote login. Unlike SSH, it is insecure (plaintext).

SSH

Port 22

Secure Shell. Cryptographic protocol for operating network services securely over an unsecured network. Used for remote login.

$ ssh user@host

FTP

Port 21

File Transfer Protocol. Standard protocol used for the transfer of computer files between a client and server.

SMTP

Port 25

Simple Mail Transfer Protocol. The standard for sending emails across the Internet.

IMAP

Port 143

Internet Message Access Protocol. Used by email clients to retrieve messages from a mail server.

RDP

Port 3389

Remote Desktop Protocol. Microsoft protocol that provides a graphical interface to connect to another computer.

Cheat Sheet

Common Port Directory
Port Protocol Description
20, 21 FTP File Transfer Protocol (Data/Control)
22 SSH Secure Shell (Remote Management)
23 Telnet Insecure Remote Login (Plaintext)
25 SMTP Email Transmission (Outgoing)
53 DNS Domain Name System (Lookups)
67, 68 DHCP Automatic IP Assignment
80 HTTP Unsecured Web Traffic
110 POP3 Post Office Protocol (Email)
143 IMAP Modern Email Retrieval
443 HTTPS Secure Web (Encrypted)
3389 RDP Remote Desktop Protocol
02.4 / Wireless

Wireless & Mobile

Wi-Fi Standards

From 802.11b to Wi-Fi 7 (802.11be). Trade-off between Range (2.4GHz) and Speed (5GHz/6GHz).

IEEE 802.11
2.4 GHz
Long Range
Slower
5 GHz
Med Range
Fast
6 GHz
Short Range
Ultra Fast
03 / Safety

Encryption & Security

Symmetric vs Asymmetric Encryption

Symmetric

Same key for encryption and decryption. Fast, but key exchange is risky.

AES, DES
Asymmetric (Public Key)

Public key encrypts, Private key decrypts. Foundation of SSL/TLS.

SSL/TLS Handshake
  1. Client sends "Hello" & ciphers.
  2. Server sends Public Key Certificate.
  3. Client verifies cert & sends Session Key.
  4. Switch to fast Symmetric encryption.
RSA, ECC

Interactive Encryption Box

// Output will appear here
Glossary

Key Definitions

Topology

The physical or logical layout of a network (e.g., Star, Mesh).

OSI Model

The Open Systems Interconnection model standardizing communication into 7 layers.

Encapsulation

The process of adding headers/footers to data as it moves down the protocol stack.

TCP/IP

Transmission Control Protocol/Internet Protocol. The foundational communication stack of the internet.

Packet

A formatted unit of data carried by a packet-switched network.

IP Address

A unique numerical label assigned to each device connected to a computer network.

DNS

Domain Name System. Translates domain names (google.com) to IP addresses.

HTTP/HTTPS

HyperText Transfer Protocol. Application layer protocol for transmitting web documents.

Encryption

The process of encoding information so only authorized parties can access it.

SSL/TLS

Secure Sockets Layer/Transport Layer Security. Protocols for establishing authenticated and encrypted links.

04 / Verification

Knowledge Check

Verify your understanding of Computer Network fundamentals. Pass the exam to earn your certificate.