-
Notifications
You must be signed in to change notification settings - Fork 66
Good Day Mate
Plex uses an in house developed Multicast protocol to allow for self discovery of plex servers and clients on the network. They have called this Good Day Mate (GDM). This page will try and document information around this protocol. Unfortunately there isn't any official documentation on this protocol, but there are several open source clients that communicate with Plex servers with this protocol. Most of the information comes from the Plex Roku Client and Plex Home Theater clients.
IP Address to BroadCast.
Plex Home Theater always uses 239.0.0.250 as the broadcast address for the data packets. It used to listen on 239.255.255.255, but this appears to have been changed due to a bug with Windows 7, not sending out packets (http://elan.plexapp.com/2011/07/, https://plexapp.lighthouseapp.com/projects/14382/tickets/1047-no-media-server-found, and https://github.com/awein/plex-home-theatre/blob/d580b104e950dce8ba7f04184661ff5c6bcc9947/plex/Network/NetworkService.h#L22)
The 239.0.0.250 address is part of the Administratively Scoped Ranges for use on a local network. In order for the multicast to work if a client and server use this range group, it must support the Adminstratively Scoped Ranges, http://tools.ietf.org/html/rfc2365.
Communication is started by the client sending a message asking for the Plex Media Servers to respond to it's search request. The message sent is either M-SEARCH * HTTP/1.0\r\n\r\n or M-SEARCH * HTTP/1.1\r\n\r\n. Servers then reply back with an HTTP/1.0 OK 200 and the basic description of the server including the ServerName and the IPAddress as well as Port Number.
While a client can use it's own local ip address for the broadcast address it appears that Windows machines only seem to respond on a particular group address (239.0.0.250).
The Roku code jumps through a lot of hoops to try and get a connection. It loops through its local ip address, the multicast address, and the reverse multicast address (250.0.0.239).
With Serenity it seems that either the multicast address or local ip address will work if the Plex Media Server is running on a Mac or Linux based machine. Unfortunately the local ip address doesn't see to work with Windows machines. So starting with Serenity 1.3.6-M2 we'll be using the multicast address as Plex Home Theater appears to use. Hopefully this allows better interoperability with Windows machines.
Plex may be switching from multicast packets to broadcast packets. This is slated for a future version of the plex server and will also be implemented in the plex home theater client. This may make the self discovery of servers more reliable in the future.
UDP packets are not guaranteed to be delievered, unlike TCP packets. So packets may be blocked for any number of reasons from reaching their destination. Many times problems seem to occur when using wireless connections. If you are experiencing problems using a wireless connection and have an ethernet port available on the device, you can try connecting it directly to the router via an ethernet cable. This has been shown to work using a Roku device.
If the packets are not getting out, you will need to configure your client manually. Clients like Serenity for Android may allow for a manual entry of the servers IP address and this should work in all cases.
Where are these example implementations?
Android - https://github.com/EvanMcEwen/Plex-GDM-IntentService - Note does not broadcast on 239.0.0.250
Plex Home Theater - https://github.com/awein/plex-home-theatre/blob/d580b104e950dce8ba7f04184661ff5c6bcc9947/plex/Network/NetworkService.h and https://github.com/awein/plex-home-theatre/blob/d580b104e950dce8ba7f04184661ff5c6bcc9947/plex/Network/NetworkServiceBrowser.h
Plex Roku Client - https://github.com/plexinc/roku-client-public/blob/master/Plex/source/GDM.brs
The goal here is to make this information as widely available as possible so that it is easier for third party plex developers to be able to build their tools.
Additional Plex Resources: