Networking Basics

Computer Network

A Computer Network is a set of computers (nodes) connected together for the purpose of sharing resources (like internet access, databases, files, or printers) and communicating. The connections between nodes are established using either physical cable media (Ethernet, Fiber Optics) or wireless media (Wi-Fi, Cellular, Satellite).

1. Types of Networks

Networks are typically classified by their geographical size, scope, and ownership.

Network Classifications

  • LAN (Local Area Network): Covers a small geographic area, like a single home, office, or school building. Usually owned and managed by a single person or organization. Characterized by high data transfer speeds and high security.
  • WAN (Wide Area Network): Covers a broad area (e.g., across cities, countries, or continents). The Internet is the largest WAN. WANs connect multiple smaller LANs together, often leasing infrastructure from telecommunication providers (ISPs). They are generally slower and less secure than a LAN.
  • WLAN (Wireless LAN): A LAN that uses wireless network technology (Wi-Fi based on IEEE 802.11 standards) instead of cables.
  • MAN (Metropolitan Area Network): Larger than a LAN but smaller than a WAN, typically covering a city or a large university campus, often using fiber optic connections for high speed across the city.
  • VPN (Virtual Private Network): A secure, encrypted tunnel created over a public network (like the Internet) to allow remote users to access a private LAN securely as if they were physically present in the office.
Key Takeaways
  • LANs are localized, high-speed, privately-owned networks for small areas.
  • WANs connect LANs across vast geographical distances (like the global Internet) using public infrastructure.
  • VPNs provide secure, encrypted remote access to private networks over the public Internet.

2. Network Topologies

Topology refers to the physical or logical geometric arrangement of the nodes (computers, routers, switches) and links in a network.

Common Topologies

  • Star: All nodes are connected to a central hub or switch. If one cable fails, only that specific node goes down. If the central switch fails, the entire network goes down. (This is the most common topology in modern homes and offices).
  • Bus: All nodes share a single central cable (the backbone). Data sent by one node is broadcast to all others. If the main backbone cable breaks, the entire network fails. (Older, rarely used for data today, but common in industrial control systems).
  • Ring: Nodes are connected in a closed loop. Data travels in one direction (token passing). If one node or cable fails, the ring breaks and the network halts.
  • Mesh: Every node is connected to every other node (Full Mesh) or multiple specific nodes (Partial Mesh). It is highly reliable and fault-tolerant because data can dynamically route through multiple paths if one fails. It is very expensive and complex to wire. (The Internet itself is a massive partial mesh network).
Key Takeaways
  • Star topology is standard for modern LANs due to its centralized management and isolation of single-cable failures.
  • Mesh topology offers maximum redundancy and reliability by providing multiple routing paths, essential for critical infrastructure like the Internet.

3. Network Hardware Devices

To build these topologies, specific hardware devices are required to direct the flow of data.

Core Hardware

  • Switch: Operates within a LAN. It learns the physical MAC addresses of connected devices and intelligently forwards data only to the specific device it is intended for, reducing network congestion.
  • Router: Connects multiple different networks together (e.g., connecting your home LAN to the ISP's WAN). It reads IP addresses to determine the best path to forward data packets across the Internet.
  • Modem (Modulator-Demodulator): Converts digital signals from a computer/router into analog signals that can travel over telephone, cable, or fiber optic lines provided by an ISP, and vice versa.
  • NIC (Network Interface Card): The hardware component built into a computer/phone that allows it to connect to a network. Every NIC has a permanent, unique, factory-assigned physical address called a MAC (Media Access Control) address.

4. The OSI Model and TCP/IP Model

To ensure different computers (running different OSs on different hardware from different vendors) can communicate, networking follows strict, standardized conceptual frameworks. The OSI Model is a theoretical teaching tool, while the TCP/IP Model is the practical architecture used by the Internet today.

4.1 The 7-Layer OSI (Open Systems Interconnection) Model

OSI Layers (Top to Bottom)

  • 7. Application: The interface where user applications (like web browsers) interact with network services (HTTP, FTP, SMTP).
  • 6. Presentation: Handles data formatting, encryption (SSL/TLS), and compression so the application layer can understand it.
  • 5. Session: Establishes, maintains, and cleanly terminates communication sessions between two computers.
  • 4. Transport: Ensures reliable, ordered, and error-checked delivery of data packets (TCP/UDP) using port numbers.
  • 3. Network: Handles logical addressing (IP addresses) and calculates the best route to send data packets between different networks (Routers operate here).
  • 2. Data Link: Handles node-to-node data transfer within the same local network using physical MAC addresses (Switches operate here).
  • 1. Physical: The transmission of the raw bit stream (1s and 0s) over physical cables (voltage), fiber optics (light), or radio waves (Wi-Fi).

4.2 The 4-Layer TCP/IP Model

The modern Internet practically compresses the theoretical OSI model into four functional layers.

TCP/IP Layers

  • 4. Application (Combines OSI 5, 6, 7): High-level protocols like HTTP, DNS, and SSH.
  • 3. Transport (OSI 4): TCP (reliable, connection-oriented) or UDP (fast, connectionless).
  • 2. Internet (OSI 3): IP addressing and routing packets across the global web.
  • 1. Network Access (Combines OSI 1, 2): MAC addressing and physical hardware protocols like Ethernet or Wi-Fi.
Key Takeaways
  • The OSI Model provides a 7-layer theoretical framework for understanding and troubleshooting network communication from physical cables up to software applications.
  • The TCP/IP Model is the functional 4-layer architecture powering the Internet, relying heavily on the Transmission Control Protocol (TCP) and Internet Protocol (IP).

5. IP Addressing and Subnetting

While MAC addresses are permanent physical identifiers for hardware on a local network, IP (Internet Protocol) Addresses are logical, routable addresses assigned to devices so they can be found across the global Internet.

5.1 IPv4 vs. IPv6

IP Versions

  • IPv4: A 32-bit address. Formatted as four decimal numbers separated by dots (e.g., 192.168.1.5). Provides roughly 4.3 billion addresses, which the world has exhausted.
  • IPv6: A newer 128-bit address designed to solve the shortage. Formatted as eight groups of hexadecimal numbers separated by colons (e.g., 2001:0db8:85a3::8a2e:0370:7334). Provides an effectively infinite number of unique addresses.

5.2 Subnetting

Subnetting is the practice of dividing a single large IP network into smaller, logical sub-networks (subnets). This improves network performance (by containing noisy broadcast traffic) and enhances security. It is achieved using a Subnet Mask (e.g., 255.255.255.0), which applies a bitwise AND operation to split an IP address into two parts: the "Network ID" (which subnet it belongs to) and the "Host ID" (the specific device on that subnet).
Key Takeaways
  • IP addresses are the logical, routable identifiers for devices communicating across networks (Layer 3). MAC addresses are physical, local identifiers (Layer 2).
  • IPv4 is the older 32-bit standard, while IPv6 is the modern 128-bit standard solving global address exhaustion.
  • Subnetting divides networks logically to improve performance and security, using subnet masks to separate the Network ID from the Host ID.

6. Essential Network Protocols

A Protocol is a strict, standardized set of rules governing how data is formatted, transmitted, error-checked, and received across a network.

Standard Protocols

  • HTTP / HTTPS (Hypertext Transfer Protocol Secure): The foundation of the World Wide Web. Used to transfer web pages. HTTPS uses TLS/SSL to encrypt the data for security against eavesdropping.
  • DNS (Domain Name System): The "phonebook" of the Internet. It automatically translates human-readable domain names (like www.google.com) into the computer-readable IP addresses (like 142.250.190.46) required by routers.
  • DHCP (Dynamic Host Configuration Protocol): Automatically assigns IP addresses, subnet masks, and default gateways to devices the moment they join a network, eliminating the need for manual configuration.
  • TCP (Transmission Control Protocol): Operates at the Transport Layer. It guarantees that all data packets arrive intact and in the correct order by requiring acknowledgments from the receiver. If a packet is lost, it is retransmitted. Used for web browsing, emails, and file downloads.
  • UDP (User Datagram Protocol): Also operates at the Transport Layer. It is "fire-and-forget." It sends data as fast as possible but does not guarantee delivery or order. If a packet is dropped, it is ignored. Used for live video streaming, VoIP calls, and fast-paced online gaming where speed is more critical than perfect accuracy.
Key Takeaways
  • Protocols are strict rules that allow vastly different hardware and operating systems to seamlessly understand each other.
  • DNS translates human-friendly URLs into IP addresses required for routing. DHCP automates IP assignment.
  • TCP ensures highly reliable, ordered data delivery, while UDP prioritizes low-latency speed over reliability.

Summary

Key Takeaways
  • Networks connect computers to share resources, categorized by size (LAN, WAN, MAN) and security (VPN).
  • Topologies define the physical layout (Star, Mesh, Bus), built using hardware like Switches (MAC addressing) and Routers (IP routing).
  • The OSI (7-layer) and TCP/IP (4-layer) models standardize how data is transmitted from applications down to physical wires.
  • IP Addressing provides logical locations (IPv4 vs IPv6), and Subnetting divides networks efficiently using masks.
  • Protocols like HTTP (web), DNS (naming), DHCP (configuration), and TCP/UDP (transport) govern specific data formatting and delivery rules.