Networking Basics: How Computers Communicate
Computer networking is the practice of interconnecting devices to share data and resources. From a two-node home network to the global internet connecting billions of devices, networking follows a set of principles that define how data is formatted, addressed, transmitted, and received. This guide covers the essential building blocks: network components, encapsulation and the protocol stack, addressing at multiple layers, packet switching, and the difference between key networking concepts that beginners often confuse.
What Is a Network?
A network is two or more devices connected by a transmission medium that exchange data according to agreed-upon rules (protocols). Networks are classified by geographic scope: Personal Area Network (PAN, a few meters — Bluetooth, USB), Local Area Network (LAN, a building — Ethernet, Wi-Fi), Campus Area Network (CAN, multiple buildings on one site), Metropolitan Area Network (MAN, a city), and Wide Area Network (WAN, inter-city or inter-continental — leased lines, MPLS, internet).
Network Components
End devices generate and consume data: computers, servers, smartphones, printers, IoT sensors. Intermediate devices forward data: switches (forward within a LAN based on MAC address), routers (forward between networks based on IP address), access points (bridge wireless and wired networks), and firewalls (filter traffic based on security policy). Network media carries the signal: copper cable (electrical pulses), fiber optic cable (light pulses), or radio waves (wireless).
Collision and Broadcast Domains
In legacy Ethernet (hub-based, half-duplex), a collision domain was the set of devices that could transmit simultaneously and cause a collision. Switches eliminate collision domains by providing dedicated bandwidth to each port. A broadcast domain is the set of devices that receive a broadcast frame (destination MAC FF:FF:FF:FF:FF:FF). Routers bound broadcast domains — broadcasts do not cross layer-3 boundaries. Large broadcast domains degrade performance because every device must process every broadcast.
How Data Travels: Encapsulation
Data transmission follows a layered model. Each layer adds a header (and sometimes a trailer) containing control information for that layer. This process is called encapsulation.
- Application data (e.g., an HTTP request) is handed to the transport layer.
- The transport layer adds a TCP or UDP header (source and destination port, sequence number, checksum). The result is a segment (TCP) or datagram (UDP).
- The network layer adds an IP header (source/destination IP). The result is a packet.
- The data link layer adds a frame header (MAC addresses, frame type) and a frame check sequence trailer. The result is a frame.
- The physical layer encodes the frame as bits or light pulses on the medium.
On the receiving side, each layer strips its header and passes the payload upward. This layering enables independent evolution — applications do not need to know whether the underlying medium is copper, fiber, or radio.
Addressing
Communication requires addresses at multiple layers. MAC addresses (48 bits, burned into each network interface) identify devices on the same layer-2 segment. Switches use MAC addresses to forward frames to the correct port. IP addresses (32 bits for IPv4, 128 bits for IPv6) identify devices across networks. Routers use IP addresses to forward packets toward the destination. Port numbers (16 bits, 0-65535) identify specific applications or services on a host. A web server listens on port 80 (HTTP) or 443 (HTTPS). A complete connection is defined by the tuple (source IP, source port, destination IP, destination port, protocol).
Packet Switching
Networks use packet switching rather than circuit switching. In circuit switching (the telephone network), a dedicated path is established for the duration of the call. In packet switching, data is broken into packets that are forwarded independently. Each packet contains the full destination address. Packets may take different paths, arrive out of order, be delayed, or be lost — the transport layer (TCP) handles reassembly and retransmission. Packet switching achieves far higher link utilization than circuit switching because links are not reserved for idle connections.
Duplex and Speed
Half-duplex allows transmission in only one direction at a time (e.g., 10BASE-T with hubs, two-way radios). Full-duplex allows simultaneous bidirectional transmission — all modern Ethernet (switched) operates full-duplex. Auto-negotiation (IEEE 802.3ab) automatically selects the highest common speed and duplex mode. A duplex mismatch — one side is full, the other half — causes severe performance degradation (late collisions, CRC errors) and is one of the most common configuration errors in legacy networks.
Network Services
Beyond basic connectivity, networks provide essential services that end devices depend on. DHCP dynamically assigns IP addresses, subnet masks, default gateways, and DNS server addresses — without DHCP, every device would require manual static configuration. DNS translates human-readable domain names to IP addresses, making services reachable by name. NTP synchronizes device clocks across the network, critical for log correlation, authentication protocols (Kerberos requires time synchronization within 5 minutes), and security certificate validation. These services are themselves delivered over the network: DHCP uses UDP broadcasts on ports 67/68, DNS uses UDP/TCP on port 53, and NTP uses UDP on port 123.
Bandwidth, Throughput, and Latency
Bandwidth is the maximum possible data rate of a link (e.g., 1 Gbps). Throughput is the actual measured data rate, which is lower due to protocol overhead, congestion, and errors. Goodput is the application-layer data rate after all headers are removed. Latency is the time for a bit to travel from source to destination, composed of propagation delay (distance ÷ speed of signal in the medium), serialization delay (frame size ÷ bit rate), processing delay (router/switch forwarding), and queuing delay (congestion). For real-time applications (voice, video), latency matters more than bandwidth — a 100 ms round trip degrades conversation; 300 ms is unusable.
Quality of Service
Quality of Service (QoS) prioritizes certain traffic when the link is congested. Voice and video traffic is marked with DSCP EF (Expedited Forwarding). Best-effort bulk data is marked DF (Default Forwarding). Routers and switches implement queuing disciplines: strict priority (all EF traffic goes first), weighted fair queuing (WFQ), or class-based WFQ. Without QoS, a bulk file transfer can saturate a link and cause VoIP calls to break up. QoS is essential on WAN links where bandwidth is expensive and limited.
Network Documentation
Every network should be documented at three levels: a logical diagram showing IP subnets, routing protocols, and interconnections; a physical diagram showing device locations, cabling patching, and power feeds; and an IP address management spreadsheet or database tracking assigned addresses, VLANs, and device names. Without documentation, troubleshooting a network outage becomes a process of discovery — an operator tracing cables through ceiling spaces and reverse-engineering configuration. NetBox, Draw.io (with network shape libraries), and LibreNMS are popular free tools for maintaining living documentation.
FAQ
Q: What is the difference between a hub, a switch, and a router?
A: A hub is a layer-1 device that repeats all bits out all ports — all devices share the same collision domain. A switch is a layer-2 device that forwards frames based on MAC addresses — each port is its own collision domain. A router is a layer-3 device that forwards packets based on IP addresses — it connects different networks and bounds broadcast domains.
Q: Why is my download speed slower than my internet plan?
A: Several factors: Wi-Fi overhead (30-50 percent of throughput lost to protocol overhead and interference), server-side limits, VPN encryption, simultaneous use by other devices, and the difference between megabits (Mbps) and megabytes (MB/s — 1 MB/s = 8 Mbps).
Q: What does “symmetric” vs. “asymmetric” mean for internet connections?
A: Symmetric provides equal upload and download speeds (typical for business fiber). Asymmetric offers faster download than upload (typical for residential cable/DSL). Asymmetric is cheaper but problematic for video conferencing, remote backups, or hosting services.
Q: What is the difference between TCP and UDP in practice?
A: TCP ensures data arrives complete and in order — used for web pages, email, file transfers. UDP sends data with no guarantees — used for streaming, gaming, VoIP, and DNS queries where speed is prioritized over reliability.
Q: Should I use a /24 or /16 subnet for my office?
A: Use the smallest subnet that accommodates your devices with room for growth. A /24 (254 usable addresses) is enough for most small offices. Using a /16 (65,534 addresses) unnecessarily large increases broadcast traffic and makes troubleshooting more difficult.
Internal Links
- OSI Model Guide — deeper exploration of the seven-layer model
- TCP/IP Protocol Suite Guide — details on TCP, UDP, IP, and application protocols
- Network Topologies — how physical and logical layouts affect performance
References
- RFC 1122, “Requirements for Internet Hosts — Communication Layers”
- IEEE 802.3-2022, “Ethernet Standard”
- Kurose, J. F. and Ross, K. W., Computer Networking: A Top-Down Approach, 8th ed., Pearson, 2021, Chapter 1 (“Computer Networks and the Internet”)
- Tanenbaum, A. S. and Wetherall, D. J., Computer Networks, 6th ed., Pearson, 2021, Chapter 1 (“Introduction”)
- Cisco. “Cisco Networking Academy: Introduction to Networks.” NetAcad. https://www.netacad.com/
For a comprehensive overview, read our article on Cabling Standards.
For a comprehensive overview, read our article on Cdn Guide.