Mastering Computer Networks: From Physical Layer to Application Protocols
This article provides a comprehensive, layer‑by‑layer overview of computer networking, covering network classifications, OSI/TCP‑IP models, physical and data‑link devices, IP addressing and routing, transport‑layer protocols such as TCP and UDP, and key application‑layer services like DNS, DHCP, HTTP and HTTPS.
Computer Network Overview
A computer network combines computing and communication technologies to enable data exchange between devices. It underpins telephone, television, and internal biological networks as well.
1. Network Classification and Layered Architecture
By scope: WAN, MAN, LAN.
By users: public networks and private networks.
The TCP/IP four‑layer model (Link, Internet, Transport, Application) is often compared with the OSI seven‑layer model. Each layer should be independent, flexible, and fully decoupled.
1.3 Design Principles for Layered Architecture
Layers are mutually independent.
Each layer provides sufficient flexibility.
Layers are completely decoupled.
1.4 Performance Metrics
Data rate (bits per second).
Delays: transmission, propagation, queuing, processing.
Round‑trip time (RTT).
2. Physical Layer
The physical layer connects devices and transmits raw bit streams, offering a reliable medium for upper‑layer protocols.
Repeater (amplifier): regenerates signals within the same LAN; follows the 5‑4‑3 rule for 10BASE‑5 Ethernet.
Hub: a multi‑port repeater operating in half‑duplex; cannot separate collision or broadcast domains.
Simplex – one‑way communication.
Half‑duplex – two‑way but not simultaneous.
Full‑duplex – simultaneous two‑way communication.
3. Data Link Layer
3.1 Overview
Provides reliable transmission over an unreliable physical medium. Core services include physical‑address addressing, framing, flow control, error detection, and retransmission.
3.2 Error Detection
Common techniques: parity check (detects single‑bit errors) and cyclic redundancy check (CRC) codes.
3.3 Maximum Transmission Unit (MTU)
Frames are limited by the MTU; the path MTU is the smallest MTU on a given route.
3.4 Ethernet Protocol Details
Each Ethernet interface has a unique 48‑bit MAC address expressed in hexadecimal.
Type (2 bytes) – identifies the upper‑layer protocol.
Destination MAC (6 bytes) and Source MAC (6 bytes).
Payload – encapsulated upper‑layer packet (46–1500 bytes).
CRC (4 bytes) – error‑checking code.
Minimum frame size: 64 bytes (including 18 bytes header and 46 bytes data).
Length: 6 bytes (48 bits).
Globally unique per network interface.
Written as six hexadecimal pairs separated by colons or hyphens.
Broadcast address: FF‑FF‑FF‑FF‑FF‑FF.
4. Network Layer
The network layer provides end‑to‑end data transport, handling addressing, routing, connection management, and congestion control. The core protocol is IP.
4.1 IP Protocol Details
Key header fields:
Version (IPv4 or IPv6) – 4 bits.
Header Length (IHL) – 4 bits, specifies header size.
Total Length – 16 bits, total packet size.
Time‑to‑Live (TTL) – 8 bits, limits packet lifespan.
Protocol – identifies encapsulated transport protocol (e.g., TCP = 6, UDP = 17).
Source and Destination IP addresses – 32 bits (IPv4) or 128 bits (IPv6).
4.2 IP Forwarding Process
Routers examine the destination IP, consult their routing table, and forward the packet to the next hop.
4.3 Subnetting
Classful addressing (A: 8‑24‑8, B: 16‑16‑16, C: 24‑8‑8) and CIDR allow flexible division of network and host bits. Class D is reserved for multicast, Class E for future use.
4.4 Network Address Translation (NAT)
NAT maps multiple private IP addresses to a single public IP, maintaining a translation table to rewrite source or destination addresses on outbound and inbound traffic.
4.5 ARP and RARP
ARP dynamically maps an IP address to its MAC address; RARP performs the reverse mapping.
4.6 ICMP
ICMP carries error messages and diagnostic information (e.g., ping, traceroute) encapsulated within IP packets.
4.7 Routing Overview
Routing algorithms must be correct, complete, computationally simple, adaptable, stable, and fair. Autonomous Systems (AS) use interior gateway protocols (IGP) such as RIP and OSPF, and exterior gateway protocols (EGP) such as BGP.
4.8 RIP Protocol
Distance‑vector algorithm based on hop count.
Maximum path length 15 hops.
4.9 OSPF Protocol
Link‑state algorithm using Dijkstra’s shortest‑path computation.
Scales to large ASes.
4.10 BGP Protocol
Border Gateway Protocol operates between ASes, exchanging a full routing table initially and incremental updates thereafter, using TCP as its transport.
5. Transport Layer
5.1 UDP Details
Connectionless, no delivery guarantee.
Message‑oriented.
No congestion control.
Header (8 bytes): source port, destination port, length, checksum.
5.2 TCP Details
Segments and reassembles application data.
Provides reliable, ordered delivery.
Implements flow control via a sliding window.
Implements congestion control (slow start, congestion avoidance, fast retransmit, fast recovery).
5.2.1 Three‑Way Handshake
1. Client → Server: SYN=1, seq=x</code>
<code>2. Server → Client: SYN=1, ACK=1, seq=y, ack=x+1</code>
<code>3. Client → Server: ACK=1, seq=x+1, ack=y+1After the third step the connection enters ESTABLISHED state.
5.2.2 Four‑Way Termination
1. Client → Server: FIN=1, seq=x</code>
<code>2. Server → Client: ACK=1, seq=y, ack=x+1</code>
<code>3. Server → Client: FIN=1, seq=y+1, ACK=1, ack=x+1</code>
<code>4. Client → Server: ACK=1, seq=x+1, ack=y+2The client then waits for 2 MSL before moving to CLOSED.
5.3 Reliable Transmission Principles
Reliability over an unreliable channel is achieved through error detection, acknowledgments, retransmission, sequencing, and timers. Stop‑and‑wait is simple but inefficient; sliding‑window (continuous ARQ) greatly improves channel utilization.
5.4 Flow Control
TCP uses a sliding window to ensure the sender does not overwhelm the receiver.
5.5 Congestion Control
Key mechanisms:
Slow start – congestion window (cwnd) grows exponentially from 1 MSS.
Congestion avoidance – cwnd increases linearly after reaching the slow‑start threshold (ssthresh).
Fast retransmit – after receiving three duplicate ACKs, the sender retransmits the missing segment without waiting for a timeout.
Fast recovery – sets ssthresh to half of the current cwnd and enters congestion avoidance.
6. Application Layer
6.1 DNS
Domain Name System translates human‑readable domain names to IP addresses. Resolution order: browser cache → hosts file → router cache → recursive/iterative DNS queries to authoritative servers (port 53/UDP).
6.2 DHCP
Dynamic Host Configuration Protocol automatically assigns IP addresses, subnet masks, gateways, and DNS servers to hosts on a LAN using UDP (port 67/68).
6.3 HTTP and HTTPS
HTTP is a reliable request/response protocol over TCP (port 80). Common methods: GET, POST, DELETE, HEAD, OPTIONS, PUT. HTTPS adds SSL/TLS encryption on top of HTTP (port 443) to provide confidentiality, integrity, and server authentication.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architects' Tech Alliance
Sharing project experiences, insights into cutting-edge architectures, focusing on cloud computing, microservices, big data, hyper-convergence, storage, data protection, artificial intelligence, industry practices and solutions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
