1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Distributed Systems Simulator v1.1.0 released</title>
<link rel="shortcut icon" type="image/gif" href="/favicon.ico" />
<link rel="stylesheet" href="../style.css" />
<link rel="stylesheet" href="style-override.css" />
</head>
<body>
<p class="header">
<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/DRAFT-distributed-systems-simulator.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/DRAFT-distributed-systems-simulator.gmi">Gemini</a>
</p>
<h1 style='display: inline' id='distributed-systems-simulator-v110-released'>Distributed Systems Simulator v1.1.0 released</h1><br />
<br />
<span class='quote'>DRAFT - Not yet published</span><br />
<br />
<span>This blog explores the Java-based Distributed Systems Simulator program I created as my diploma thesis at the Aachen University of Applied Sciences (August 2008). The simulator offers both built-in implementations of common distributed systems algorithms and an extensible framework that allows researchers and practitioners to implement and test their own custom protocols within the simulation environment.</span><br />
<br />
<a class='textlink' href='https://codeberg.org/snonux/ds-sim'>ds-sim on Codeberg (modernized, English-translated version)</a><br />
<br />
<a href='./distributed-systems-simulator/ds-sim-screenshot.png'><img alt='Screenshot: The Distributed Systems Simulator running a Broadcast protocol simulation with 6 processes. The visualization shows message lines between process bars, with blue indicating delivered messages and green indicating messages still in transit.' title='Screenshot: The Distributed Systems Simulator running a Broadcast protocol simulation with 6 processes. The visualization shows message lines between process bars, with blue indicating delivered messages and green indicating messages still in transit.' src='./distributed-systems-simulator/ds-sim-screenshot.png' /></a><br />
<br />
<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br />
<br />
<ul>
<li><a href='#distributed-systems-simulator-v110-released'>Distributed Systems Simulator v1.1.0 released</a></li>
<li>⇢ <a href='#motivation'>Motivation</a></li>
<li>⇢ <a href='#installation'>Installation</a></li>
<li>⇢ <a href='#fundamentals'>Fundamentals</a></li>
<li>⇢ ⇢ <a href='#clientserver-model'>Client/Server Model</a></li>
<li>⇢ ⇢ <a href='#processes-and-their-roles'>Processes and Their Roles</a></li>
<li>⇢ ⇢ <a href='#messages'>Messages</a></li>
<li>⇢ ⇢ <a href='#local-and-global-clocks'>Local and Global Clocks</a></li>
<li>⇢ ⇢ <a href='#events'>Events</a></li>
<li>⇢ ⇢ <a href='#protocols'>Protocols</a></li>
<li>⇢ <a href='#graphical-user-interface-gui'>Graphical User Interface (GUI)</a></li>
<li>⇢ ⇢ <a href='#simple-mode'>Simple Mode</a></li>
<li>⇢ ⇢ <a href='#the-menu-bar'>The Menu Bar</a></li>
<li>⇢ ⇢ <a href='#the-toolbar'>The Toolbar</a></li>
<li>⇢ ⇢ <a href='#the-visualization'>The Visualization</a></li>
<li>⇢ ⇢ <a href='#color-differentiation'>Color Differentiation</a></li>
<li>⇢ ⇢ <a href='#the-sidebar'>The Sidebar</a></li>
<li>⇢ ⇢ <a href='#the-log-window'>The Log Window</a></li>
<li>⇢ ⇢ <a href='#expert-mode'>Expert Mode</a></li>
<li>⇢ ⇢ <a href='#configuration-settings'>Configuration Settings</a></li>
<li>⇢ <a href='#protocols-and-examples'>Protocols and Examples</a></li>
<li>⇢ ⇢ <a href='#dummy-protocol'>Dummy Protocol</a></li>
<li>⇢ ⇢ <a href='#ping-pong-protocol'>Ping-Pong Protocol</a></li>
<li>⇢ ⇢ <a href='#broadcast-protocol'>Broadcast Protocol</a></li>
<li>⇢ ⇢ <a href='#internal-synchronization-protocol'>Internal Synchronization Protocol</a></li>
<li>⇢ ⇢ <a href='#christian-s-method-external-synchronization'>Christian's Method (External Synchronization)</a></li>
<li>⇢ ⇢ <a href='#berkeley-algorithm'>Berkeley Algorithm</a></li>
<li>⇢ ⇢ <a href='#one-phase-commit-protocol'>One-Phase Commit Protocol</a></li>
<li>⇢ ⇢ <a href='#two-phase-commit-protocol'>Two-Phase Commit Protocol</a></li>
<li>⇢ ⇢ <a href='#basic-multicast-protocol'>Basic Multicast Protocol</a></li>
<li>⇢ ⇢ <a href='#reliable-multicast-protocol'>Reliable Multicast Protocol</a></li>
<li>⇢ <a href='#additional-examples'>Additional Examples</a></li>
<li>⇢ ⇢ <a href='#lamport-and-vector-timestamps'>Lamport and Vector Timestamps</a></li>
<li>⇢ ⇢ <a href='#simulating-slow-connections'>Simulating Slow Connections</a></li>
<li>⇢ ⇢ <a href='#raft-consensus-failover'>Raft Consensus Failover</a></li>
<li>⇢ <a href='#protocol-api'>Protocol API</a></li>
<li>⇢ ⇢ <a href='#class-hierarchy'>Class Hierarchy</a></li>
<li>⇢ ⇢ <a href='#implementing-a-custom-protocol'>Implementing a Custom Protocol</a></li>
<li>⇢ ⇢ <a href='#available-api-methods'>Available API Methods</a></li>
<li>⇢ ⇢ <a href='#example-reliable-multicast-implementation'>Example: Reliable Multicast Implementation</a></li>
<li>⇢ <a href='#project-statistics'>Project Statistics</a></li>
</ul><br />
<h2 style='display: inline' id='motivation'>Motivation</h2><br />
<br />
<span>Distributed systems are complex—interactions between nodes, network partitions, failure scenarios are hard to debug in production. A simulator lets you experiment with architectures, observe how systems behave under failure, and learn consensus algorithms, replication strategies, and fault tolerance in a controlled, repeatable environment. No operational overhead, no real infrastructure—just focused exploration of system design.</span><br />
<br />
<span>In the literature, one can find many different definitions of a distributed system. Many of these definitions differ from each other, making it difficult to find a single definition that stands alone as the correct one. Andrew Tanenbaum and Maarten van Steen chose the following loose characterization for describing a distributed system:</span><br />
<br />
<span class='quote'>"A distributed system is a collection of independent computers that appears to its users as a single coherent system" - Andrew Tanenbaum</span><br />
<br />
<span>The user only needs to interact with the local computer in front of them, while the software of the local computer ensures smooth communication with the other participating computers in the distributed system.</span><br />
<br />
<span>This thesis aims to make distributed systems easier to understand from a different angle. Instead of the end-user perspective, it focuses on the functional methods of protocols and their processes, making all relevant events of a distributed system transparent.</span><br />
<br />
<span>To achieve this, I developed a simulator, particularly for teaching and learning at the University of Applied Sciences Aachen. Protocols from distributed systems with their most important influencing factors can be replicated through simulations. At the same time, there's room for personal experiments—no restriction to a fixed number of protocols. Users can design their own.</span><br />
<br />
<span>The original simulator (VS-Sim) was written in Java 6 in 2008 with a German-language UI. In 2025, I revamped and modernized it as ds-sim: translated the entire codebase and UI from German to English, migrated the build system from hand-rolled Ant scripts to Maven, upgraded from Java 6 to Java 21 (adopting sealed class hierarchies, record types, formatted strings, pattern matching), introduced a proper exception hierarchy and consistent error handling, added comprehensive Javadoc documentation, implemented a headless testing framework (208 unit tests covering core components, the event system, and all protocol implementations), reorganized the project structure to follow standard Maven conventions, and added architecture documentation. Total: 199 files, over 15,000 lines of new code. Back in 2008, I wrote every line by hand in Vim. For the 2025 modernization, Claude Code did most of the heavy lifting—translation, refactoring, test generation, documentation. Times have changed.</span><br />
<br />
<h2 style='display: inline' id='installation'>Installation</h2><br />
<br />
<span>The modernized ds-sim requires Java 21 or higher and Maven 3.8 or higher.</span><br />
<br />
<pre>
# Clone the repository
git clone https://codeberg.org/snonux/ds-sim.git
cd ds-sim
# Set JAVA_HOME if needed (e.g. on Fedora Linux)
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
# Build the project
mvn clean package
# Run the simulator
java -jar target/ds-sim-*.jar
</pre>
<br />
<span>For a faster development build without running tests:</span><br />
<br />
<pre>
mvn package -DskipTests
</pre>
<br />
<span>After building, the following artifacts are available in the <span class='inlinecode'>target/</span> directory:</span><br />
<br />
<ul>
<li><span class='inlinecode'>ds-sim-1.1.0.jar</span> - Executable JAR with all dependencies bundled</li>
<li><span class='inlinecode'>original-ds-sim-1.1.0.jar</span> - JAR without dependencies</li>
</ul><br />
<span>The project also includes 208 unit tests that can be run with <span class='inlinecode'>mvn test</span>. Example simulation files for all built-in protocols are included in the <span class='inlinecode'>saved-simulations/</span> directory.</span><br />
<br />
<a class='textlink' href='https://codeberg.org/snonux/ds-sim'>ds-sim source code on Codeberg</a><br />
<br />
<h2 style='display: inline' id='fundamentals'>Fundamentals</h2><br />
<br />
<span>For basic understanding, some fundamentals are explained below. A deeper exploration will follow in later chapters.</span><br />
<br />
<h3 style='display: inline' id='clientserver-model'>Client/Server Model</h3><br />
<br />
<pre>
+-----------------------------------------+
| |
| +--------+ +--------+ |
| | Client |<------->| Server | |
| +--------+ +--------+ |
| |
| Sending of Messages |
| |
+-----------------------------------------+
Figure 1.1: Client/Server Model
</pre>
<br />
<span>The simulator is based on the client/server principle. Each simulation typically consists of a participating client and a server that communicate with each other via messages (see Fig. 1.1). In complex simulations, multiple clients and/or servers can also participate.</span><br />
<br />
<h3 style='display: inline' id='processes-and-their-roles'>Processes and Their Roles</h3><br />
<br />
<span>A distributed system is simulated using processes. Each process takes on one or more roles. For example, one process can take on the role of a client and another process the role of a server. The possibility of assigning both client and server roles to a process simultaneously is also provided. A process could also take on the roles of multiple servers and clients simultaneously. To identify a process, each one has a unique Process Identification Number (PID).</span><br />
<br />
<h3 style='display: inline' id='messages'>Messages</h3><br />
<br />
<span>In a distributed system, it must be possible to send messages. A message can be sent by a client or server process and can have any number of recipients. The content of a message depends on the protocol used. What is meant by a protocol will be covered later. To identify a message, each message has a unique Message Identification Number (NID).</span><br />
<br />
<h3 style='display: inline' id='local-and-global-clocks'>Local and Global Clocks</h3><br />
<br />
<span>In a simulation, there is exactly one global clock. It represents the current and always correct time. A global clock never goes wrong.</span><br />
<br />
<span>Additionally, each participating process has its own local clock. It represents the current time of the respective process. Unlike the global clock, local clocks can display an incorrect time. If the process time is not globally correct (not equal to the global time, or displays an incorrect time), then it was either reset during a simulation, or it is running incorrectly due to clock drift. The clock drift indicates by what factor the clock is running incorrectly. This will be discussed in more detail later.</span><br />
<br />
<pre>
+---------------------+ +---------------------+
| Process 1 | | Process 2 |
| | | |
| +-----------------+ | | +-----------------+ |
| |Server Protocol A| | | |Client Protocol A| |
| +-----------------+ | | +-----------------+ |
| | | |
| +-----------------+ | +---------------------+
| |Client Protocol B| |
| +-----------------+ | +---------------------+
| | | Process 3 |
+---------------------+ | |
| +-----------------+ |
| |Server Protocol B| |
| +-----------------+ |
| |
+---------------------+
Figure 1.2: Client/Server Protocols
</pre>
<br />
<span>In addition to normal clocks, vector timestamps and Lamport's logical clocks are also of interest. For vector and Lamport times, there are no global equivalents here, unlike normal time. Concrete examples of Lamport and vector times will be covered later in the "Additional Examples" section.</span><br />
<br />
<h3 style='display: inline' id='events'>Events</h3><br />
<br />
<span>A simulation consists of the sequential execution of finitely many events. For example, there can be an event that causes a process to send a message. A process crash event would also be conceivable. Each event occurs at a specific point in time. Events with the same occurrence time are executed directly one after another by the simulator. However, this does not hinder the simulator's users, as events are executed in parallel from their perspective.</span><br />
<br />
<span>Two main types of events are distinguished: programmable events and non-programmable events. Programmable events can be programmed and edited in the event editor, and their occurrence times depend on the local process clocks or the global clock. Non-programmable events, on the other hand, cannot be programmed in the event editor and do not occur because of a specific time, but due to other circumstances such as:</span><br />
<br />
<ul>
<li>Message receive events: Triggered when a message arrives at a recipient process</li>
<li>Protocol schedule events (alarms): Triggered by a timer set by a protocol, e.g. for retransmission timeouts</li>
<li>Random events: Such as random process crashes based on configured crash probability</li>
</ul><br />
<h3 style='display: inline' id='protocols'>Protocols</h3><br />
<br />
<span>A simulation also consists of the application of protocols. It has already been mentioned that a process can take on the roles of servers and/or clients. For each server and client role, the associated protocol must also be specified. A protocol defines how a client and a server send messages, and how they react when a message arrives. A protocol also determines what data is contained in a message. A process only processes a received message if it understands the respective protocol.</span><br />
<br />
<span>In Figure 1.2, 3 processes are shown. Process 1 supports protocol "A" on the server side and protocol "B" on the client side. Process 2 supports protocol "A" on the client side and Process 3 supports protocol "B" on the server side. This means that Process 1 can communicate with Process 2 via protocol "A" and with Process 3 via protocol "B". Processes 2 and 3 are incompatible with each other and cannot process messages received from each other.</span><br />
<br />
<span>Clients cannot communicate with clients, and servers cannot communicate with servers. For communication, at least one client and one server are always required. However, this restriction can be circumvented by having processes support a given protocol on both the server and client sides (see Broadcast Protocol later).</span><br />
<br />
<h2 style='display: inline' id='graphical-user-interface-gui'>Graphical User Interface (GUI)</h2><br />
<br />
<h3 style='display: inline' id='simple-mode'>Simple Mode</h3><br />
<br />
<a href='./distributed-systems-simulator/ds-sim-screenshot2.png'><img alt='Screenshot: The simulator showing the settings dialog. The visualization area displays process bars with message lines between them. The settings window allows configuring simulation parameters like number of processes, simulation duration, clock drift, message loss probability, and more.' title='Screenshot: The simulator showing the settings dialog. The visualization area displays process bars with message lines between them. The settings window allows configuring simulation parameters like number of processes, simulation duration, clock drift, message loss probability, and more.' src='./distributed-systems-simulator/ds-sim-screenshot2.png' /></a><br />
<br />
<span>The simulator requires JDK 21 and can be started with the command <span class='inlinecode'>java -jar target/ds-sim-VERSION.jar</span></span><br />
<br />
<span>The simulator then presents itself with a main window. To create a new simulation, select "New Simulation" from the "File" menu, after which the settings window for the new simulation appears. The individual options will be discussed in more detail later, and for now, only the default settings will be used.</span><br />
<br />
<span>By default, the simulator starts in "simple mode". There is also an "expert mode", which will be discussed later.</span><br />
<br />
<h3 style='display: inline' id='the-menu-bar'>The Menu Bar</h3><br />
<br />
<span>In the File menu, you can create new simulations or close the currently open simulation. New simulations open by default in a new tab. However, you can also open or close new simulation windows that have their own tabs. Each tab contains a simulation that is completely independent from the others. This allows any number of simulations to be run in parallel. The menu items "Open", "Save" and "Save As" are used for loading and saving simulations.</span><br />
<br />
<span>Through the Edit menu, users can access the simulation settings, which will be discussed in more detail later. This menu also lists all participating processes for editing. If the user selects a process there, the corresponding process editor opens. The Simulator menu offers the same options as the toolbar, which is described in the next section.</span><br />
<br />
<span>Some menu items are only accessible when a simulation has already been created or loaded in the current window.</span><br />
<br />
<h3 style='display: inline' id='the-toolbar'>The Toolbar</h3><br />
<br />
<span>The toolbar is located at the top left of the simulator. The toolbar contains the functions most frequently needed by users. The toolbar offers four different functions:</span><br />
<br />
<ul>
<li>Reset simulation: can only be activated when the simulation has been paused or has finished</li>
<li>Repeat simulation: cannot be activated if the simulation has not yet been started</li>
<li>Pause simulation: can only be activated when the simulation is currently running</li>
<li>Start simulation: can only be activated when the simulation is not currently running and has not yet finished</li>
</ul><br />
<h3 style='display: inline' id='the-visualization'>The Visualization</h3><br />
<br />
<span>The graphical simulation visualization is located in the center right. The X-axis shows the time in milliseconds, and all participating processes are listed on the Y-axis. The demo simulation ends after exactly 15 seconds. The visualization shows processes (with PIDs 1, 2, and 3), each with its own horizontal black bar. On these process bars, users can read the respective local process time. The vertical red line represents the global simulation time.</span><br />
<br />
<span>The process bars also serve as start and end points for messages. For example, if Process 1 sends a message to Process 2, a line is drawn from one process bar to the other. Messages that a process sends to itself are not visualized but are logged in the log window (more on this later).</span><br />
<br />
<span>Another way to open a process editor is to left-click on the process bar belonging to the process. A right-click, on the other hand, opens a popup window with additional options. A process can only be forced to crash or be revived via the popup menu during a running simulation.</span><br />
<br />
<span>In general, the number of processes can vary as desired. The simulation duration is at least 5 and at most 120 seconds. The simulation only ends when the global time reaches the specified simulation end time (here 15 seconds), not when a local process time reaches this end time.</span><br />
<br />
<h3 style='display: inline' id='color-differentiation'>Color Differentiation</h3><br />
<br />
<span>Colors help to better interpret the processes of a simulation. By default, processes (process bars) and messages are displayed with the following colors (these are only the default colors, which can be changed via the settings):</span><br />
<br />
<pre>
Process Colors:
Black - The simulation is not currently running
Green - The process is running normally
Orange - The mouse is over the process bar
Red - The process has crashed
Message Colors:
Green - The message is still in transit
Blue - The message has successfully reached its destination
Red - The message was lost
</pre>
<br />
<h3 style='display: inline' id='the-sidebar'>The Sidebar</h3><br />
<br />
<span>The sidebar is used to program process events. At the top, the process to be managed is selected (here with PID 1). In this process selection, there is also the option to select "All Processes", which displays all programmed events of all processes simultaneously. "Local events" are those events that occur when a certain local time of the associated process has been reached. The event table below lists all programmed events along with their occurrence times and PIDs.</span><br />
<br />
<span>To create a new event, the user can either right-click on a process bar and select "Insert local event", or select an event below the event table, enter the event occurrence time in the text field below, and click "Apply".</span><br />
<br />
<span>Right-clicking on the event editor allows you to either copy or delete all selected events. Using the Ctrl key, multiple events can be selected simultaneously. The entries in the Time and PID columns can be edited afterwards. This provides a convenient way to move already programmed events to a different time or assign them to a different process. However, users should ensure that they press the Enter key after changing the event occurrence time, otherwise the change will be ineffective.</span><br />
<br />
<span>In addition to the Events tab, the sidebar has another tab called "Variables". Behind this tab is the process editor of the currently selected process. There, all variables of the process can be edited, providing another way to access a process editor.</span><br />
<br />
<h3 style='display: inline' id='the-log-window'>The Log Window</h3><br />
<br />
<span>The log window (at the bottom) logs all occurring events in chronological order. At the beginning of each log entry, the global time in milliseconds is always logged. For each process, its local times as well as the Lamport and vector timestamps are also listed. After the time information, additional details are provided, such as which message was sent with what content and which protocol it belongs to. This will be demonstrated later with examples.</span><br />
<br />
<pre>
000000ms: New Simulation
000000ms: New Process; PID: 1; Local Time: 000000ms; Lamport time: 0; Vector time: (0,0,0)
000000ms: New Process; PID: 2; Local Time: 000000ms; Lamport time: 0; Vector time: (0,0,0)
000000ms: New Process; PID: 3; Local Time: 000000ms; Lamport time: 0; Vector time: (0,0,0)
</pre>
<br />
<span>By deactivating the logging switch, message logging can be temporarily disabled. With logging deactivated, no new messages are written to the log window. After reactivating the switch, all omitted messages are subsequently written to the window. Deactivated logging can lead to improved simulator performance.</span><br />
<br />
<h3 style='display: inline' id='expert-mode'>Expert Mode</h3><br />
<br />
<a href='./distributed-systems-simulator/ds-sim-screenshot.png'><img alt='Screenshot: The Distributed Systems Simulator in expert mode, showing a Broadcast protocol simulation with 6 processes. The visualization shows message lines between process bars, with blue indicating delivered messages and green indicating messages still in transit.' title='Screenshot: The Distributed Systems Simulator in expert mode, showing a Broadcast protocol simulation with 6 processes. The visualization shows message lines between process bars, with blue indicating delivered messages and green indicating messages still in transit.' src='./distributed-systems-simulator/ds-sim-screenshot.png' /></a><br />
<br />
<span>The simulator can be operated in two different modes: simple mode and expert mode. The simulator starts in simple mode by default, so users don't have to deal with the simulator's full functionality all at once. Simple mode is clearer but offers fewer functions. Expert mode is more suitable for experienced users and accordingly offers more flexibility. Expert mode can be activated or deactivated via the switch of the same name below the log window or via the simulation settings.</span><br />
<br />
<span>In expert mode, the following additional features become available:</span><br />
<br />
<ul>
<li>Global events: In addition to local events, global events can now also be edited. Global events are triggered when a specific global simulation time is reached, rather than a local process time. This only makes a difference when local process times differ from the global time (e.g. due to clock drift).</li>
<li>Direct PID selection: The user can directly select the associated PID when programming a new event.</li>
<li>Lamport and Vector time switches: If the user activates one of these two switches, the Lamport or vector timestamps are displayed in the visualization. Only one can be active at a time to maintain clarity.</li>
<li>Anti-aliasing switch: Allows the user to activate or deactivate anti-aliasing for smoother graphics. Disabled by default for performance reasons.</li>
<li>Log filter: A regular expression filter (Java syntax) that makes it possible to filter only the essential data from the logs. For example, <span class='inlinecode'>"PID: (1|2)"</span> shows only log lines containing "PID: 1" or "PID: 2". The filter can be activated retroactively and during a running simulation.</li>
</ul><br />
<h3 style='display: inline' id='configuration-settings'>Configuration Settings</h3><br />
<br />
<span>The simulation settings window allows configuring many aspects of the simulation. Key settings include:</span><br />
<br />
<ul>
<li>Processes receive own messages (default: false): Whether processes can receive messages they sent to themselves.</li>
<li>Average message loss probabilities (default: true): Whether to average the loss probabilities of sender and receiver processes.</li>
<li>Average transmission times (default: true): Whether to average the transmission times of sender and receiver processes.</li>
<li>Show only relevant messages (default: true): Hides messages sent to processes that don't support the protocol.</li>
<li>Expert mode (default: false): Enables expert mode features.</li>
<li>Simulation speed (default: 0.5): The playba
|