4
$\begingroup$

I am trying to think of a way to demonstrate how a multi-client server works, from the aspect of the broadcast messages sent from the server in response to a message from one of the clients.

I thought of making a small demonstration with cups and strings, having 4 to 5 cups on strings which are all connected to a main hub, rather than to each other. The hub is simply a closed box with holes where the other end of each line goes to, and a cup sized hole at the top.

When students speak into the cup, all the students hear what was said, because it was a broadcast from the main hub.

While this example sounds cool, I am not sure if it covers all1 sides of a multi-client server. What differences between a multi-client and the cup-string-hub example should I point out? (e.g. one of the differences I found is protocols, which the example doesn't exactly convey). I am talking about back-end differences, and not front-end ones.


1There are many things to cover, but I'm referring to the basics, as this is a first lesson in the subject of multi-client servers. They have tackled single client servers, so it's not an intro lesson.

$\endgroup$
  • $\begingroup$ Do you mean a single server handling different requests from multiple clients concurrently or a single server broadcasting the same response to multiple clients? $\endgroup$ – pddring Jun 27 '17 at 15:46
  • $\begingroup$ @pddring a bit of both. A server responding to separate clients, but broadcasting the response to all clients. $\endgroup$ – ItamarG3 Jun 27 '17 at 15:52
2
$\begingroup$

If your students are old enough to own phones and send text messages, then perhaps you could use group-texting as an example? One person in the group sends a message to the others; the message goes off to the company's server, which broadcasts the message to the people in the group? Depending on their age, that might be an example to which they could relate and that would engage them...

I guess it depends on how deeply you want to go. You could delve into the details of broadcasting vs multicasting, in which the sender of the message (the server in your example) sets the correct bits in each packet and the underlying network takes care of ensuring that the right packets get to the right clients.

If there is no network-level support for broadcasting or multicasting, a "broadcast" among N clients can still be done fairly efficiently in a distributed manner, without involving a server. For example, suppose N is 8, the clients are numbered 0-7, and 0 (which could be your server) wants to broadcast a message. Then...

  • At time 1: 0 sends the message to 4
  • At time 2: 0 sends the message to 2 and 4 sends it to 6
  • At time 3: 0 sends the message to 1, 2 sends it to 3, 4 sends it to 5, and 6 sends it to 7

This approach can "broadcast" a message among N clients in O(lg(n)) steps, so long as the network allows different clients to send simultaneously. What's happening there is quite different from your cups-and-string demo...

$\endgroup$
  • $\begingroup$ @ItamarG3: I edited my answer to try to better answer your question -- see if that helps any... $\endgroup$ – Joel Adams Jun 29 '17 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.