Dist101 is a lightweight Go-based simulator that demonstrates how process migration works in a distributed system — i.e., moving a running process from one node to another without restarting it.
The simulator is built to help understand the internal logic of process migration, particularly focusing on the Pre-Copy migration algorithm, which is commonly used in real systems like VMware vMotion, CRIU and Xen.
-
Simulates multiple nodes in a distributed system
-
Models processes with CPU registers and memory
-
Implements Pre-Copy Process Migration step-by-step
-
Logs all migration stages clearly (initiation, copying, suspension, resumption)
-
Easy to extend with load balancing, network delay, and metrics
Dsit101 uses the Pre-Copy Migration Algorithm, a pre-emptive migration method where process memory is transferred in iterations while the process is still running.
-
Initiation A migration request is made (for example, Node A is overloaded and Node B is free).
-
Pre-Copy Phase (Memory Copy) The process continues running while its memory pages are copied from the source node (Node A) to the destination node (Node B). Only pages that change during copying (called dirty pages) are recopied.
-
Stop-and-Copy Phase When few dirty pages remain, the process on Node A is paused. CPU registers and the final memory state are then transferred.
-
Resumption Phase The process is reconstructed on Node B using the transferred state and resumes execution from the exact point it stopped.
-
Minimal downtime (the process continues running while memory transfers)
-
Maintains consistent state across nodes
-
Commonly used in real-world hypervisors and distributed systems
├── main.go # Entry point, runs the simulation
Dist101/
├── node.go # Node structure (represents a host in the system)
├── process.go # Simulated process (CPU, memory, registers)
├── migration.go # Pre-copy migration logic
├── utils.go # Helper functions (optional extensions)
└── go.mod # Go module definition
- Clone or Create the Project
git clone https://github.com/jomboi8/dist101.git
cd Dist101
- Initialize and Tidy Dependencies
go mod init dist101
go mod tidy
3.Run the simulator
go run .
Leonard Jombo
Distributed Systems - Process Migration in Distributed systems
This project is open-source under the MIT License.
