CS514: Intermediate Course in Operating SystemsTodayWhat are Web Services?Slide 4Slide 5Slide 6Slide 7Slide 8Web Services are often Front EndsThe Web Services “stack”Slide 11Advantages of web services?*How Web Services workHow it works…Slide 15Marshalling IssuesMarshalling…RPC – Remote Procedure CallThe basic RPC protocolSlide 20Slide 21Slide 22RPC – what can go wrong?RPC OptimizationWhat happens when machines could fail too?How about layering RPC on TCP?TCP…TCP optimizationsBack to RPC on TCP:RPC/TCP …RPC SemanticsRPC Semantics…WS & RPC Connectivity Issues: Network Address TranslationNAT…FirewallDemilitarized Zone (DMZ)THE END (for today)CS514: Intermediate Course in Operating SystemsProfessor Ken BirmanVivek Vishnumurthy: TATodayWeb Services – Introduction“Remote Procedure Call” in WSBinding, Marshalling…Using TCP as the transport for RPCsConnectivity Issues: NAT, FirewallWhat are Web Services?Today, we normally use Web browsers to talk to Web sitesBrowser names document via URL (lots of fun and games can happen here)Request and reply encoded in HTML, using HTTP to issue request to the siteWeb Services generalize this model so that computers can talk to computersWhat are Web Services?Web ServiceSOAP RouterBackend ProcessesClient SystemWhat are Web Services?“Web Services are software components described via WSDL which are capable of being accessed via standard network protocols such as SOAP over HTTP.”Web ServiceSOAP RouterBackend ProcessesWhat are Web Services?“Web Services are software components described via WSDL which are capable of being accessed via standard network protocols such as SOAP over HTTP.”Web ServiceSOAP RouterBackend ProcessesToday, SOAP is the primary standard. SOAP provides rules for encoding the request and its arguments.What are Web Services?“Web Services are software components described via WSDL which are capable of being accessed via standard network protocols such as SOAP over HTTP.”Web ServiceSOAP RouterBackend ProcessesSimilarly, the architecture doesn’t assume that all access will employ HTTP over TCP. In fact, .NET uses Web Services “internally” even on a single machine. But in that case, communication is over COMWhat are Web Services?“Web Services are software components described via WSDL which are capable of being accessed via standard network protocols such as SOAP over HTTP.”Web ServiceSOAP RouterWSDLdocument+Backend ProcessesWSDL documents are used to drive object assembly, code generation, and other development tools.Web Services are often Front EndsWebServer(e.g., IBM WebSphere,BEAWebLogic)DB2serverSAPWSDL-described Web ServiceWebAppServerWeb Service invokerCOMAppCORBAAppC#AppServer PlatformClient PlatformSOAPmessagingThe Web Services “stack”BusinessProcessesQualityofServiceDescriptionMessagingTransportCoordinationReliableMessagingSecurityBPEL4WS (IBM only, for now)XML, EncodingOtherProtocolsTCP/IP or other network transport protocolsSOAPWSDL, UDDI, InspectionTransactionsWhat are Web Services?Amazon would hand out “serverlets” for 3rd party developers to useThis connects their applications directly to Amazon’s systemWeb ServiceSOAP RouterBackend ProcessesserverletAdvantages of web services?*Web services provide interoperability between various software applications running on various platforms.“vendor, platform, and language agnostic”Web services leverage open standards and protocols. Protocols and data formats are text based where possibleEasy for developers to understand what is going on.By piggybacking on HTTP, web services can work through many common firewall security measures without requiring changes to their filtering rules.*: From WikipediaHow Web Services workFirst the client disc overs the service.More in next lecture!Typically, client then bin ds to the server.By setting up TCP connection to the discovered address .But binding not always needed.How it works…Next build the SOAP request: (Marshaling) Fill in what service is needed, and the arguments. Send it to server side.More details in next lectureSOAP router routes the request to the appropriate server(assuming more than one available server)Can do load balancing here.How it works…Server unpacks the request, (Demarshaling) handles it, computes result. Result sent back in the reverse direction: from the server to the SOAP router back to the client.Marshalling IssuesData exchanged between client and server needs to be in a platform independent format.“Endian”ness differ between machines.Data alignment issue (16/32/64 bits)Multiple floating point representations.Pointers(Have to support legacy systems too)In Web Services, the format used is XML.In UNICODE, so very verbose.There are other, less general, but more efficient formats.Marshalling…RPC – Remote Procedure CallCall a procedure on a remote machine “just” as you would on the local machine.Introduced by Birrell and Nelson in 1985Idea: mask distributed computing system using a “transparent” abstractionLooks like normal procedure callHides all aspects of distributed interactionSupports an easy programming modelToday, RPC is the core of many distributed systems.Can view the WS client server interaction as an RPC.client server“binds” to serverprepares, sends requestregisters with name service receives requestThe basic RPC protocolclient server“binds” to serverprepares, sends requestregisters with name service receives requestinvokes handlerThe basic RPC protocolclient server“binds” to serverprepares, sends requestregisters with name service receives requestinvokes handlersends replyThe basic RPC protocolclient server“binds” to serverprepares, sends requestunpacks replyregisters with name service receives requestinvokes handlersends replyThe basic RPC protocolRPC – what can go wrong?Network failure, client failure, server failureAssuming only network idiosyncrasies for now…RPCs use acks to make packet transmission more reliable.If timeout with no ack, resend packet.Leads to the issue of replayed requests.Each packet has a sequence number and timestamp embedded to enable detection of duplicates.RPC OptimizationDelay sending acks, so that imminent reply itself acts as an ack.Don’t send acks after each packet.Send ack only at the end of transmission of
View Full Document