Docsity

Protocol Design Phase – Operating System Principles – Project 3 | COP 5615, Study Guides, Projects, Research of Computer Science

Toggle sidebar
bg1
COP5615 – Operating System Principles
Project 3 – Protocol Design Phase
Submitted by: David Wolinsky, Jarret O’Shea, Ritwik Kumar
1. Definitions
1.1
This section defines the terminology used in this document.
1.2 Table 1
Server The Chat Server as defined in Project 2.
Client The composite of User Agent and End User as defined in Project 2.
Dump
File
The file which each server maintains and updates periodically with
its two random numbers and its name.
Matching
range
A range defined by two randomly generated numbers at each server.
This range defines the topology of the server network.
Home
Server
Server to which the request generating client in question was
originally attached to when it first joined the system.
2. Message format convention
2.1
Any message mentioned in this document will always start with one of the
following keywords (lets call them message identifier)
2.2 Table 2
ssmm
Server to Server multicast message
ssum
Server to Server unicast message
scum
Server to Client unicast message
csum
Client to Server unicast message
2.3
This keyword would be followed by the actual message enclosed in “[“ (start of
message) and “]” (end of message). Within [ ] there would be a sequence of
variables and constants enclosed with < > and “ “ respectively. As always,
variables’ value would be decided on the fly and a constant would be keyword
with predefined function. So a message would look like
2.4
<Message identifier> [ a combination of < > and “ “ ]
3. Message Definition
3.1 Sever-to-Server multicast message (ssmm)
3.1.1
An
ssmm
message would be used in server discovery phase. A generic
ssmm
would
look like the following:
pf3
pf4
pf5

Partial preview of the text

Download Protocol Design Phase – Operating System Principles – Project 3 | COP 5615 and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

COP5615 – Operating System Principles

Project 3 – Protocol Design Phase

Submitted by: David Wolinsky, Jarret O’Shea, Ritwik Kumar

1. Definitions

1.1 This section defines the terminology used in this document.

1.2 Table 1

Server The Chat Server as defined in Project 2.

Client The composite of User Agent and End User as defined in Project 2.

Dump

File

The file which each server maintains and updates periodically with

its two random numbers and its name.

Matching

range

A range defined by two randomly generated numbers at each server.

This range defines the topology of the server network.

Home

Server

Server to which the request generating client in question was

originally attached to when it first joined the system.

2. Message format convention

2.1 Any message mentioned in this document will always start with one of the

following keywords (lets call them message identifier)

2.2 Table 2

ssmm Server to Server multicast message

ssum Server to Server unicast message

scum Server to Client unicast message

csum Client to Server unicast message

2.3 This keyword would be followed by the actual message enclosed in “[“ (start of

message) and “]” (end of message). Within [ ] there would be a sequence of

variables and constants enclosed with < > and “ “ respectively. As always,

variables’ value would be decided on the fly and a constant would be keyword

with predefined function. So a message would look like

2.4 [ a combination of < > and “ “ ]

3. Message Definition

3.1 Sever-to-Server multicast message (ssmm)

3.1.1 An ssmm message would be used in server discovery phase. A generic ssmm would

look like the following:

3.1.2 ssmm [ <server 0> <server 1> ... ]

3.1.3 Where the fields are defined as:

3.1.4 Table 3

a string containing the general function (e.g. discovery)

a string containing a specific function provided by a class (e.g.

connect)

the lower number of the matching range

the higher number of the matching range

the original sending server’s name

the original sending servers unicast receiving port

the unique id for a message so that it is only processed once

(and forwarded from) each node

contains a count of server hops, so that we can figure

out how to send responses back

the order of how we got to a specific server, so that we can

return a message back to the original sending server. ‘n’ will be

a natural number.

optional field for anything not described in this table

3.2 Server-to-server unicast message (ssum)

3.2.1 An ssum message would be used in server discovery and client recovery phases.

A generic ssum would look like the following:

3.2.2 ssum [ ]

3.2.3 Where the fields are defined as

3.2.4 Table 4

a string containing the general function (e.g. discovery)

a string containing a specific function provided by a class (e.g.

connect)

the original sending server’s name

optional field for anything not described in this table

3.3 Client-to-server unicast message (csum) & Server-to-Client unicast message

(scum)

<parameters: >] this message propagates back to the original sender } else { if server count == 1 { add to our neighbor list and inform clients (4.7) ssum ["discovery" "neighbor" <name = selfname> <parameters = <users' list>>] increment server count of previous message add our name to the end of previous message forward this new message to all of our neighbors via ssmm (as described in 4.1.1.2) continue (that is wait for next message) } } }

4.2 Client recovery after Server crash

4.2.1 Recovering Server

4.2.1.1 This deals with reclaiming clients on server’s resurrection after crash.

4.2.1.2 Code load range numbers and name from Dump file ssmm ["recover" "find_clients" <name = selfname> <server 0 = >]

4.2.2 Receivers

4.2.2.1 This deals with how would a server who receives this call back on multicast

channel from a resurrected server responds

4.2.2.2 Code if range is in mine { if we've already seen this uuid { continue } else { foreach client in our group { if client's server name has priority over mine, let the node know about this { scum [“reconnect” <server’s command listener unicast address> <server’s command listener unicast port>] }

increment server count of previous message add your name to the end of previous message forward this new message to all of our neighbors by adding your name at the end of server list and forwarding it using ssum [“recover” “find_clients” <parameters = <server’s command listener unicast address> <server’s command listener unicast port> >] } }

4.2.2.3 When a server receives this request from another server on the unicast channel is

responds almost the same way as described in 4.2.2.2 except the range checking

part.

4.3 Client searching another client

4.3.1 Client Sender

4.3.1.1 Code csum [“search” “find” <parameters = <name = my name>>]

4.3.2 Server

4.3.2.1 On receiving such a search message from one of its own clients, a server would

respond as following:

4.3.2.2 Code if searched client is in our users' list { scum [“search” “result” “success” <client’s unicast receiver IP> <client’s unicast receiver Port>] } To each neighbor send ssum ["search" "query" <parameters = <client's name being searched>>]

4.3.2.3 On receiving such a message from one of the other servers, a server would

respond as following:

4.3.2.4 Code if we have a client with this name { Return the following message to the server from which query was received ssum ["search" "found" <parameters = <found client’s unicast receiver IP> <found client’s unicast receiver Port> ]

contains IP and port for all the neighbors.

4.6 Inform others of name change

4.6.1 In case of a name change, the server purges its neighbor list and client list (this is

highly unlikely that it would have client this early) starts afresh with the new

name and neighbor discovery. It informs its clients of the new name and asks

them to reconnect. All chat rooms that exist are left untouched. It informs them

using following command:

4.6.2 Code scum [“newservername” ]

4.7 Inform clients to update their neighbor list

4.7.1 Incase a new neighbor is discovered, server informs the client using this

command

4.7.2 Code scum [“updateneighbor list” ]

4.8 Check for neighbors being alive

4.8.1 Send this probe periodically

4.8.2 Code ssum ["keepalive" "rualive" ]

4.8.3 Servers send back following acknowledgement:

4.8.4 Code ssum ["keepalive" "iamalive" ]

4.8.5 Incase some neighbor does not respond, it is considered dead and clients are asked

to update their lists.

5. Other Commands

5.1 Setalias, createchatroom, joinchatroom, leavechatroom, listchatrooms, ulist and

exit works in the same manner as described in Project 2 specification. Alias,

remove, send and list will work as described in Project 1.