problem chapter 5 3
play

Problem Chapter 5.3: Suppose you want to make a procedure call - PDF document

Problem Chapter 5.3: Suppose you want to make a procedure call Remote Procedure Calls Caller and called code are on different Internet hosts Situation is remote procedure call CS/ECPE 5516: Comm. Network Prof. Abrams Spring 2000


  1. Problem Chapter 5.3: Suppose you want to make a procedure call Remote Procedure Calls Caller and called code are on different Internet hosts Situation is “remote procedure call” CS/ECPE 5516: Comm. Network Prof. Abrams Spring 2000 CS/ECPE5516 1 CS/ECPE5516 2 Sample Scenario… Try this in groups… Is TCP a good protocol? You run Internet banking app on your PC. Is UDP a good protocol? App makes RPCs to bank’s computer How does regular old procedure call get converted to You want to move $100 from your checking to network communication? savings account: Design your own protocol. Be sure it… � Is efficient � Completes call with high probability moveC2S(100 Include in your design… ) � List of tasks protocol must do � Header format via RPC CS/ECPE5516 3 CS/ECPE5516 4 Did you consider these issues: Let’s answer the questions… How do you find Internet host running the remote procedure? Any way that remote procedure could be called twice (e.g., if network duplicates a packet containing the call)? What if remote procedure host executes procedure but crashes before sending reply? How to make caller wait until receiver is done executing procedure CS/ECPE5516 5 CS/ECPE5516 6 1

  2. ?: Is TCP a good RPC protocol? ?: Is UDP a good RPC protocol? Not really… Not really… � RPC needs request/reply � UDP doesn’t care if message is lost � TCP is for streaming � RPC needs messages � TCP is for streaming � RPC needs speed: maybe 2 messages � TCP uses 3+2+4 messages CS/ECPE5516 7 CS/ECPE5516 8 ?: How does proc call get ?: How do you find host running converted to network comm? remote procedure? A stub or proxy does conversion. Method 1: Caller names host to be called It uses proc call on one side, network Method 2: Directory service: communication on the other. “I want a square-root function. What host on the net has one?” See Fig. 5.11 in Peterson/Davie Use “rcp compiler” to invisibly add proxies Proxy marshalls & unmarshalls procedure arguments. CS/ECPE5516 9 CS/ECPE5516 10 ?: Any way that remote Example: Sun’s JINI procedure could be called twice Allows simplifies network device Yes: request is duplicated interconnection with a Lookup/Discovery service Want semantics to clarify requests: Each device provides services to others � At-most-once semantics: Devices register when they join community; � At most one copy of request is delivered � “At most” because zero might be delivered publishes service � Alternate: idempotent procedures: I’m a 600dpi B&W printer; my service is printing � can be executed multiple times, but give same result An app can lookup a service to discover a device � example: square-root More info: http://courses.cs.vt.edu/~wwwtut/Notes/Java/jini.html CS/ECPE5516 11 CS/ECPE5516 12 2

  3. ?: What if RPC executes but host Outline of Peterson/Davie crashes before sending reply? Solution (pp. 400-426) Need transaction semantics at host. Three sub-protocols: Commit protocol on server guarantees no � BLAST: sends message from host A to B intermediate state visible � CHAN: implements request/reply over BLAST Example: � SELECT: dispatches request to correct process � Subtract $100 from checking � Crash � Oops! You lost $100 – if intermediate state visible Implemented by list on disk of actions to execute on reboot Java Enterprise Beans offers transactions CS/ECPE5516 13 CS/ECPE5516 14 BLAST – Send Message BLAST (2) Sender: Receiver Set timer Fragment large message into packets Receive fragments: Transmits packets � place in order in buffer Set timer � reset timer If no response by timeout, give up When last fragment arrives, send ack If ack arrives, resend listed packets If timer pops, send ack Ack lists missing packets After 3 timeouts, give up CS/ECPE5516 15 CS/ECPE5516 16 CHAN – Implement request/reply SELECT guarantees message delivery (retransmits) CHAN runs between one app and one proc eliminats dups (via sequence number) SELECT handles set of calls between apps to common remote procedure via serialization implements at-most-once semantics SELECT also provides hierarchical names for allows synchronization between destinations, vs. ports: sender/receiver (program #, proc #) uses reply as implicit ack of request (file-server-program, read) sends I’m alive messages in case procedure (file-server-program, write) takes long time to execute CS/ECPE5516 17 CS/ECPE5516 18 3

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend