Home

Computer Networks

Li

Li Wei

January 24, 202611 min read

Computer Networks

Preface

PDF version of these notes:

Chapter 1 Overview

Mind map: https://www.kdocs.cn/view/l/cqzI95zH7t6v
End‑of‑chapter exercises: https://www.kdocs.cn/view/l/cmCC5Updax17

The Role of Computer Networks in the Information Age

Key characteristics of the 21st century: digitization, networking, and informatization. The 21st century is an information age centered on networks.

Three common types of networks: telecommunications networks, cable TV networks, and computer networks.

Chinese translations of “Internet”:

  • 因特网 (Yīntèwǎng) – the literal transliteration “Internet”
  • 互联网 – a network formed by interconnecting a massive number of computer networks

The Internet has two important features:

  • Connectivity – users can exchange information easily regardless of distance, as if they were directly linked.
  • Sharing – refers to resource sharing (information, software, hardware).

Overview of the Internet

A Network of Networks
  • Network (computer network): consists of a number of nodes and the links that connect them.
  • Nodes include computers, hubs, switches, and routers.
  • Interconnected network (Internet): networks are linked together via routers, forming a larger computer network; thus the Internet is a “network of networks.”
  • The Internet: the largest global Internet today.

A network connects many computers; an inter‑network (Internet) connects many networks via routers. Computers attached to a network are called hosts.

Three Stages in the Development of Interconnection Infrastructure
  • Stage 1 – From a single network (ARPANET) to the Internet

    • The prototype: a single packet‑switched network, ARPANET.
    • In 1983, TCP/IP became ARPANET’s standard protocol.
    • internet (lowercase): a generic term for any collection of interconnected computer networks.
    • Internet (capitalized): the specific, global, open network that evolved from the U.S. ARPANET and uses the TCP/IP protocol suite.
  • Stage 2 – Three‑tier Internet

    • Three‑tier computer networks: backbone, regional, and campus (or enterprise) networks.
  • Stage 3 – Global, multi‑level ISP structure

    • ISP (Internet Service Provider) – organizations that provide Internet access.
    • Process:
      • ISPs obtain large blocks of IP addresses from the Internet governing body and own communication lines and routing equipment.
      • Any individual or organization that pays the ISP can obtain the right to use IP addresses and connect to the Internet through that ISP.
    • ISP hierarchy: backbone ISPs, regional ISPs, local ISPs.

Internet Exchange Points (IXP) allow two networks to connect directly and exchange packets without routing through a third network. IXPs typically use layer‑2 switches that are themselves interconnected via LANs.

World Wide Web (WWW)

The World Wide Web (also called “Web,” “WWW,” or “W3”) is a system of interlinked hypertext documents accessed via the Internet. Each useful item is a “resource” identified by a global Uniform Resource Identifier (URI). Resources are transferred to users via the Hypertext Transfer Protocol (HTTP); users retrieve them by clicking links. The World Wide Web Consortium (W3C) – founded in October 1994 at MIT’s Computer Science Lab by Tim Berners‑Lee, the Web’s inventor – develops Web standards. — Baidu Baike

Standardization Work for the Internet

Diagram

  • Internet Society (ISOC)
  • Internet Architecture Board (IAB)
  • Internet Engineering Task Force (IETF)
  • Internet Engineering Steering Group (IESG) – focuses on protocol development and standardization
  • Internet Research Task Force (IRTF)
  • Internet Research Steering Group (IRSG)
  • RFC (Request For Comments) – the series of documents that define standards

Three stages of Internet standardization:

  1. Internet Draft
  2. Proposed Standard
  3. Internet Standard

Components of the Internet

From a functional viewpoint, the Internet can be divided into two major parts:

  • Edge – all hosts directly connected to the Internet; the part users interact with.
  • Core – a massive collection of networks and the routers that interconnect them, providing connectivity and packet forwarding for the edge.

Edge Portion

End systems are the hosts at the edge of the Internet. Communication between end systems can follow:

  • Client‑Server (C/S) model
  • Peer‑to‑Peer (P2P) model

Client‑Server

  • Host A runs a client program; Host B runs a server program.
  • A sends a service request to B; B replies with the service. The client initiates communication and must know the server’s address; it requires no special hardware or OS.

Server

  • A program that provides a service and can handle multiple client requests simultaneously.
  • It starts automatically, runs continuously, and passively waits for client requests, so it does not need to know client addresses. Servers typically need powerful hardware and advanced OS support.

Peer‑to‑Peer (P2P)

  • As long as two hosts run P2P software, they can communicate on an equal footing.

Core Portion

The router plays a special role in the network core. It is a dedicated computer (not called a host) that implements packet switching: receiving packets and forwarding them onward. Routers in the core are usually linked by high‑speed links, while edge hosts connect to the core via relatively slower links.

Circuit Switching – In a telephone network with N phones, each pair would need a dedicated line, requiring N(N − 1)/2 wires, which grows quadratically with the number of phones. When the number of phones becomes large, a switch is used to handle the connections.

  • Circuit switching: each phone connects to a central switch, which establishes a dedicated path for the duration of a call. This method is connection‑oriented and proceeds in three phases:
    1. Connection establishment (resources allocated)
    2. Communication (resources held for the whole call)
    3. Connection release (resources freed)

Because computer data is bursty, circuit switching is usually inefficient for data networks.

Message Switching – The predecessor of packet switching. A whole message is transmitted as a single unit; the switching node stores the entire message before forwarding it, leading to longer forwarding delays and larger buffer requirements.

Packet Switching – Key characteristics:

  • Uses store‑and‑forward technique.
  • Connectionless (no dedicated path).
  • The Internet’s network layer is packet‑switched.

A message is the original data to be sent. At the sender, the message is broken into fixed‑length segments; each segment receives a header and becomes a packet (also called a “frame” or “datagram”). The header contains destination and source addresses and other control information.

Hosts process information for users; routers forward packets. Each packet travels independently through the network; the receiver strips the headers and reassembles the original message.

Router packet‑processing steps

  1. Place the incoming packet into a buffer (temporary storage).
  2. Look up the forwarding table to determine the appropriate outbound interface.
  3. Forward the packet out the selected interface.

Advantages of packet switching

... (details omitted for brevity)

Problems of packet switching

  • Queuing at each node introduces delay.
  • Header overhead consumes bandwidth.
  • No guarantee of end‑to‑end resource availability; heavy traffic can cause congestion.
  • Possible out‑of‑order delivery and loss.

Comparison

Switching type How data moves Connection orientation
Circuit switching Continuous bit stream from source to destination (like a pipe) Connection‑oriented
Message switching Whole message stored at each node, then forwarded Connectionless
Packet switching Individual packets stored then forwarded Connectionless

Choosing a switching method

  • For large, continuous data transfers where setup time is negligible, circuit switching can be efficient. However, computer data is typically bursty, making circuit switching’s link utilization low.
  • Message and packet switching avoid the need for a pre‑established connection, improving link utilization for bursty traffic.
  • Breaking a message into smaller packets (packet switching) yields lower latency than sending the whole message at once, prevents long‑duration link occupation, aids error control, and offers greater flexibility.

Types of Computer Networks

Definition

A computer network consists of general‑purpose, programmable hardware that is not dedicated to a single function (e.g., merely transmitting video). This programmable hardware can carry many kinds of data and support a wide, growing range of applications.

  • Programmable hardware: includes not only traditional computers but also smartphones; all such devices contain a CPU.
  • Applications: networks support many current and future applications, not just data transport.

Common Classifications
  • By switching method

    • Circuit switching
    • Message switching
    • Packet switching
  • By user base

    • Public networks (the Internet)
    • Private networks (military, railway, banking, etc.)
  • By transmission medium

    • Wireless
    • Wired
  • By geographic scope

    • WAN (Wide Area Network): tens to thousands of km
    • MAN (Metropolitan Area Network): 5–50 km
    • LAN (Local Area Network): ~1 km
    • PAN (Personal Area Network): ~10 m (including WPAN, Wireless PAN)

    When CPUs are only a meter or less apart, the system is usually called a multiprocessor system, not a computer network.

  • By topology

    • Bus
    • Star
    • Ring
    • Mesh

Performance of Computer Networks

Performance Metrics

Bit rate – The basic unit of data quantity in computers; a bit is a binary 0 or 1. Larger units: byte (B), kilobyte (KB), megabyte (MB), gigabyte (GB), terabyte (TB).

Data rate (also called bit rate) is the most important performance metric, measured in bits per second (bit/s, b/s, or bps). Common multiples: kb/s (kbps), Mb/s (Mbps), Gb/s (Gbps), Tb/s (Tbps). The quoted rate is usually the nominal (rated) rate, not the actual achieved throughput.

Bandwidth – Has two meanings:

  1. In signal theory, the width of the frequency band (Hz, kHz, MHz, GHz).
  2. In networking, the maximum data‑transfer capacity of a channel, expressed in bit/s.

Data rate = min [host interface rate, link bandwidth, router/switch interface rate] (the “bucket‑effect”).

Throughput – The amount of data actually transferred over a network (or link, interface) per unit time. It reflects real‑world performance and is limited by the network’s bandwidth or rated speed.

Delay – The time for a datum (packet, frame, or bit) to travel from one end of a link or network to the other. Delay components:

  • Transmission delay – Time to push all bits of a frame onto the link; depends on the interface’s data rate, not on link length.
  • Propagation delay – Time for a signal to travel through the medium; depends on distance and the medium’s propagation speed, not on data rate.
  • Processing delay – Time a router or host spends examining a packet’s header and making forwarding decisions.
  • Queuing delay – Time a packet spends waiting in buffers before being transmitted; varies with traffic load.

Total delay = transmission + propagation + processing + queuing.

A diagram (omitted) shows how to compute packet‑switching delay when processing and queuing delays are ignored.

Which component dominates depends on the specific scenario; higher transmission rates do not always mean lower total delay.

Important note: For high‑speed links we increase the sending rate, not the propagation speed of bits on the medium. Faster sending reduces transmission delay but leaves propagation delay unchanged.

Delay‑Bandwidth Product – The product of propagation delay and bandwidth; it represents the amount of data that can fill the “pipe” (link) in bits. When the pipe is full, the link is fully utilized.

Round‑Trip Time (RTT) – Time from when a sender transmits a packet until it receives the corresponding acknowledgment from the receiver, including all intermediate processing, queuing, and transmission delays.

Sending time = data length / sending rate
Effective data rate = data length / (sending time + RTT)

Utilization

  • Channel utilization: fraction of time a link is carrying data (0 % = idle).
  • Network utilization: weighted average of all links’ utilizations.

Higher utilization is not always better; queuing theory shows that as utilization rises, delay grows sharply.

When traffic is light, delay is modest; as traffic increases, queuing delay at routers/switches grows, inflating overall network delay. Under idealized assumptions, the relationship among idle delay (D_0), current delay (D), and utilization (U) can be expressed (formula omitted).

Packet loss rate – Can be measured at various levels: interface, network, node, path, and link. Loss occurs when:

  • A packet is corrupted and discarded by a router or destination host.
  • A router’s buffer is full and the packet is dropped according to its discard policy.

Typical loss‑rate ranges:

  • No congestion: 0 %
  • Light congestion: 1 %–4 %
  • Severe congestion: 5 %–15 %
Non‑Performance Characteristics
  • Cost
  • Quality
  • Standardization
  • Reliability
  • Scalability and upgradeability
  • Manageability and maintainability

Architecture

Formation of Structure

Computer networks are highly complex systems. Two computers communicating … (content truncated)


Originally written by Li Wei (李唯_) and published in Chinese on 后端技术栈全书 (Full-Stack Backend Engineering). Translated and adapted for DriftSeas with permission.

Keep reading

More related articles from DriftSeas.