Skip to main content
This guide covers the installation and compilation of all three components of the Selective Repeat UDP project: the Router (Go), Client (Java), and Server (Java).

Prerequisites

Java Development

  • Java 11 or later
  • Maven for dependency management

Go Development

  • Go 1.7 or later

Router Installation

The router is written in Go and can be used either as a precompiled binary or compiled from source.
1

Option 1: Use Precompiled Binary

Precompiled binaries are available for Windows, Linux, and MacOS in the Router directory.
cd Router/linux
chmod +x router_x64  # or router_x86 for 32-bit systems
./router_x64 --help
Using precompiled binaries is the fastest way to get started and requires no additional setup.
2

Option 2: Compile from Source

If you prefer to build from source or need a custom build:
cd Router/source
go build router.go
This will create a router executable in the current directory.
Make sure you have Go 1.7 or later installed. You can verify with go version.
3

Verify Installation

Test that the router is working correctly:
./router --help
You should see the router usage information displayed.

Client Installation

The HTTP client (httpc) is a Java-based application that requires Maven for building.
1

Navigate to Client Directory

cd Client
2

Install Dependencies

The client uses the following dependencies:
  • jopt-simple (5.0.2) - for command-line option parsing
  • apache-ant (1.10.12) - for command-line utilities
mvn clean install
Maven will automatically download all required dependencies specified in pom.xml.
3

Compile the Client

mvn compile
This compiles the Java source files and prepares the client for execution.
4

Package the Client (Optional)

To create an executable JAR file:
mvn package
This creates a JAR file in the target directory.
5

Verify Installation

Run the client to verify it’s working:
mvn exec:java -Dexec.mainClass="client.CLient"
You should see a prompt: Enter your command..
Try running httpc help to see the available commands.

Server Installation

The HTTP file server (httpfs) is also written in Java and follows a similar build process.
1

Navigate to Server Directory

cd Server
2

Install Dependencies

The server uses the same dependencies as the client:
mvn clean install
3

Compile the Server

mvn compile
4

Package the Server (Optional)

mvn package
5

Verify Installation

Run the server to verify it’s working:
mvn exec:java -Dexec.mainClass="Server.ServerCommand"
The server will wait for a command. Type:
httpfs -v -p 8080
You should see: Waiting for connection request

System Requirements

Java Components

  • RAM: 512MB minimum
  • Disk Space: 100MB for dependencies
  • Java Version: 11 or later
  • Maven Version: 3.6 or later

Go Router

  • RAM: 256MB minimum
  • Disk Space: 10MB
  • Go Version: 1.7 or later

Troubleshooting

Try clearing your Maven cache and rebuilding:
mvn clean
rm -rf ~/.m2/repository
mvn install
Ensure you’re using Java 11 or later:
java -version
If you have multiple Java versions, set JAVA_HOME to point to Java 11+:
export JAVA_HOME=/path/to/java11
Make sure you have Go 1.7 or later installed:
go version
If you need to update Go, download the latest version from golang.org.
On Linux/MacOS, ensure the router binary has execute permissions:
chmod +x router

Next Steps

Client Usage

Learn how to use the httpc client

Server Setup

Set up and run the file server

Router Configuration

Configure the router for testing

Build docs developers (and LLMs) love