Request-reply protocols Flashcards
What is the typical pattern for client-server interaction?
Client sends request
Server receives request
Server handles request
Server handles response
Client receives response and continues
What are some data requirements for request-reply APIs?
The server needs to be identified by a remote reference (host IP and port number)
Choice of operation as the server may support several different operations (explicit operation ID)
Client and server must agree on how arguments are encoded - external data representation
Name some things needed for request-reply implementation?
Message identifiers, failure model, timeouts, duplicate request messages, history
Describe message identifiers
Typically each request is given a unique ID
Describe failure model
Can suffer from communication omission faults and process omission faults
Describe timeouts
Client typically uses a timeout to detect a missing reply - the client then retransmits the request
Describe duplicate request messages
Can be detected in the server from the duplicate message identifier
Describe history
With idempotent operations performing the operation twice makes no difference (e.g. setting a variable) but with other operations the server should not execute a duplicate request twice
Results are held in history and re-sent back to the client if a duplicate request is received
Compare and contrast TCP and UDP