Fundamentals 23 min read

Master the Essentials of Computer Networks: From Physical Layer to Application

This comprehensive guide walks through computer networking fundamentals, covering network classifications, layered architectures, key protocols across the physical, data link, network, transport, and application layers, as well as performance metrics, addressing, routing, and security considerations.

Open Source Linux
Open Source Linux
Open Source Linux
Master the Essentials of Computer Networks: From Physical Layer to Application

1. Overview of Computer Networks

Computer networks enable communication between devices and are categorized by scope (WAN, MAN, LAN) and by users (public networks, private networks).

1.1 Classification of Computer Networks

Based on the range of operation: Wide Area Network (WAN), Metropolitan Area Network (MAN), Local Area Network (LAN). Based on users: public networks and private networks.

1.2 Layered Architecture of Computer Networks

The TCP/IP four‑layer model and the OSI seven‑layer model are compared to illustrate the hierarchical design of networking protocols.

1.3 Basic Principles of Layered Design

Each layer operates independently.

Each layer must provide sufficient flexibility.

Layers are completely decoupled.

1.4 Performance Metrics of Computer Networks

Rate measured in bits per second (bps); delay includes transmission, propagation, queuing, and processing delays; round‑trip time (RTT) is the time for a packet to travel from source to destination and back.

2. Physical Layer

The physical layer connects different physical devices and transmits bit streams, providing a reliable physical medium for upper‑layer protocols.

Key physical‑layer devices include repeaters (amplifiers) that regenerate signals within the same LAN, and hubs (multi‑port repeaters) that operate in half‑duplex mode without separating collision or broadcast domains.

A communication channel is a medium that carries information in one direction; a full communication circuit consists of a sending channel and a receiving channel.

Simplex channel: one‑way communication only.

Half‑duplex channel: two‑way communication but not simultaneous.

Full‑duplex channel: simultaneous two‑way communication.

3. Data Link Layer

3.1 Overview of the Data Link Layer

The data link layer offers reliable transmission of frames between adjacent nodes, building on the services of the physical layer.

Its main functions include physical address mapping, framing, flow control, error detection, and retransmission.

3.2 Error Detection in the Data Link Layer

Error detection methods include parity checks (limited to single‑bit errors) and cyclic redundancy check (CRC) codes.

3.3 Maximum Transmission Unit (MTU)

MTU limits the maximum size of a data link layer frame; the path MTU is determined by the smallest MTU along the route.

3.4 Ethernet Protocol Details

Each device has a unique 48‑bit MAC address expressed in hexadecimal. Ethernet (IEEE 802.3) is a widely used LAN technology that provides high data rates, low hardware cost, and simple frame structure.

Ethernet Frame Structure

Type field (2 bytes) identifies the upper‑layer protocol.

Destination and source MAC addresses (6 bytes each).

Payload data (46–1500 bytes).

CRC (4 bytes) for error detection.

Minimum Ethernet frame length is 64 bytes.

MAC Address Characteristics

Length: 6 bytes (48 bits).

Globally unique per network interface.

Typically represented in hexadecimal separated by colons or hyphens.

Broadcast MAC address: FF‑FF‑FF‑FF‑FF‑FF.

4. Network Layer

The network layer provides transparent data transfer between end systems, handling addressing, routing, connection establishment, maintenance, and termination.

The core protocol is the Internet Protocol (IP), which offers an unreliable, connectionless service for packet delivery, routing, and error control. Supporting protocols include ARP, RARP, ICMP, and IGMP.

IP packets are the basic data unit.

Routers are the primary devices.

4.1 Detailed IP Protocol

IP creates a virtual interconnection of heterogeneous physical networks, allowing hosts to communicate without concern for underlying differences.

Key header fields: version (IPv4/IPv6), header length, total length, TTL, protocol identifier (e.g., TCP, UDP), source and destination addresses.

4.2 IP Forwarding Process

Routers examine the destination IP address, consult routing tables, and forward packets toward the next hop.

4.3 Subnetting and Address Classes

Class A (8‑bit network, 24‑bit host), Class B (16‑bit network, 16‑bit host), Class C (24‑bit network, 8‑bit host) are used to identify hosts and routers; Class D is for multicast, Class E is reserved.

4.4 Network Address Translation (NAT)

NAT allows multiple private hosts to share a single public IP address, reducing address consumption while adding complexity to communication.

4.5 ARP and RARP

ARP maps IPv4 addresses to MAC addresses dynamically; RARP performs the reverse mapping from MAC to IP.

4.6 ICMP Protocol Details

ICMP reports errors and abnormal conditions; its messages are encapsulated within IP packets. Common uses include ping for fault diagnosis and traceroute for path discovery.

4.7 Routing Overview

Routing algorithms must be correct, complete, computationally simple, adaptable, stable, and fair. Autonomous Systems (AS) group routers under a common administration; internal routing protocols (e.g., RIP, OSPF) operate within an AS, while external protocols (e.g., BGP) operate between ASes.

4.8 RIP Protocol

RIP is a distance‑vector protocol using hop count as its metric, suitable for small networks (max 15 hops) and exchanges updates every 30 seconds.

4.9 OSPF Protocol

OSPF is a link‑state protocol based on Dijkstra’s algorithm, suitable for large ASes, supporting multiple equal‑cost paths, hierarchical routing, and both unicast and multicast.

4.10 BGP Protocol

BGP is an external gateway protocol that operates over TCP, exchanging full routing tables initially and incremental updates thereafter.

5. Transport Layer

The transport layer segments upper‑layer data and provides reliable or unreliable end‑to‑end delivery, along with flow and error control.

5.1 UDP Protocol Details

UDP is a simple, connectionless, message‑oriented protocol with no congestion control and minimal header overhead (8 bytes).

UDP Datagram Structure

Header fields: source port, destination port, length, checksum; followed by application data.

5.2 TCP Protocol Details

TCP is a complex, connection‑oriented, byte‑stream protocol that ensures reliable data transfer through sequencing, acknowledgments, flow control, and congestion control.

TCP Functions

Segmentation and reassembly of application data.

Multiplexing/demultiplexing.

End‑to‑end flow control.

Congestion control.

Transport‑layer addressing.

Error detection for header and data.

Reliable inter‑process communication.

TCP Characteristics

Connection‑oriented.

Byte‑stream service.

Point‑to‑point communication.

Provides reliable transmission.

Full‑duplex communication.

TCP Segment Structure

Maximum segment length is limited by the receiver’s advertised window; the header is at least 20 bytes and up to 60 bytes, aligned to 4‑byte boundaries.

5.3 Reliable Transmission Principles

Reliability over unreliable channels is achieved through error detection, acknowledgments, retransmission, sequencing, and timers. Protocols include Stop‑and‑Wait and sliding‑window ARQ (e.g., Go‑Back‑N, Selective Repeat).

5.4 TCP Congestion Control

Congestion control differs from flow control by managing network‑wide load. It uses slow start, congestion avoidance, fast retransmit, and fast recovery algorithms.

5.5 TCP Three‑Way Handshake

Establishes a connection using SYN, SYN‑ACK, and ACK messages to synchronize sequence numbers.

5.6 TCP Four‑Way Teardown

Terminates a connection with FIN, ACK, FIN, ACK exchanges, followed by a 2 MSL wait to ensure all packets have expired.

6. Application Layer

The application layer provides interfaces for network services to operating systems and applications.

6.1 DNS Details

DNS translates human‑readable domain names to IP addresses using a hierarchical lookup process (browser cache, hosts file, router cache, DNS servers).

6.2 DHCP Details

DHCP dynamically assigns IP addresses to hosts on a LAN using UDP.

6.3 HTTP Details

HTTP is a reliable, TCP‑based protocol for transferring hypertext; common request methods include GET, POST, DELETE, HEAD, OPTIONS, and PUT.

6.3.1 HTTP Operation Structure

Illustrates the request/response exchange between client and server.

6.3.2 HTTPS Details

HTTPS secures HTTP traffic using SSL/TLS on port 443, providing encryption, authentication, and data integrity.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

TCP/IPNetwork ProtocolsOSI modelComputer Networksnetwork layers
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.