In this lesson · topic 3 of 7
Topic 3
Break the network and watch delivery
8 min read
What the lab runs
Thirty users each have an inbox with its own sequence numbers. Ten messages a tick go to random users. A message is sent over the user’s connection. If the delivery is lost, or the acknowledgement is lost, the server waits three ticks and sends again.
Each gateway can crash. Its users drop off, then reconnect to a live gateway after four ticks. Some users also go offline on their own for a few ticks. A message for an offline user waits and is sent when they return.
The client has two modes. Show on arrival displays each message as it lands. Hold for sequence keeps a message back until every lower number has been shown. A duplicate check, when on, drops a message whose number the client already has.
The model has one inbox per user, not one sequence per two-person conversation. The behaviour that matters is the same.
Predict before you press play
Things to try
- Set loss, crashes and offline users to 0.
- Keep 10 percent loss and show on arrival.
- Hold for sequence.
- Turn the duplicate check off.
- Raise users going offline to 5 percent a tick.
- Set gateway crashes to 2 percent a tick with no loss.
The full-page lab has a guided experiment for each of these.