resource sharing and the web what is a distributed system
play

Resource sharing and the web What is a Distributed System - PowerPoint PPT Presentation

Resource sharing and the web What is a Distributed System Client/Server model Motivation: sharing resources. Clients are active and servers are passive Caching technique vs. buffering Definition of distributed system: The


  1. Resource sharing and the web What is a Distributed System � Client/Server model � Motivation: sharing resources. � Clients are active and servers are passive � Caching technique vs. buffering � Definition of distributed system: � The WWW (World Wide Web) � a collection of independent computers that appears to its users as a single coherent system. � the "hypertext" structure among the documents. � a system of networked computers that coordinate their � Open system activity only by message passing. � Standard technological components: � Resources in a distributed system • HTML (HyperText Markup Language) � managed by a server program. • URL (Uniform Resource Locators) � accessed by communication via service interface provided by the server program. • HTTP (HyperText Transfer Protocol). � Different from “distributed computing” and � URL “distributed application”, multi-processor system � scheme:scheme-specific-identifier � In a distributed system, each computer has its own � HTTP memory, has its own clock, and each computer runs � A request-reply protocol its own operating systems. � Specify content types in request � Characteristics of distributed systems � One resource per request � Concurrency; No global clock; Independent failures � Dynamic pages, Downloaded code (mobile • Network failure; Computer failure code) 1 2 1

  2. Architectural models Interaction Model � Platform does not provide a view of a single � Distributed algorithm vs. simple algorithm coherent system � Difficulties in distributed algorithm � Solution: Middleware � Complex: client/server group model � Masking heterogeneity � Hard to predict: executing rate, transmission rate � Limitation of Middleware: “End-to-end argument” � No general state � Some functions require knowledge only the applications � Performance of communication channels have � Latency; Bandwidth; Jitter � Example: Careful file transfer, delivery guarantee � Computer clocks � Client-server model � clock drift rate: difference from perfect clock � Client-server group model: Partition or replicate � Correction: Time server or Logical clock resources � Proxy server and caches � Mobile code: push model � An example in client/server model: e-mail 3 4 2

  3. Networking and internetworking Switching schemes � Packet transmission � Broadcast � No switching logic, i.e., Ethernet, wireless � Message: a logical unit of information, a networks sequence of data items of arbitrary length. � Circuit switching � Packet: a sequence of binary data of restricted � Communicate through a number of intervening exchanges, i.e., POTS length, with addressing information. � Packet switching [1960s] � Packet size � store-and-forward network � Difference � May be lost, vary in latency. A few ten � Port address; microseconds-a few milliseconds. � IP address � short Internet packet takes up to 200 � Physical address milliseconds to arrive his destination � Frame relay � Video conference: < 50 milliseconds. � Combine the advantages of circuit switching to packet-switching. � Example: ATM 5 6 3

  4. Routing algorithms Internetworking Protocol � implemented by a program in the network � Overview layer at each router node � Unreliable, best-effort delivery service: post � two responsibilities office � route of each incoming packet: hop-by-hop � Connectionless: datagram • transported independently � datagrams sent by the basis same source to the same destination could arrive out � update its knowledge of the network of order � RIP � mask � Two-node loop instability • Solution: defining infinity; split horizon � Three-node instability • defining infinity � Open Shortest Path First protocol � link state routing method � Three steps � Can avoid problems in RIP. Why? 7 8 4

  5. Transport layer in TCP/IP suite Flow control in TCP � Difference between UDP and TCP � See sample solution of hw1 � delivery of a message from one process to another process. � Service-point addressing: port address � Segmentation and reassemble � connection mechanism � Flow control � Error control � Congestion control 9 1 0 5

  6. Error control in TCP Congestion, Congestion Control � Congestion: the load on the network is greater � Error detection and error correction than the capacity of the network. � Checksum � Congestion control: mechanisms that detect, � Acknowledgment prevent and handle network congestion. � Next sequence number expected � One Ack for every two in-order data segment � One Ack for each out-of-order segment � One Ack for each duplicate segment � time-out � Retransmission � Congestion control vs. flow control 1 1 1 2 6

  7. Congestion control in TCP Congestion Control � Two implementation points � Additive Increase/Multiplicative Decrease (AIMD) � Routers, switches: queuing discipline � End hosts Queuing disciplines at routers See sample solution of Hw1 1 1 3 4 7

  8. Congestion control in TCP Congestion control in TCP � Slow start � Fast Retransmit 1 1 5 6 8

  9. RED Gateway Ethernet � RED Gateway vs. DECbit � broadband or baseband signalling � See sample solution for hw1 � Carrier-Sense Multiple Access with Collision Detection (CSMA/CD) � All nodes are continuously ‘listening’ to the medium for packets that are addressed to them. � Packets � frames � Prefix: hardware timing purposes � the destination address, the sending address; � length of data (46—1,500 bytes), data of variable length, � checksum 1 1 7 8 9

  10. � Types of communication Ethernet � Persistent communication – Stores message until communicated to user � Packet collision � Transient communication – Stored only when sending and receiving processes are alive � carrier sensing: not enough • Transport level protocols provide transient A B communication time = 0 � Asynchronous – Sender continues after sending Message almost message there at time T when A B B starts – collision! time = T’ � Synchronous – Sender blocks until message is stored at receiver's local buffer, delivered to receiver or processed by receiver � Collision detection • Sender’s responsibility to detect A B time = 2T � Minimum packet length in collision detection � Send jamming signal, delay and try again � Delay time is selected using binary exponential Example of Persistent Asyn. Comm. : email system back-off 1 2 9 0 10

  11. IPC mechanisms � Pipes � processes must be related through a common ancestor � impossible in a distributed environment � Sockets Transient asynchronous communication: UDP, one- c) � message queues: Message-oriented way RPCs. Receipt-based transient synchronous communication Middleware (MOM) d) Delivery-based transient synchronous communication e) at message delivery: Asyn. RPCs Response-based transient synchronous communication: f) PRCs, RMIs. 2 2 1 2 11

  12. Socket creation: socket() � s = socket(domain, type, protocol); � domain : AF_UNIX, AF_INET, or AF_NS � type : SOCK_STREAM, SOCK_DGRAM, etc � protocol : TCP or UDP. Auto selected if 0 � Return a socket descriptor (a small integer for later reference) � Ex: s = socket(AF_INET, SOCK_STREAM, 0); Connection Establishment � Asymmetric, involving a server and a client � Server: create � bind � listen � accept � Client: create � bind � connect � connect(s, address, len) • s : socket descriptor • address : server address • len : the length of the address 2 2 3 4 12

  13. server socket() bind() System Call: listen() client � listen(s, max_num) listen() socket() � s : socket descriptor accept() connect() � max_num : the maximum number of outstanding Start a thread accept() connections which may be queued awaiting acceptance by the server process Wait for new read() write() connection � If the queue is full, a connection will be ignored read() write() (instead of refused). Why? 2 2 close() close() 5 6 13

  14. Java Sockets Java API for the Internet protocols � java.net.InetAddress server Static InetAddress.getByName(String host) client socket() � host name: “java.sun.com” � getHostAddress() : IP address string in socket() accept() textual presentation. Start a thread � getHostName(): the host name for this IP accept() address. Wait for new readUTF() writeUTF() connection � 32-bit integers for port number readUTF() writeUTF() � Socket types close() close() � UDP socket � TCP socket 2 2 7 8 14

  15. TCP socket Message-oriented Middleware (MOM) � TCP is a connection-oriented protocol, a � Main features connection is established first. � intermediate-term storage for messages: � Server listens connection request persistent ! � Client asks for a connection � neither sender nor receiver is required to be active � Two types of TCP sockets: ordinary sockets � Message queue � eliminate the need for and server sockets programs to be logically connected: � A client process constructs an ordinary asynchronous ! socket and then it asks for a connection with � takes minutes the server. � Only guarantee is that a message will be � A server socket receives a connection inserted in receivers’ queue. But no request, it constructs an ordinary socket guarantees about when, or even if the with an unused port number which message will actually be read completes the connection. � No limit on data size. � Streams: one in each direction 2 3 9 0 15

Recommend


More recommend