Architectural Models CSE 513: Distributed Systems (System Models)
Guohong Cao Department of Computer & Engineering 310 Pond Lab [email protected]
An architectural model simplifies and abstracts the functions of the individual components of a distributed system and then it considers
The placement of the components across a network of computers The interrelationships between the components
Process classification
Server process: a process that accepts requests from other processes client process, peer process.
1 2
Software and hardware service layers
A distributed service can be provided by one or more server processes, interacting with each other and with client processes to maintain a consistent view of the services resources, e.g., network time protocol
Middleware
Mask heterogeneity and provide a convenient programming model
Implement communication and resource sharing to support distributed applications. For example, naming, security, transactions, persistent storage, event notification. Provide building blocks for construction of software components Early packages: RPC, Isis Recently, Object Management Groups Common Object Request Broker Architecture (CORBA), Java remote object invocation (RMI), Microsofts distributed common object model (DCOM).
Client-server model
Servers can be clients, and clients can be servers.
Services provided by multiple servers Improve performance Increase reliability by replication
Proxy servers and cache
Proxy servers are used to increase availability and performance of the service by reducing the load on the network and web-server Distributed whiteboard
Peer processes
All processes play similar roles.
Mobile code
An applets is responsible to communicate with the server, also referred to as push model, in which the server instead of the clients initiates interaction.
Mobile Agents
A mobile agent is a running program that travels from one computer to another carrying out a task to someones behalf, such as collecting information, eventually returning with the results.
Security
10
Network Computers and Thin Clients
Network computers
The maintenance of the OS and application software for desktop computer requires considerable efforts. Network computer downloads its OS and application software from the file server.
Low cost
Mobile devices and spontaneous networking
Easy connection to a local network Easy integration with local services, how to discovery services.
Thin clients
Supports a GUI while executing applications on a remote computer Low cost Drawbacks: CAD and image processing may incur network latencies.
11 Guohong Cao ([email protected])
Failure Models
Fail stop: a process crashes and remains halted. Send-omission: a process completes a send, but the message is not in the outgoing buffer Receive-omission: a msg is put into a processs incoming buffer, but that process does not receive it. Omission (channel): a message is lost Arbitrary (Byzantine): Anything can happen.
CSE 513: Distributed Systems (Communication Network)
Guohong Cao Department of Computer & Engineering 310 Pond Lab
[email protected]13
14
OSI v TCP/IP
15
32 Bits
Class
IPv4 Header
A B C D E
0 Network 10 110 1110 11110 Network Network
Host Host Host
1.0.0.0 to 127.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 240.0.0.0 to 247.255.255.255
Multicast address Reserved for future use
00000000000000000000000000000000 11111111111111111111111111111111 00 .. Network 127 00 1111 Host .. (Anything)
This host Broadcast on the local network A host on this network
1 1 1 Broadcast on a distant network Loopback test
17
18
Domain Name Service (DNS)
Map between IP addresses and machine names. Each organization has several name servers. DNS Hierarchy com, edu, gov, mil, net, org, country code for example: www.cse.psu.edu(130.203.30.5) mail.cse.psu.edu (130.203.3.50)
User Datagram Protocol (UDP)
Connectionless service for application level procedures
Unreliable Delivery and duplication control not guaranteed
Reduced overhead
Used in real-time applications Network management
Transmission Control Protocol (TCP)
Reliable ordered delivery
Implements congestion avoidance and control Reliability achieved by means of retransmissions if necessary
TCP Header
End-to-end semantics
Acknowledgements sent to TCP sender confirm delivery of data received by TCP receiver Ack for data sent only after data has reached receiver
Cumulative acknowledgements
An acknowledgement acks all contiguously received data
TCP assigns byte sequence numbers
For simplicity, people may use packet sequence numbers
21
22
Establishing a connection
Server
socket() bind() listen()
blocks until data Received from client
data (request)
Connectionless protocol Client
socket() bind() sendto()
process request
data (reply)
write()
23
read()
Guohong Cao ([email protected])
Server
socket()
Connection-oriented protocol
bind() listen() accept()
blocks until connection from client connection establishment data (request)
Jini Technology
Jini technology allows plug-and-participate
Client
socket() connect()
The arrow indicate the different levels of communication that are required.
After the camera locates the printer service, to print the picture it downloads and runs the java code supplied by the printing service. The code uses the underlying network transport, and perhaps RMI to implement the printing service
read()
process request
write()
write()
data (reply)
read()
26
Jini Technology
Camera
Printe picture
Jini system
Enabling users to share services and resources over a network
Printer Foreign service
Application Jini Java OS Network
service protocol
Service Jini Java OS
bridge protocol
Providing users easy access to resource anywhere on the network while allowing the network location of the user to change Simplifying the task of building, maintaining, and altering a network of devices, software, and users.
Java RMI network protocol
Network
Jini System
Based on discovery/join protocol, lookup service, and Remote Method Invocation (RMI).
Foreign service
Discovery
Application Jini Java OS Network
service protocol
Service Jini Java OS
bridge protocol
Java RMI network protocol
Network
29 30
Join
Lookup
Service Invocation
Leasing and distributed system
In non-distributed systems, resources are granted until explicitly freed or given up. Distributed system is complex, due to the failure of communication link or node.
Distributed system tend to be long lived. Shared by many clients in an uncoordinated fashion, difficult to maintain. As the system lives longer, the unwanted information can grow out of bound. Resorting to manual cleanup.
33
34
Characteristics of leasing
A lease is a time period during which the grantor (lookup service) ensures that the holder will have access to some resources. The lease can be cancelled by the holder. The holder can request to renew the lease. Negotiate with the granter A lease can expire. Time: widely distributed system
Use duration instead of absolute time. Not cumulative in the way errors in absolute time. Consider the communication delay
35
Discovery and Join
A distributed Jini system is called a djinn. A discovering entity is one or more objects that are in the process of obtaining reference to Jini lookup service A joining entity is one or more objects that is in the process of obtaining service from or exporting them to a djinn.
Discovery and Join
The protocol is based IP networks The multicast request protocol is employed by entities that wish to discover nearby lookup services The multicast announcement protocol is provided to allow lookup service to advertise their existence A unicast discovery protocol makes it possible for an entity to communicate with a specific lookup service.
The multicast request protocol
37
38
Multicast request participants
Steps of the Discovery entity
1. It establishes a multicast request client, which can send
packets to well-known multicast network endpoints 2. Establishes a TCP server socket that listens for incoming connection 3. Sends multicast request at periodic intervals (5s) 4. For each response, it adds the service ID to a list 5. Continues multicasting request for some time, then stop. 6. Finish if have received enough reference, otherwise, start using the multicast announcement protocol
Multicast request server
Binds a datagram socket to a well-known multicast endpoint When a multicast request is received, use attached ID set to decide whether to respond.
No respond if own ID is in the list or it is not in the requested group.
Multicast Announcement
The entity that runs the lookup service
constructs a object, send the multicast establish a server multicast announcement at intervals (120s). Long-live process.
The entity that listen to the announcement
binds a datagram sokect to well-known multicast endpoint, and listen For each announcement received, determine if it is in its own ID list.
42
If the entity must respond, Using unicast discovery protocol to connect to the other partys multicast response server
41
Unicast discovery by a lookup service
If a lookup service is responding to a multicast request, it makes TCP connection to that address and port
Unicast discovery by an entity
If an entity wishes to obtain a reference to a given djinn, it makes TCP connection to that address and port specified by the lookup locator
Persistent State
A service must maintain certain items of states.
Service ID A set of attributes that describe the services lookup service entry A set of specific lookup services to register with. A set of groups in with the service wishes to participate.
Join Protocol
When a service initially starts up, it should pause a random amount of time (up to 15s). Initial discovery and registration
Perform unicast discovery of each lookup service and register with them. In case of failure, retry or not retry
Lease renewal and handling of communication problem
retry, or wait a subsequent multicast announcement
Make changes and updates
45
46
Jini device bay could provide power, a network connection, and a processor running a JVM. Devices could be plugged into the bay and announce themselves to the bay.
47
48