Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

OS 4.3 (9 of 12): Network integration points

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

45 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

Who decides if you scored?

You play a football game online with nine other people. You press the shoot button.

Your phone shows the ball moving at once. But who decides if it is a goal? Your phone? Or a computer far away that sees all ten players?

Splitting work between your device and a distant computer is a key design choice.

Key words

WordWhat it meansExample
LocalDone on the user's own device.reading a button press
RemoteDone on another computer.sharing all player positions
NetworkComputers joined together so they can send data to each other.
Remote callA request that one computer sends to another to do a job and answer.
LatencyThe delay between sending a request and getting the answer.50 milliseconds
System boundaryThe line that shows what is inside your system and what is outside.
External systemA system run by someone else that yours connects to.a sports data feed
APIA set of rules that lets one program ask another for data or a job.

The cells students fill in are left blank in this preview.

Local or remote?

Some jobs must be local. They must be fast, and only your device needs them. Reading a button press is local.

Some jobs must be remote. They need data from many people, or the result must be trusted. The score of a multi-player game is remote, so nobody can cheat.

Every remote job adds latency. That is a delay.

Quick check: local or remote?

Have a go

Quick check: local or remote?

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

A system boundary

flowchart LR
  subgraph ours[Inside our system]
    subgraph device[Player device: local]
      input[Read buttons]
      draw[Draw the screen]
    end
    subgraph server[Game server: remote]
      rules[Check the rules]
      share[Share positions]
    end
  end
  feed[(External sports data feed)]
  input -->|move request| rules
  rules -->|result| draw
  share -->|positions| draw
  feed -->|real squads| rules

What sits where, and why

PartWhere it isWhy
Read buttonsLocalMust feel instant
Draw the screenLocalYour device has the screen
Check the rulesRemoteThe result must be trusted
Share positionsRemoteNeeds data from all players
Sports data feedExternalRun by another company; we only connect to it

The cells students fill in are left blank in this preview.

How are they connected?

Data moves between local and remote parts over a network. The type of network matters. Home Wi-Fi is fast. Mobile data can be slow or stop working. A college network may block some data.

Often your design combines networks. A phone uses Wi-Fi at home, mobile data on a bus, and then the internet to reach the server.

Quick check: the network

Have a go

Quick check: the network

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Match each term to its meaning

Have a go

Loading…

Your answers are marked here and are not kept. A college account keeps every student’s marks.

A remote call over time

sequenceDiagram
  participant P as Player phone
  participant S as Game server
  participant F as Sports data feed
  P->>S: start a match
  S->>F: ask for this week's real squads
  F-->>S: squads
  S-->>P: teams ready
  P->>S: shoot request
  S-->>P: goal or no goal

Plan which jobs run local or remote

A game has jobs. For each job you know two facts: does it need data from other players, and must the result be trusted? Write three functions. The first says "local" or "remote" for one job. The second makes a plan for all jobs. The third counts the remote jobs. Press Run Tests.

Code: python
def where_runs(needs_other_players, must_be_trusted):
    # A job runs "remote" (on the server) if it needs data from other players
    # or if the result must be trusted (so nobody can cheat).
    # Otherwise it runs "local" (on the player's own device).
    return None


def make_plan(jobs):
    # jobs is a dictionary: name -> (needs_other_players, must_be_trusted)
    # Give back a dictionary: name -> "local" or "remote".
    return None


def count_remote_calls(plan):
    # How many jobs in the plan run "remote"?
    return None

Make a free account to save your work, or press Start lab to work through the whole lesson.

Draw the calls in order

A fan opens a football app. The app asks our server for live scores. The server asks an outside data feed. The feed answers the server. The server answers the app. Finish the sequence diagram. Add the missing messages.

sequenceDiagram
  participant A as Fan app
  participant S as Our server
  participant F as Outside data feed
  A->>S: ask for live scores
  %% Add: the server asks the feed.
  %% Add: the feed answers the server.
  %% Add: the server answers the app.

Make a free account to save your work, or press Start lab to work through the whole lesson.

Draw the app's system boundary

Draw the system boundary for the same football app. Put the fan app and our server inside the boundary. Put the data feed outside it. Label every arrow with the data that moves.

flowchart LR
  subgraph ours[Inside our system]
    app[Fan app]
  end
  %% Add the server inside the boundary.
  %% Add the outside data feed.
  %% Add labelled arrows between them.

Make a free account to save your work, or press Start lab to work through the whole lesson.

Key words crossword

Have a go

Loading…

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Exit quiz

Have a go

Exit quiz

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.