Recap
Recap
n Multiplexing
n Several connections to be open (sockets: host, port number)
1
Other Issues Connections
n When to retransmit? n Setup and teardown is always tricky
n No good fixed time! n Requires three-way handshakes
Must compute on the fly
n
n Setup:
n Keep a running weighted average
n Open request packet (SYN, initial sequence number)
n Give more weight to recent measurements
n Acknowledgement (SYN, own sequence number, ack number)
n Acknowledgement of the acknowledgement
n Window management? n SYN occupies 1 byte of sequence space
n Windows can decay
n Lots of scenarios:
n Receiver: only send large increments
n What if packets get lost?
n Sender: wait for large windows
n What if machines go up and down?
n Cannot reuse sequence number if there are some old live data
2
Implementation issues Locating the server
n Stub generator --- generates stub automatically. n How does the client know which mbox to send to?
n For this, only need procedure signature --- types of arguments,
return value. n Binding: use central registry server
n Generates code on client to pack message, send it off
n On server to unpack message, call procedure
n Each server registers “types+instance” of the service, lists all procedure
calls supported.
n Input: interface definitions in an interface definition
language (IDL) n Access control at the registry protects clients from rogue servers
n Output: stub code in the appropriate source language (C,
C++, Java, …) n Server builds table including all exported RPC interfaces and interface
n Examples of modern RPC systems: ID (interface ID also used to detect calls to old interfaces)
n CORBA (Common Object Request Broker Architecture)
n DCOM (Distributed COM)
ids)
n Reply message lost n Server state: table of call ids; can be flushed in a while
n Callee retransmits, caller uses the corresponding request sequence n Duplicate packets
number to identify duplicate replies n Keeps the result around
n Retransmit the old result for the same request
Scenarios: lost server response, long call (client occasionally prods),
n Server crash: use another one. Client crash: log RPC calls n
acknowledges the second request, client just prods from that point on
and then ask server to kill orphans upon recovery.
Performance (contd.)
n Large messages: (file blocks not fitting in a packet)
n Acknowledge per packet
n Doubles packets, adds latency
n Alternative: stream data, send back a bit-mask of
acknowledgements
n Extra complexity is probably worth-while
n Process structure?
n Dedicate to a certain client