Skip to main content
Contributor I
February 25, 2021
Answered

How Sonos plays a music from my home speakers

  • February 25, 2021
  • 23 replies
  • 751 views

Hi,

I have 2 sonos one. Every thing works well but I am a technical question. I hope I posted in a right subsection.

I would like to know how sonos sends and plays a music which I send it from a different network like my mobile data. How it finds my home speaker IP and port?

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.
Best answer by Ralpfocus

When the sonos speaker communicates to the sonos cloud it opens a long running connection with the sonos cloud which will have very low impact as @controlav says. Once a connection is open between two devices they both know an ip address (endpoint) that enables data to flow between them. The endpoint at your end will normally  be the external ip adress of your router - this is assigned by your Internet provider.  When the sonos cloud “responds" on that connection it talks to the endpoint on your router. Your router keeps track of open connections and when a message arrives for your sonos device the router “knows" which device initiated the connection and forwards the message onto that device. 

Sonos therefore knows the ipaddress of your house, your external ip address which can change -  it is under the control of your provider.  Some never change some, less common, change quite regularly. If you use a vpn provider then the endpoint sonos sees is the vpn providers.

By default your home router prevents people from outside initiating connections so the Sonos cloud cannot initiate the connection, your sonos system initiates the connection probably at start up.

@James L. is right that the sonos cloud does not need your local address because it does not initiate the connection but once the connection is open it does know your routers address and despite what he says the message sent to the cloud  probably contains the ip address of the  speaker

As an aside the provider e.g. sonos can use the endpoint ip address to roughly get the physical location of your router. This is one of the ways that companies can target advertising.

Edited to make a correction about knowing local ip address

23 replies

ReezaroAuthor
Contributor I
March 3, 2021

If you meant “ track the IP until my router changes its IP address” then yes ish. It is not really tracking there is an open connection rather like a telephone call and data can flow between both ends for as long as the connection is open. You are correct the router is responsible for transferring the data to the speaker.

If you look at my updated reply the Sonos cloud cannot initiate the connection. The speaker initiates the connection which it keeps open for a long time. I have no idea how long “long” is but whenever it reaches the end the speaker will just initiate a new connection.

So you mean there is always a connection between speakers and cloud 24/7 ? 

controlav
Lead Maestro
March 3, 2021

So you mean there is always a connection between speakers and cloud 24/7 ? 

At minimum a socket will be open between the two, yes. I am guessing the same channel is also used to receive update notifications.

Why are you so concerned about this? Every cloud-connected device in your home that can be controlled by an app when not on your Wifi (eg Ring) works similarly.

Author of the leading independent Sonos apps for Android, MacOS, iOS, Windows and Xbox.
ReezaroAuthor
Contributor I
March 3, 2021

So you mean there is always a connection between speakers and cloud 24/7 ? 

At minimum a socket will be open between the two, yes. I am guessing the same channel is also used to receive update notifications.

Why are you so concerned about this? Every cloud-connected device in your home that can be controlled by an app when not on your Wifi (eg Ring) works similarly.

I got it.

I am not concerned, it is just interesting for me. I had never had a cloud-based device and Sonos speakers were the first ones. Happy to learn. 

Thanks   @James L. @controlav  and others