4

I am sorry if this isn't a great place to ask this but I'm not sure which stackexchange to use. I'm not a network engineer but I am curious about one aspect of how the internet functions but I can't find anything about it.

I understand that when a user, say, visits a website, they send a data request to the host server which then responds with a stream of data packets, getting routed through however many datacentres, ISPs and routers as needed. My question is what happens when two relatively-nearby clients both request the same data at the same time. Does the host server send twice the amount of data, one to each client, or is there a protocol that sends a single packet which is then duplicated at some node down the line, closer to the end clients.

Such as during a livestream by a country's prime minister being watched by a million of their citizens. Does the server in the capital need to send the same stream of data to all of the people, or is there maybe one stream to each city and is then duplicated and split up as needed? I understand in this specific case there's probably a selected ISP that is hosting the stream and they probably handle some system like this between their datacentres, but I'm asking in a more general sense.

6

what happens when two relatively-nearby clients both request the same data at the same time. Does the host server send twice the amount of data, one to each client, or is there a protocol that sends a single packet which is then duplicated at some node down the line, closer to the end clients.

The former. Different requests use different connections and bear no relation to each other, even if they're carrying completely identical data. There's no deduplication of application-layer data on any lower layer. This method is called unicast.

As @manish_ma has explained, multicast is a special distribution form to send the same server data to multiple clients. The difference is that it is not a request-response model but the transmission is initiated by the server (may be triggered by a client event). Clients can then subscribe to the multicast - and get a copy - or not.

However, multicast does not work on the open Internet, only in private networks. Sites like Youtube actually stream a separate flow to each client, even if many watch the same (live) video.

1

Does the host server send twice the amount of data, one to each client

Yes, however there may be more than one "host server".

Such as during a livestream by a country's prime minister being watched by a million of their citizens. Does the server in the capital need to send the same stream of data to all of the people, or is there maybe one stream to each city and is then duplicated and split up as needed?

Large scale internet video distribution is usually handled by what are known as content distribution networks (CDNs for short). These may be built by the provider offering the video to customers or they may be operated as a service. The content distribution network will try to place servers as close to the expected users as possible, in many cases they will strike arrangements with "access" ISPs to place the servers inside their networks.

Some mechanism* is used to direct the client connections that carry the video to a local node in the content distribution network. These nodes will request the video from upstream nodes and duplicate it as necessary. The exact design will depend on the goals, an on-demand video service will have different needs from live TV streaming.

* There are many possible mechanisms, including geographically aware DNS servers, IP anycast, geographic awareness in the server that serves the web pages that reference the video content.

0

Multicast can be useful when multiple clients are interested in exactly the same stream from a streaming server. In this type of transmission data is generated only once in the source and is duplicated by multicast supporting routers along the way to receivers. If such data gets lost or corrupted along the way, there will be no retransmission (if there would be, would it be sent to all receivers?). These types of traffic are usually sent in UDP datagrams. UDP protocol doesn't support data retrasmission, and is more suitable for these types of traffic. For video/audio streaming, a minor loss of data is usually OK (you might not even notice it).

On the other hand, traffic that is sent to each host separately - namely unicast, can be retrasmitted since each host gets it's own copy from the source - such retrasmissions are usually facilitated by the TCP transport protocol, but can also be implemented in application layer.

3
  • 1
    You cannot use multicast on the public Internet. You can use multicast in a tunnel that supports multicast to send it from site-to-site across the public Internet, but the Internet does not support multicast.
    – Ron Maupin
    Aug 11 at 12:44
  • Thanks for clarifying this point. OP asked how networks duplicate packets - is there another way to duplicate packets on the network? (except for using monitor commands? or besides broadcast?)
    – manish ma
    Aug 11 at 13:54
  • The OP specifically refers to traffic going through ISPs, meaning the public Internet. Traffic over the public Internet is unicast. Duplication of unicast packets is required unless the receiving hosts are at the same site, and the site has a tunnel that supports multicast with the sender site, and both sides are configured to route multicast (multicast routing is very different than unicast routing).
    – Ron Maupin
    Aug 11 at 14:01

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.