Protocol (Sliepen's Linux cluster)

Ports

Port 1833 has been assigned by the Internet Assigned Numbers Authority for UDP radio.

UDP protocol

The virtual resolution of the audio data is always 16 bit stereo 44100 Hz signed and linear. By leaving out certain packets, the real transmitted data may be of lesser quality. The audio data is chopped in slices of exactly 1 second. This slice can be seen as an array byte sample[44100][4]. There are 4 bytes (named channels hereafter) for each sample; sample[x][0] is mixed/msb, sample[x][1] is mixed/lsb, sample[x][2] is seperation/msb and sample[x][3] seperation/lsb. One slice of audio data gives 240 packets, that are sent at 240 Hz ofcourse, first piece 0/channel 0, then piece 0/channel 1, piece 0/channel 2, piece 0/channel 3, piece 1/channel 0 etcetera.

size (bytes)descriptionvalue
2magic number10752 (msb='R', lsb=revision)
1slice(0-255)
1piecex (0-59)
1channely (0-3)
735audio data sample[0+x][y]
sample[60+x][y]
sample[120+x][y]
...
sample[43920+x][y]
sample[43980+x][y]
sample[44040+x][y]

The slice value is 0 for the first second of transmitted data, 1 for the next and so on, and cycles back to 0 after slice 255.

TCP protocol

TCP is used to get information about a transmitter and to ask for an UDP stream. TCP will not be used for the actual audio stream (TCP may be reliable but it has very nasty side-effect for real time data, and also it doesn't support broadcasting of data). Commands will be human read/writeable. Commands start with one word (the command) followed by a colon if options are needed, whereafter the options come. The complete command is terminated by a newline. Whitespace is used for separation of options.

commanddescription
SERVER: (servername)Server uses this to give its full name
STREAM: (streamname)Server uses this to give the title of the audio data
INFO: (streaminfo)Server uses this to give extra information about the audio data, like copyrights
QUALITY: [8|16] [M|S] (pieces/second)Server uses this to give the maximum quality it broadcasts
REQUEST: [8|16] [M|S] (pieces/second) (port)Client uses this to ask server to send data to it
OKServer acknowledges REQUEST
DENIED: (reason)Server denies REQUEST
PROXY: (address) (port)Server denies REQUEST but gives the address/port of another server broadcasting the same
BROADCAST: (netmask) (port)Client uses this to note the server it broadcasts the data on its local network, which the server can use to determine proxies


Copyright (C) Guus Sliepen. Last updated: 11 december 1998. Send comments to root@sliepen.eu.org