


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



COP5615 – Project 3 Michael Knapp ([email protected]) Michael Barbieri ([email protected]) Jose Boada ([email protected])
I. Summary of New Commands
i. User Node Commands
ii. Server Commands
II. Protocol Description
i. Server Discovery Protocol When a server starts up, it binds itself to a listener socket to receive communiqués from user nodes. It should also begin listening on 230.0.0.1:8450; the multicast channel that is used for server communication. It then begins receiving broadcasts from that channel and sends its own broadcast of the DISCOVER Command until it has found its neighbors or changed its alias. If a server receives a DISCOVER command and is either in conflict or knows a server with a conflict of that name, a ServerReply error is returned. A ServerReply of success is returned if the server wishes to neighbor with the new server. There may be additional channels used so that a server can be discoverable by a subset of servers and not all live servers. A channel is uniquely determined by a multicast address and port, and servers may belong to one or more channel.
Server communication is now a combination of multicast and unicast. After the DISCOVER command is sent and a neighbor server replies, the ServerReply
includes the unicast listener information so future commands that are not meant for all neighbors, such as JOINCHANNEL, may be sent directly from one server to another. Other commands such as KNOWNUSERS, KNOWNSERVERS and PREFERRED which are meant for all neighbors of a server may be multicast to all channels that a server belongs to.
ii. Create New Server Group At some point, a Server may wish to create a “private” communication channel between servers. This Server would send a JOINCHANNEL command to its neighbors who it wishes to invite. These neighbors would then begin listening on the new multicast channel. They would have the option to continue listening on the original channel or disconnecting from it.
iii. Fault Discovery Protocol After N occurrences of a user node sending a request to its current server and receiving no reply within a pre-specified timeout period, it assumes the server has failed and proceeds to attempt to connect to a new server based successively on its current list of the failed server’s neighbors. Here N may be arbitrarily set, greater than zero, based on a process’s tolerance for failure. Once connected, it sends the PREFERRED command with the information about the previous server so that the system knows to move it back to its preferred server in the event the failed server comes back online. If there is no available backup server, the user node exits.
iv. User node discovery of neighbor servers When a server wishes to tell its attached nodes about its neighboring servers, it sends a KNOWNSERVERS Command to the UserNode with the list of known Servers.
v. User node reacquisition after failure recovery Since the server saves the current neighbor list to non-volatile storage, once it comes online after a fault it will contact its old neighbors with the PREFERRED command. The servers will return a ServerReply listing all UserNodes that prefer the recovered server who are currently under their jurisdiction. Once the recovered server receives the ServerReply it contacts each UserNode with the same preferred Command to let them know their preferred server is online again. The UserNode then disconnects, by way of an EXIT command, from its backup Server and reconnects with its preferred Server.
vi. Finding a User node A User node queries its server with a Find command. If a server can fulfill the request and has not previously responded to this request, it replies directly to the UserNode, otherwise it forwards the request to all neighboring servers. The ServerReply includes both the Server information as well as the found UserNode.
If a user receives multiple replies from different servers regarding its FIND request, it is left to the user to decide which reply to favor.
III. Message Definitions
For this part of the project, we have defined a grammar for all messages passed from server to server, as well as all messages between the user agent and a server. At the top level of the grammar are two entities: Command and ServerReply, which together comprise all messages sent through the system.
Command A command is either from a server or a user. The first field denotes the sender’s reply address and the second field denotes the command they are sending. The recipient is not included in the command; rather it is determined by packet destination.
IV. Message Grammar
Command => [Server] [SCommand] [UserNode] [UCommand]
Server => SERVER [Alias] [IPAddress] [Port]
SCommand => DISCOVER [Alias] KNOWNUSERS [UserNode]* KNOWNSERVERS [Server]* PREFERRED [Server] JOINCHANNEL [IPAdress] [Port]
UserNode => USERNODE [Alias] [IPAddress] [Port]
UCommand => FIND [Alias] PREFERRED [Server]
CREATEROOM [RoomName] JOINROOM [RoomName] LEAVEROOM [RoomName] ULIST [RoomName] LISTROOMS CSEND [Message]
ALIAS [UserNode] REMOVE [Alias] SEND [Alias] [Message] LIST SETALIAS [UserNode]
ServerReply => SERVERREPLY [Server] [Status] [Command] [Server]* [UserNode]* [Message]*
Status => +OK -ERR
Alias => [A-Za-z0-9]+
IPAddress => [Byte].[Byte].[Byte].[Byte]
Byte => [0-2]?[0-9]?[0-9]
Port => [0-6]?[0-9][0-9][0-9][0-9]
RoomName => [A-Za-z0-9]+
Message => MESSAGE [^\0]*[\0]