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.
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.
Network Types
Networks are classified by their geographical scope, from a few meters (PAN) to the entire globe (WAN).
PAN
PersonPersonal Area Network. Smallest range (approx. 10m). Connects personal devices.
LAN
LocalLocal Area Network. Connects devices in a single location like a home, office, or building. High speed.
WLAN
WirelessWireless LAN. Uses radio waves to connect devices without cables. Flexible but subject to interference.
CAN
CampusCampus Area Network. Interconnects multiple LANs within a specific area like a university or military base.
MAN
MetroMetropolitan Area Network. Spans an entire city or large campus. Connects multiple LANs.
WAN
WideWide Area Network. Spans countries or continents. The Internet is the largest WAN.
SAN
StorageStorage Area Network. High-speed network providing block-level access to storage. Appears as local drives.
VPN
VirtualVirtual Private Network. Extends a private network across a public one (Internet). Encrypted tunnel.
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?").
Select a Layer
Interact with the stack on the left to explore each layer's specific responsibilities in the network model.
Encapsulation
As data moves down the stack, each layer adds a "Header" (and sometimes a Footer). This process is called Encapsulation.
Data Link Control & Access
Ensuring data integrity and managing how devices share the communication medium.
Error Detection
Block Coding
Data is divided into blocks. Redundant bits are added to each block to check validity.
- Parity Check (Simple)
- Hamming Code (Correction)
Type bits. Box shows Even Parity bit.
Cyclic Codes (CRC)
Uses binary division. Append Checksum bits so the resulting frame is divisible by a predefined polynomial.
Checksum
Used in higher layers (TCP/IP). The sender sums up data segments (using 1's complement) and sends the result. Receiver repeats the sum; if result is all 1s, data is valid.
Media Access Control (MAC)
CSMA/CD Simulation
| Category | Method | Mechanism |
|---|---|---|
| Random Access | CSMA/CD | Sense carrier. If collision, back off random time. (Ethernet) |
| Random Access | CSMA/CA | Collision Avoidance using RTS/CTS signals. (Wi-Fi) |
| Controlled | Reservation | Stations reserve time slots before sending. |
| Controlled | Polling | Primary device asks Secondary devices if they have data. |
| Controlled | Token Passing | Token circulates. Only token holder can send. (Token Ring) |
PPP (Point-to-Point Protocol)
Direct connection between two nodes. Handles authentication (PAP/CHAP), encryption, and compression. Commonly used in ISP connections.
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:
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.
Virtual Circuit
Connection-oriented. A pre-defined path is established before data transfer. All packets follow the same path.
IP Addressing (IPv4 vs IPv6)
IPv4 Packet Header
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)
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)
Distance Vector (DVR)
Bellman-Ford Algorithm. Routers define path by "Distance" (Metric) and "Vector" (Direction/Next Hop).
Link State (LSR)
Dijkstra's Algorithm. Every router knows the complete graph (topology) of the network.
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.
Key Protocols
Interactive DNS Resolver
HTTP / HTTPS
HyperText Transfer Protocol. Application layer protocol for transmitting hypermedia documents (HTML).
Status Codes
DHCP
Dynamic Host Configuration Protocol. Automatically assigns IP addresses to devices on a network.
Telnet
Port 23Telecommunications Network. Older protocol for remote login. Unlike SSH, it is insecure (plaintext).
SSH
Port 22Secure Shell. Cryptographic protocol for operating network services securely over an unsecured network. Used for remote login.
FTP
Port 21File Transfer Protocol. Standard protocol used for the transfer of computer files between a client and server.
SMTP
Port 25Simple Mail Transfer Protocol. The standard for sending emails across the Internet.
IMAP
Port 143Internet Message Access Protocol. Used by email clients to retrieve messages from a mail server.
RDP
Port 3389Remote 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 |
Wireless & Mobile
Wi-Fi Standards
From 802.11b to Wi-Fi 7 (802.11be). Trade-off between Range (2.4GHz) and Speed (5GHz/6GHz).
Encryption & Security
Symmetric vs Asymmetric Encryption
Symmetric
Same key for encryption and decryption. Fast, but key exchange is risky.
Asymmetric (Public Key)
Public key encrypts, Private key decrypts. Foundation of SSL/TLS.
- Client sends "Hello" & ciphers.
- Server sends Public Key Certificate.
- Client verifies cert & sends Session Key.
- Switch to fast Symmetric encryption.
Interactive Encryption Box
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.
Knowledge Check
Verify your understanding of Computer Network fundamentals. Pass the exam to earn your certificate.