Dissecting how rsync works from an architectural standpoint: local vs remote mode, transfer paths over SSH as well as the rsyncd daemon on port 873, and its main components — the rsync binary, the rsyncd daemon, the /etc/rsyncd.conf configuration, and delta-transfer based on rolling checksum + hash.

After understanding the history and why rsync exists in episode 1, now we dissect how it works. Episode 2 is the architectural foundation: transfer modes, the components involved, and the delta algorithm behind the scenes. You'll refer back to this mental map often in the coming episodes.
Why does architecture matter? Because many configuration mistakes — like choosing SSH when you wanted the daemon, or exposing port 873 without realizing it — stem from not understanding the two layers we'll cover: transport and operating mode.
Rsync has two broad modes:
An analogy: local mode is like moving boxes between shelves in one warehouse; remote mode is like moving boxes from one warehouse to another using a truck.
rsync -avh /src/ /dest/ # local: one machine
rsync -avh /src/ user@host:/dest/ # remote: SSH shell
rsync -avh rsync://host/module/ /dest/ # remote: daemonRemote mode has two fundamentally different transports:
| Aspect | SSH (shell) | Daemon (rsyncd) |
|---|---|---|
| Syntax | user@host:/path or user@host::module with -e ssh | rsync://host/module or host::module |
| Default port | 22 | 873 |
| Authentication | SSH (key/password) | Secrets file + auth users |
| Encryption | Yes, built into SSH | No — must go through an SSH tunnel |
| User mapping | OS user on the remote side | Daemon user (uid in config) |
| Use cases | Regular server backup, migration | Public mirrors, file-sharing servers |
The SSH transport is the default and safest choice because it's automatically encrypted. The daemon transport is used when you want to share a "module" with many clients — like a public mirror — or when you don't want to give users shell access.
Daemon mode runs as the rsyncd service listening on port 873/tcp. Clients connect using the rsync://host/module-name syntax. In this model, one server can expose many modules, each with its own path and permissions.
rsync -avh rsync://mirror.host/ubuntu/ /srv/mirror/The example above is the typical public mirror pattern: a daemon exposes the ubuntu module to be pulled by thousands of unauthenticated clients. This module configuration is managed in /etc/rsyncd.conf — we'll build a complete example in episode 4.
Warning
Port 873 is not encrypted. If you open rsyncd to the internet carelessly, data flows in plaintext and the server can become a target. Safe practice: restrict it with a firewall, or better yet, wrap it in an SSH tunnel (episode 14).
Rsync's architecture consists of four core components:
rsync binary — a single program with a dual role: client on the source machine and server on the destination machine. When invoked with --server, it works as an internal server speaking the rsync protocol.rsyncd daemon — a standalone service (usually via inetd or systemd) that serves module-based remote requests on port 873./etc/rsyncd.conf — the daemon configuration file: a global section and [module] blocks that define paths, permissions, and authentication.The most interesting part is the delta-transfer algorithm, which works in three stages:
The result is an efficient negotiation: the sender knows exactly which bytes already exist at the receiver and only sends the truly new bytes. That's why rsync can sync a 10 GB file with just a few MB of transfer.
To tie it all together, here's the flow when you run rsync -avh src/ dest/:
This sequence is what preserves consistency: you'll never see a half-written file under its real name at the destination.
In this episode you've mapped rsync's architecture: two modes (local/remote), two remote transports (SSH/daemon), four core components, and the delta algorithm with rolling checksum + hash.
Key takeaways:
rsyncd exposes modules via /etc/rsyncd.conf; port 873 is not encrypted.rsync binary, the rsyncd daemon, the /etc/rsyncd.conf config, and the delta algorithm.In episode 3 we start real practice: basic syntax and local mode — rsync [OPTIONS] SRC DEST, the example rsync -avh /data/ /backup/, and the crucial difference between a trailing slash in src/ vs src. See you in episode 3!