Advanced Topics in Operating Systems
Fall 1997
BGU Math & Computer Science Department
Protocol (PRELIMINARY!)
Protocol for client-server communication will consist of the following levels:
- Socket level
- Message level
- NFS request/response level
Socket Level Protocol
At this level, the protocol for socket connection is determined.
We suggest reliable stream-oriented sockets.
Thus, server does a listen, and then accept on its socket (this creates a new
scoket descriptor). Upon connection, get message, perform operations,
and respond via new socket descriptor. After sending returned result,
either disconnect or leave socket around, depending on type. All servers
must support at least the former type.
Message Level Protocol
Since we suggest single request connection at the socket level, each message
will contain a return socket address to connect to, and an NFS request.
The message should also include a host name and process ID, and a time stamp.
A socket address will be reserved for future use, and contain -1 in the
type field if not used.
Types and structure defined by
the include file
comm_protocol.h.
NFS Level Protocol
These will follow the structure as in /usr/include/nfs include files.
Message from client to server will consist of a procedure number, followed
by the relevant argument structure, and response is a response structure, where
applicable, as follows (first struct is paramenters, second is returned
structure):
- RFS_GETATTR nfsdiropargs nfsattrstat
- RFS_SETATTR nfssaargs
- RFS_ROOT ((int)mode, (null terminated string) fsname) nfsdiropres
- RFS_LOOKUP nfsdiropargs nfsdiropres
- RFS_READLINK nfsreadargs nfsrdlnres
- RFS_READ nfsreadargs nfsrdresult
- RFS_WRITECACHE nfswriteargs
- RFS_WRITE nfswriteargs
- RFS_CREATE nfscreateargs
- RFS_REMOVE nfsdiropargs nfsdiropres
- RFS_RENAME nfsrnmargs
- RFS_LINK nfslinkargs
- RFS_SYMLINK nfsslargs
- RFS_MKDIR nfscreateargs
- RFS_RMDIR nfsdiropargs nfsdiropres
- RFS_READDIR nfsrddirargs mfsrddirres
- RFS_STATFS nfsdiropargs nfsstatfs
Errata and Addendum
We found that uid and gid are not transmitted. To add this, put them
in the above order at the end of the message body (as sent by client).
In this way,
servers and clients that do not have the feature can work
with no changes.