Microsoft PowerPoint Exercises ClientServer.ppt

Transcript

1 Distributed Systems Client-Server Communication: Exercises Werner Nutt 1 Request-Reply Protocols 2

2 Communication Types Asynchronous: sender continues after submission ƒ ƒ Synchronous: sender is blocked until – message is stored at receiver’s host – message is received – reply is received 3 Request/Reply Protocols Basically all client/server communication follows the pattern of a request/reply protocol: sends – the client a request message – the server the requested operation executes – the server responds with a reply message 1. Give an example of a request/reply protocol in the real world. 2. Discuss the pros and cons of synchronous and asynchronous communication for a request/reply protocol. Under which conditions is synchronous communication preferrable? When asynchronous communication? 4

3 Request-reply Message Structure Imagine a request-reply protocol where a request is an invocation of a method of a remote object. Suppose requests have the following format: messageType: 0 bool (0=Request, 1= Reply) requestID int RemoteObjectRef objectReference methodId int or Method arguments array of bytes 5 Request-reply Message Structure (cntd) 3. Under which circumstances is a requestID needed? (Hint 1: remember that messages are sent over networks; Hint 2: remember Question 2) 4. What elements should a reply message have? 6

4 Request-reply at the Transport Level 5. Which transport protocol would be more suitable to implement a request reply protocol, UDP or TCP? 6. Does the answer depend on additional circumstances? 7. Over which transport-level protocol is the request-reply protocol implemented that you mentioned as answer to Question 1? 7 Datagram-based RRP Suppose a Request-Reply Protocol is implemented using UDP. 8. What can go wrong in a message exchange? Describe 3 possible problems. (Think of message loss and its consequences.) 9. For each problem above, describe a (simple) refinement of the basic request-reply protocol that overcomes it. 8

5 Invocation Semantics For request/reply protocols, one distinguishes between three semantics that are distinguished by the guarantees given for the execution of the server’s operation : Maybe Semantics: the server may execute the request ƒ once, several times, or not at all ƒ At-least-once Semantics: the server executes the request at least once, but may execute it more often, until the client receives an answer ƒ At-most-once Semantics: for each request, the server executes the operation at most once; the invoking application receives the result or an exception 9 Invocation Semantics (cntd) 11. Explain: for which of the three semantics is it necessary that the client transmits requests more than once? 12. Explain: for which of the three semantics is it necessary that the server remembers the requests it has answered? 13. For each of the three semantics, explain what the server should do when it receives a request. Hint: Find out, whether the server should remember something, and if so, what. 10

6 Idempotent Operations 14. Suppose a server receives the same client request more than once. How should it react the second time? An operation of the server is called “idempotent” if it leads to the same result, independent of how many times it is executed. 15. When running a request/reply protocol, does it make a difference whether server operations are idempotent or not? Does this depend on the invocation semantics? Explain your answer. 11 Request-Reply with Acknowledgements In the Request-Reply-Acknowledgement (RRA) protocol the client acknowledges the server’s reply messages, and the acknowledgement message contains the ID in the reply message being acknowledged. 16. For which of the three invocation semantics does RRA allow for an optimisation? Is the optimisation on the client or on the server side? Describe how the implementation of client and/or server changes for this semantics when moving from RR to RRA. 12

7 Request-Reply with Piggy-Backed Acknowledgements 17. Design a variant of the RRA protocol in which the acknowledgement is piggy-backed on, that is, transmitted in the same message as, the next request where appropriate, and otherwise sent as a separate message. Which changes are necessary on the server and on the client side? 13

Related documents

CityNT2019TentRoll 1

CityNT2019TentRoll 1

STATE OF NEW YORK 2 0 1 9 T E N T A T I V E A S S E S S M E N T R O L L PAGE 1 VALUATION DATE-JUL 01, 2018 COUNTY - Niagara T A X A B L E SECTION OF THE ROLL - 1 CITY - North Tonawanda TAX MAP NUMBER ...

More info »
RIE Tenant List By Docket Number

RIE Tenant List By Docket Number

SCRIE TENANTS LIST ~ By Docket Number ~ Borough of Bronx SCRIE in the last year; it includes tenants that have a lease expiration date equal or who have received • This report displays information on ...

More info »
G:\COMP\PHSA\PHSA.bel

G:\COMP\PHSA\PHSA.bel

G:\COMP\PHSA\PHSA-MERGED.XML PUBLIC HEALTH SERVICE ACT [As Amended Through P.L. 115–408, Enacted December 31, 2018] References in brackets ¿ ø¿ ø are to title 42, United States Code TITLE I—SHORT TITL...

More info »
vol9 organic ligands

vol9 organic ligands

C HERMODYNAMICS HEMICAL T OMPOUNDS AND C OMPLEXES OF OF C U, Np, Pu, Am, Tc, Se, Ni and Zr O ELECTED WITH RGANIC L IGANDS S Wolfgang Hummel (Chairman) Laboratory for Waste Management Paul Scherrer Ins...

More info »
CalCOFI Atlas 33

CalCOFI Atlas 33

THE EARLY STAGES IN OF THE FISHES CALIFORNIA CURRENT REGION CALIFORNIA FISHERIES COOPERATIVE OCEANIC INVESTIGATIONS ATLAS NO. 33 BY THE SPONSORED STATES OF COMMERCE DEPARTMENT UNITED OCEANIC AND ATMOS...

More info »
CRPT 116hrpt9 u2

CRPT 116hrpt9 u2

U:\2019CONF\HJRes31Front.xml APPRO. SEN. [COMMITTEE PRINT] REPORT { } CONGRESS 116TH 1st HOUSE OF REPRESENTATIVES Session 116- FURTHER APPROPRIATIONS FOR MAKING CONTINUING OF HOMELAND SECURITY FOR THE...

More info »
Department of Defense   Law of War Manual (June 2015)

Department of Defense Law of War Manual (June 2015)

D E A R T M E N T O F D E F E N S E P N A L O F W A R M A W U A L J U N E 2 0 1 5 O F F I C E O F G E N ER A L C O U N S E L D P A R T M E N T E O F D E F E N S E

More info »
Numerical Recipes

Numerical Recipes

Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) Permission is granted for internet users to make one paper copy for their own personal use. Further reprod...

More info »
MDS 3.0 RAI Manual v1.16 October 2018

MDS 3.0 RAI Manual v1.16 October 2018

Centers for Medicare & Medicaid Services Long-Term Care Facility Resident Assessment Instrument 3.0 User’s Manual Version 1.16 October 2018

More info »
doj final opinion

doj final opinion

UNITED STAT ES DIS TRICT COURT IC F OR THE D ISTR T OF CO LU M BIA UNITED STAT F AMERICA, : ES O : : la in t if f, P 99 No. on cti l A vi Ci : 96 (GK) -24 : and : TOBACCO-F UND, : REE KIDS ACTION F : ...

More info »
07 5123 06 zigbee cluster library specification

07 5123 06 zigbee cluster library specification

ZigBee Cluster Library – 075123 Document ZigBee Cluster Library Specification Revision 6 Draft Version 1.0 - 0125 Chapter Document: 14 5123 - 07 ZigBee Document: 06 - ZigBee Document 07 - 5123 201 4 J...

More info »
Description of STM32F1 HAL and Low layer drivers

Description of STM32F1 HAL and Low layer drivers

UM1850 User manual Description of STM32F1 HAL and Low - layer drivers Introduction TM is an STMicroelectronics original initiative to make developers' lives easier by reducing STMCube development effo...

More info »
HANDBOOK of METAL ETCHANTS

HANDBOOK of METAL ETCHANTS

HANDBOOK of METAL ETCHANTS Editors Perrin Walker William H. Tarn CRC Press Boca Raton Boston London New York Washington, D.C. © 1991 by CRC Press LLC

More info »
JO 7400.11C   Airspace Designations and Reporting Points

JO 7400.11C Airspace Designations and Reporting Points

U.S. DEPARTMENT OF TRANSPORTATION ORDER FEDERAL AVIATION ADMINISTRATION 7400.11C JO Air Traffic Organization Policy August 13, 2018 SUBJ: Airspace Designations and Reporting Points . This O rder, publ...

More info »
oldnew 11.dvi

oldnew 11.dvi

C ́edric Villani O ptimal transport, old and new June 13, 2008 Springer Berlin Heidelberg NewYork Hong Kong London Milan Paris Tokyo

More info »
ppacacon

ppacacon

111 TH C ONGRESS " ! LEGISLATIVE COUNSEL P RINT 111–1 2d Session COMPILATION OF PATIENT PROTECTION AND AFFORDABLE CARE ACT [As Amended Through May 1, 2010] INCLUDING P ATIENT P ROTECTION AND A FFORDAB...

More info »
2017PA 00002 R00SB 01502SS1 PA

2017PA 00002 R00SB 01502SS1 PA

Senate Bill No. 1502 Act No. 17 - June Special Session, Public 2 E STATE BUDGET FOR T HE BIENNIUM AN ACT CONCERNING TH , MAKING APPROPRIATI ENDING JUNE 30, 2019 ONS THEREFOR, STING BONDS OF THE S TATE...

More info »