416 Distributed Systems: Assignment 2Due: Jan 22nd at 9PMWinter 2016 |
In this assignment you will practice even more Go by writing server-side code. In the first assignment you implemented a secure fortune client to retrieve the fortune by communicating with the authentication server (aserver) and the fortune server (fserver). In this assignment you will implement your own versions of the aserver and fserver. This assignment introduces two new concerns on top of the basic protocol from the first assignment: (1) your code must support multiple simultaneous clients, (2) your code must be fault-tolerant and must return error messages to clients that do not follow the protocol. High-level protocol descriptionThe aserver and fserver must together implement the protocol described in the first assignment. The interactions between the client and the aserver and the client and the fserver were described in the first assignment. All that remains is to describe the interactions between the aserver and fserver (which you will implement as separate go programs). The aserver and fserver communicate via RPC over TCP. The fserver is the server in this RPC interaction and exports a single method to the aserver, GetFortuneInfo, that takes the address of the client and a pointer to FortuneInfoMessage for the result. The fserver computes a new nonce and returns the filled-in FortuneInfoMessage. The exact declaration of GetFortuneInfo and the input/output types is: type FortuneServerRPC struct{} // Message with details for contacting the fortune-server. type FortuneInfoMessage struct { FortuneServer string // e.g., "127.0.0.1:1234" FortuneNonce int64 // e.g., 2016 }
func (this *FortuneServerRPC) GetFortuneInfo(clientAddr string, fInfoMsg *FortuneInfoMessage) error {
...
}
This simple RPC interaction is also illustrated in the following
diagram: Implementation requirements
Assumptions you can make
Solution specWrite two go programs, auth-server.go and fortune-server.go, that implement the description above. These programs must conform to the following command line usage: go run auth-server.go [aserver UDP ip:port] [fserver RPC ip:port] [secret]
go run fortune-server.go [fserver RPC ip:port] [fserver UDP ip:port] [fortune-string]
Testing client: You can use the client.go solution to assignment 1 to test your servers. However, we will test your solution more extensively, employing a variety of faulty clients. Rough grading schemeApproximate percentages for different aspects of the solution:
Make sure to follow the course collaboration policy and refer to the assignments instructions that detail how to submit your solution. Solution
|
|