Networking Basics
Learning Objectives
- Define what a computer network is and identify its core purposes.
- Classify networks by scale (LAN, WAN, MAN, VPN).
- Understand physical and logical network topologies (Star, Mesh, Ring, Bus).
- Identify and describe the functions of core network hardware devices (Switches, Routers, Modems).
- Compare and contrast the OSI and TCP/IP reference models.
- Differentiate between MAC and IP addressing.
- Explain the basics of IPv4, IPv6, Subnetting (CIDR), and Network Address Translation (NAT).
- Define essential network protocols including HTTP, DNS, DHCP, TCP, UDP, ARP, FTP, and SMTP.
A comprehensive guide to computer networks, the OSI and TCP/IP models, IP addressing, subnetting, hardware, and standard protocols like DNS and HTTP.
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.
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.
Interact with the simulation below to observe how data packets are routed across a network from a sender to a receiver.
Packet Switching
How data travels across a network from source to destination.
2. Network Topologies
Topology refers to the physical or logical geometric arrangement of the nodes (computers, routers, switches) and links in a network.
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).
3. Network Hardware Devices
To build these topologies, specific hardware devices are required to direct the flow of data.
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 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
- 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.
- 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.
IP Address
An IP (Internet Protocol) Address is a logical, routable address assigned to devices so they can be found across the global Internet. While MAC addresses are physical and permanent, IP addresses are logical and can change depending on the network the device is connected to.
MAC Address
A MAC (Media Access Control) Address is a unique identifier assigned to a network interface controller (NIC) for use as a network address in communications within a network segment (Data Link Layer).
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.
5. IP Addressing, Subnetting, and NAT
5.1 IPv4 vs. IPv6
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 and CIDR Notation
Subnetting 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). Modern subnetting often uses CIDR (Classless Inter-Domain Routing) notation, representing the subnet mask by a slash followed by the number of network bits (e.g., 192.168.1.0/24 means the first 24 bits represent the network).
5.3 NAT (Network Address Translation)
Because of the IPv4 exhaustion, NAT is used heavily. NAT allows a router to map multiple private IP addresses (used inside a LAN) to a single public IP address (used on the Internet). When a device on the LAN wants to talk to the Internet, the router translates the private IP to the public IP, keeping track of the connections so the response can be routed back to the correct internal device.
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.
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 (like142.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.
ARP (Address Resolution Protocol): Maps a logical IP address to a physical MAC address on a local network segment, essential for Layer 3 devices (routers) communicating with Layer 2 devices (switches).
FTP (File Transfer Protocol): A standard network protocol used for the transfer of computer files between a client and server on a computer network.
SMTP, POP3, and IMAP: SMTP (Simple Mail Transfer Protocol) is used for sending emails. POP3 (Post Office Protocol version 3) and IMAP (Internet Message Access Protocol) are used for receiving emails.
- 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.
- 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.
- 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).
- 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 and CIDR notation to separate the Network ID from the Host ID.
- NAT allows multiple private IP addresses to share a single public IP address, mitigating IPv4 exhaustion.
- 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.