System ModelsDistributed system modelsSlide 3Architectural ModelSoftware and hardware service layers in distributed systemsMiddlewareClients invoke individual serversA service provided by multiple serversWeb proxy server and cachesA distributed application based on peer processesWeb appletsInteraction ModelsSocket based communicationClassic view of network APISlide 15Slide 16Slide 17Protocol layeringProtocol layering exampleSlide 20Slide 21Slide 22Slide 23Slide 24Slide 25Slide 26Basic elements of any protocol headerDemuxing fieldsIP (Internet Protocol)IP(v4) address formatUDP (User Datagram Protocol)TCP (Transmission Control Protocol)UDP vs. TCPSummary01/14/19 1System ModelsChapter 2: Coulouris +Chapter notes from K. Birman’s that in turn was based on Professor Paul Francis, Cornell University01/14/19 2Distributed system modelsModel: “a simplified representation of a system or phenomenon, as in the sciences or economics, with any hypotheses required to describe the system or explain the phenomenon, often mathematically.”01/14/19 3System ModelsArchitectural model defines the way in which the components of the system are placed and how they interact with one another and the way in which they are mapped onto the underlying network of computers.Interaction model deals with communication details among the components and their timing and performance details.Failure model gives specification of faults and defines reliable communication and correct processes.Security model specifies possible threats and defines the concept of secure channels.We will look at architectural models + Interaction models in this discussion; We will deal with failure and security models later in the semester.01/14/19 4Architectural ModelConcerned with placement of its parts and relationship among them.Example: client-server model, peer-to-peer modelAbstracts the functions of the individual components. Defines patterns for distribution of data and workload.Defines patterns of communication among the components.Example: Definition of server process, client process and peer process and protocols for communication among processes; definition client/server model and its variations.01/14/19 5Software and hardware service layers in distributed systemsApplications, servicesComputer and network hardwarePlatformOperating system Middleware01/14/19 6MiddlewareLayer of software whose purpose is to mask the heterogeneity and to provide a convenient programming model for application programmers.Middleware supports such abstractions as remote method invocation, group communications, event notification, replication of shared data, real-time data streaming. Examples: CORBA spec by OMG, Java RMI, grid software (Globus, Open grid Services), Web services.01/14/19 7Clients invoke individual serversServerClientClientinvocationresultServerinvocationresultProcess:Key:Computer:EX: browser, web clientEX: Web serverEX: 1. File server, 2. Web crawler01/14/19 8A service provided by multiple serversServerServerServerServiceClientClientEX: akamai, altavista, Sun’s NIS (data replication)01/14/19 9Web proxy server and cachesClientProxyWeb serverWeb serverserverClientProxy servers + cache are used to provide increased Availability and performance. They also play a major role Firewall based security. http://www.interhack.net/pubs/fwfaq/01/14/19 10A distributed application based on peer processesCoordinationApplicationcodeCoordinationApplicationcodeCoordinationApplicationcodeEx: distributed Whiteboard Application;Music sharing01/14/19 11Web appletsa) client request results in the downloading of applet code Web serverClientWeb serverAppletApplet codeClientb) client interacts with the applet EX: Code streaming; mobile code01/14/19 12Interaction ModelsWithin address space (using path as addresses)Socket based communication: connection-oriented, connection-lessSocket is an end-point of communicationLets look at some code + details01/14/19 13Socket based communicationint sockfd; struct sockaddr_in addr; addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr(SERV_HOST_ADDR); addr.sin_port = htons(SERV_TCP_PORT); sockfd = socket(AF_INET, SOCK_STREAM, 0);connect(sockfd, (struct sockaddr *) &addr, sizeof(serv_addr));do_stuff(stdin, sockfd);01/14/19 14Classic view of network APIStart with host name (maybe)foo.bar.com01/14/19 15Classic view of network APIStart with host nameGet an IP addressfoo.bar.comgethostbyname()10.5.4.301/14/19 16Classic view of network APIStart with host nameGet an IP addressMake a socket (protocol, address)foo.bar.comgethostbyname()10.5.4.3sock_idsocket();connect();…01/14/19 17Classic view of network APIStart with host nameGet an IP addressMake a socket (protocol, address)Send byte stream (TCP) or packets (UDP)foo.bar.comgethostbyname()10.5.4.3sock_idsocket();connect();…TCP sock UDP sockNetwork1,2,3,4,5,6,7,8,9 . . .…Eventually arrive in orderMay or may not arrive01/14/19 18Protocol layeringCommunications stack consists of a set of services, each providing a service to the layer above, and using services of the layer belowEach service has a programming API, just like any software moduleEach service has to convey information one or more peers across the networkThis information is contained in a headerThe headers are transmitted in the same order as the layered services01/14/19 19Protocol layering exampleBrowserprocessHTTPTCPLink1IPLink1IPLink2Web serverprocessHTTPTCPLink1IPPhysical Link 1 Physical Link 2Router01/14/19 20HTTPProtocol layering exampleBrowserprocessTCPLink1IPLink1IPLink2Web serverprocessHTTPTCPLink1IPPhysical Link 1 Physical Link 2RouterHBrowser wants to request a page. Calls HTTP with the web address (URL).HTTP’s job is to convey the URL to the web server.HTTP learns the IP address of the web server, adds its header, and calls TCP.01/14/19 21HTTPProtocol layering exampleBrowserprocessTCPLink1IPLink1IPLink2Web serverprocessHTTPTCPLink1IPPhysical Link 1 Physical Link 2HTCP’s job is to work with server to make sure bytes arrive reliably and in order.TCP adds its header and calls IP.(Before that, TCP establishes a connection with its peer.)TRouter01/14/19 22HTTPProtocol layering exampleBrowserprocessTCPLink1IPLink1IPLink2Web serverprocessHTTPTCPLink1IPPhysical Link 1 Physical Link 2HIP’s job is to get the packet routed to the peer through zero or
View Full Document