A client-server internet radio system written in C, built with TCP control communication, UDP multicast audio streaming, and a custom application-layer protocol.
This project demonstrates low-level networking, concurrent server design, protocol implementation, and state-machine-based communication between clients and a streaming server.
- Language: C
- Networking: TCP, UDP, UDP multicast
- Concepts: socket programming, client-server architecture, multithreading, finite state machines, custom protocol design
The system simulates an internet radio platform where multiple clients can connect to a server, receive information about available radio stations, join a multicast stream, switch between stations, and upload songs.
The communication is split into two channels:
- TCP is used for control messages between the client and the server
- UDP multicast is used for streaming audio data for each radio station
This separation makes the system closer to a real-world streaming design, where control and media delivery are handled differently.
- Multi-client server architecture
- TCP-based control channel
- UDP multicast streaming for radio stations
- Dynamic station switching
- Song upload support
- Custom application-layer message protocol
- Finite State Machine logic for both client and server
- Multithreaded handling of communication and streaming flows
The project follows a client-server model:
- A client connects to the server over TCP
- The server responds with station and multicast information
- The client joins the appropriate UDP multicast group
- Audio is streamed over multicast
- The client can switch stations or upload new songs through the TCP control channel
- Client → Server (TCP): connection setup, requests, control messages
- Server → Client (TCP): welcome messages, station metadata, notifications
- Server → Clients (UDP Multicast): audio streaming for active radio stations
The system uses a custom protocol to coordinate communication between the client and server.
Example message types include:
- Hello – sent by the client to initiate communication
- Welcome – sent by the server with available station and multicast details
- AskSong – sent by the client when requesting a song-related action
- Announce – sent by the server to notify clients about changes such as a new song or station update
The protocol was designed to keep the control plane explicit and structured while audio delivery happens separately through multicast streaming.
Both the client and the server use state-based logic to control behavior during communication.
- Off
- WelcomeWait
- Established
- NewStations
- Accept client connections
- Maintain session state
- Manage station metadata
- Stream content to multicast groups
- Notify clients about updates
Using an FSM made it easier to separate connection setup, normal operation, and update handling in a predictable way.
This project focused on building a complete low-level networking system rather than a single socket demo.
Key implementation areas included:
- Designing and implementing the communication flow between client and server
- Combining TCP and UDP multicast in one application
- Managing radio stations as separate multicast streams
- Handling client interaction and station switching
- Supporting song upload behavior
- Structuring protocol handling with finite state machines
- Applying multithreaded design for concurrent communication
This project demonstrates practical understanding of:
- socket programming beyond basic examples
- the difference between reliable control traffic and media streaming traffic
- multicast-based communication
- concurrent server design
- protocol implementation at the application layer
- state-machine-based networking logic
It is a good example of systems and networking work that goes beyond simple request-response applications.
Typical components in the project include:
- client-side code for connection, control, and playback flow
- server-side code for connection handling and streaming
- protocol/message handling logic
- state-management logic for communication flow
- Clone the repository
- Build the client and server programs
- Set up a multicast-capable environment or use a network simulator such as GNS3
- Start the server
- Start one or more clients
- Connect to stations, switch streams, and test song upload behavior
- C compiler
- Multicast-capable network environment or simulation setup
- Audio playback support if required by the implementation
- GNS3 or equivalent environment if testing through simulation
Through this project, I strengthened my understanding of:
- low-level network programming in C
- TCP vs. UDP design tradeoffs
- multicast communication
- concurrent server behavior
- protocol and state-machine design
Possible next steps for the project:
- add clearer configuration for stations and ports
- improve logging and error visibility
- add automated test scenarios for protocol validation
- document packet/message formats in more detail
- add a diagram of the client-server and multicast flow