A system to help debug Ethernet broadcast packet delivery in a Layer 2 network.
This application consists of two components:
-
Broadcast Sender (Server)
- Sends broadcast packets with unique identifiers
- Runs an HTTP server for client registration
- Tracks connected clients
- Monitors broadcast packet delivery
- Reports delivery statistics
-
Broadcast Receiver (Client)
- Registers with the server via HTTP
- Listens for broadcast packets
- Reports received packets back to the server
To build both the server and client:
make buildThis will create two binaries in the bin directory:
bin/server- The broadcast senderbin/client- The broadcast receiver
./bin/serverBy default, the server:
- Listens on HTTP port 8080
- Sends broadcasts on UDP port 9999
- Waits 5 seconds for client reports
You can customize these settings:
./bin/server -port 8080 -broadcast-port 9999 -timeout 5s./bin/client -server http://localhost:8080By default, the client:
- Connects to the server at http://localhost:8080
- Listens for broadcasts on UDP port 9999
- Generates a random client ID
You can customize these settings:
./bin/client -server http://server-ip:8080 -broadcast-port 9999 -id custom-client-idTo send a broadcast packet, make a POST request to the server's broadcast endpoint:
curl -X POST http://localhost:8080/broadcastThe server will:
- Send a broadcast packet
- Wait for client reports
- Log which clients received the packet
You can check the current status of all clients and the last broadcast at:
curl http://localhost:8080/status-
Firewall Issues
- Ensure UDP port 9999 is open for both sending and receiving
- Ensure HTTP port 8080 is open for client-server communication
-
Network Configuration
- Verify that broadcast packets are allowed on your network
- Check that clients are on the same Layer 2 network segment
-
Client Connection
- Verify the server URL is correct when starting clients
- Check that clients can reach the server's HTTP endpoint
To clean build artifacts:
make cleanTo run tests:
make test