Introduction to Distributed Systems EEE466 DA06 - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Introduction to Distributed Systems EEE466 DA06

Description:

Marshalled by hand, could be converted to character string 'Smith London 1934' ... Marshalled using Sun XDR (External Data Representation) ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 15
Provided by: GregPh4
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Distributed Systems EEE466 DA06


1
Introduction to Distributed SystemsEEE466DA06
2
Next Quiz
  • Coulouris, et al
  • 3.1
  • 3.4
  • 3.7

3
Review
  • Deadlock
  • Livelock

4
Interprocess Communication
  • based on messages (data flow) between processes
  • originally developed to allow communication
    between different processes running on the same
    computer
  • later extended to allow distributed communication
  • relies on protocols at the application level to
    coordinate communication and to give meaning to
    received messages

5
Architectural Model
  • processes communicate with each other via data
    flow to named destinations, usually ports or
    sockets (or groups of these)
  • a single process may have several ports/sockets
  • processes must actively poll (read from) their
    ports/sockets to detect messages on them

unless we use asynchronous reads in the IPC API
6
Destinations
  • a destination may be any one of
  • process (V)
  • port (Mach, Chorus, Amoeba)
  • socket (Unix, Windows)
  • process group (V, Amoeba)
  • port group (Chorus)
  • object (Clouds, Emerald)
  • all these destinations except sockets are
    location and migration transparent
  • a migration transparent destination allows the
    destination to be relocated from one machine to
    another
  • a Unix-style socket consists of a hostname or IP
    address plus a numbered socket identifier

7
Fundamental Operations
  • send(portId, message)
  • sends a message to a given port
  • in some systems, the portId is the destination
    port in others it is a local port which has been
    bound (attached) to a destination port
  • receive(portId, message)
  • receives a message on a local port

8
Synchronous or Asynchronous
  • a queue is associated with each destination
  • sending processes add messages to queues,
    receiving processes remove them from queues
  • communication can be either synchronous or
    asynchronous
  • assuming multiple threads in a single process,
    the asynchronous version with blocking receive
    has few disadvantages
  • the non-blocking receive is a somewhat unusual
    programming model

9
Timeouts
  • Normally a blocking receive will wait until data
    arrives on the port
  • If the connection has gone down, or the sender
    has disappeared, data may never arrive
  • One solution is to associate a timeout interval
    with blocking receives
  • if the time expires, the receiving process can
    take appropriate action
  • it is not always clear what this should be
    design decision
  • the timeout interval must be chosen appropriately
  • fairly long compared with time required to
    transmit a message
  • message transmission time may not be known at
    design time

10
Reliability and Ordering
  • Message delivery may be
  • guaranteed (stream - TCP) or best effort
    (datagram UDP )
  • ordered (stream) or unordered (datagram)
  • duplicate-free (stream) or possibly duplicated
    (datagram)
  • Perfectly reliable communication sometimes not
    needed and causes overhead
  • need to store state at both ends
  • retransmission
  • latency
  • Reliable system can be created from unreliable
    one using acknowledgements
  • requires unique message identifiers, normally
    consist of request Id and sender identification

11
Reliability and Ordering
  • Stream (TCP Transport Control Protocol )
  • Connection oriented service
  • Like telephone service
  • Datagram (UDP User Datagram Protocol )
  • Connectionless oriented service
  • Like postal service

12
Message Contents
  • Data in programs is data structures/objects data
    in messages is linear streams of bytes
  • conversion from data structures to byte streams
    (and vice versa) is required
  • if system is heterogeneous, an external data
    representation may be required
  • inefficient if applied unnecessarily
  • conversion process is referred to as marshalling/
    unmarshalling
  • Marshalling and unmarshalling can be done
    automatically or by hand
  • In Java, marshalling can be handled automatically
    (and may be tuned) called serialization

13
Marshalling Example
  • A data structure has three fields, two
    variable-length strings and an integer Smith,
    London, 1934
  • Marshalled by hand, could be converted to
    character string Smith London 1934
  • requires reconstruction at other end
  • generally wasteful of bandwidth
  • Marshalled using Sun XDR (External Data
    Representation)
  • sent in four-byte blocks here 5 Smit h---
    Lond on--- 1934
  • for large binary data blocks, generally more
    space efficient (here, actually less efficient)
  • Must either send or know data types

14
Marshalling
  • Complex, non-linear data structures require
    flattening as part of marshalling
  • Must include enough information to exactly
    reconstruct their original forms
  • Examples
  • arrays
  • nested arrays
  • linked lists
  • trees
  • hash tables
  • maps
Write a Comment
User Comments (0)
About PowerShow.com