416 Distributed Systems: Assignment 1
Due: Jan 13th at 9PM
This assignment is intended to get you started with programming in the Go language. To solve this assignment you will need to install Go, figure out how to compile, run, and debug a Go program, and implement a UDP-based protocol described below.
High-level protocol description
There are two kinds of nodes in the system: a client (that you will implement) and a server (that we will implement). The server listens to connections from clients and expects UDP packets containing a single uint32 integer (between 0 and max size of uint32). It responds to each UDP packet with one UDP packet containing a string. This string can have one of three values:
The communication steps for an example run of this protocol are
illustrated in the following space-time diagram:
The client's goal is to programatically find the right number that gets the server to return the fortune string. The client should print to standard out the found fortune string followed by a newline and then exit. The client should not print anything else.
You will test and debug your solution against the running server instance -- the client is run with two arguments, the UDP IP:port to use locally, and the UDP IP:port of the server. You will not have access to the server's code.
Write a single go program called client.go that acts as a client in the protocol described above. Your program must implement the following command line usage:go run client.go [local UDP ip:port] [server ip:port]
Starter code and testing server
Download the starter code. The server is running at IP:port 184.108.40.206:4116.
Download the solution code.
Rough grading rubric