Inter-process Communication Models

Slides:



Advertisements
Similar presentations
Overview of Web Services
Advertisements

1 Chapter 4: Interprocess Communication From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley 2001.
Socket Programming.
Internetworking (Contd) Chapter 4. Figure 3.26 ATM protocol layers.
1 Overview r Socket programming with TCP r Socket programming with UDP r Building a Web server.
OCT -- OCT Chapter 4 Coulouris Interprocess Communication.
B. RAMAMURTHY Web services. Topics What is a web service? From OO to WS WS and the cloud WS code.
Slides for Chapter 4: Interprocess Communication From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
Chapter 1 Internet & Web Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D. 1.
1 Inter-Process Communication: Network Programming using TCP Java Sockets Rajkumar Buyya Grid Computing and Distributed Systems (GRIDS) Laboratory Dept.
Building an ftp client and server using sockets we now know enough to build a sophisticated client/server application!  ftp  telnet  smtp  http.
1 Tuesday, December 16, 2008 The practical scientist is trying to solve tomorrow's problem on yesterday's computer. Computer scientists often have it the.
2: Application Layer1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm.
Web Services Description Language (WSDL) Jason Glenn CDA 5937 Process Coordination in Service and Computational Grids September 30, 2002.
Slides for Chapter 4: Interprocess Communication
Distributed Systems Concepts and Design Chapter 4.
Slides for Chapter 4: Interprocess Communication From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Addison-Wesley.
Slides for Chapter 4: Interprocess Communication
Slides for Chapter 4: Interprocess Communication From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Addison-Wesley.
Chapter 3: Interprocess Communication
Source: George Colouris, Jean Dollimore, Tim Kinderberg & Gordon Blair (2012). Distributed Systems: Concepts & Design (5 th Ed.). Essex: Addison-Wesley.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Exercises for Chapter 9: Web Services.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 4: Interprocess.
1 Distribuerede systemer – 12. februar 2001 Presentation based on slides by Coulouris et al, modified by Jens B Jorgensen.
Slides for Chapter 4: Interprocess Communication From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Addison-Wesley.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Kemal Baykal Rasim Ismayilov
Web Technologies Lecture 1 The Internet and HTTP.
1/30/20161 Introduction to Web Services Bina Ramamurthy
Java Programming II Java Network (I) Java Programming II.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 11 Omar Meqdadi Department of Computer Science and Software Engineering University.
Slides for Chapter 4: Interprocess Communication From Coulouris, Dollimore, Kindberg Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 9 Web Services.
Introduction to Web Services
Network Programming in Java CS 1111 Ryan Layer May 3, 2010
Sabri Kızanlık Ural Emekçi
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
A Web Services Journey on the .NET Bus
WEB SERVICES.
Introduction to Web Services
Unit – 5 JAVA Web Services
Working at a Small-to-Medium Business or ISP – Chapter 7
Working at a Small-to-Medium Business or ISP – Chapter 7
Unicast VS Multicast.
Web Services.
Overview of Web Services
Introduction to Web Services and SOA
WEB API.
Text extensions to slides © David E. Bakken,
Slides for Chapter 4: Interprocess Communication
Working at a Small-to-Medium Business or ISP – Chapter 7
Introduction to Web Services
Introduction to Web Services
Outline Introduction Networking Basics Understanding Ports and Sockets
سوکت (ارتباط بین کاربردها)
Text extensions to slides © David E. Bakken,
Distributed Objects: Communication and System Support
Distributed Systems through Web Services
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
Introduction to Service-Oriented Architectures (SOA)
Web Services and Application Development using Services API
Distributed System using Web Services
Introduction to Web Services
WEB SERVICES From Chapter 19, Distributed Systems
Distributed Objects: Communication and System Support
Slides for Chapter 4: Interprocess Communication
Introduction to Web Services and SOA
Chapter 2: Application layer
Distributed System using Web Services
Review Communication via paired sockets, one local and one remote
Presentation transcript:

Inter-process Communication Models Chapter 4 and other emerging technologies 2/4/2019

Topics for discussion Interprocess communication in distributed system High level language API/libraries for IPC and networking Application layer: HTML, XML, SOAP and REST 2/4/2019

Interprocess communication (IPC) Is about characteristics of protocols for communication between processes in a distributed systems. IP provides datagram and stream processing (What is the difference?) APIs are available for IPC: Ch.4 discusses a Java API; these provide support for programming high level communication services (Ch.4 and Ch.5) We limit the discussion to point-to-point but it can be easily extended to other models. API to TCP provides the abstract of a two-way stream between pairs of processes for streams of data. 2/4/2019

HLL APIs/libraries for TCP Java networking: https://docs.oracle.com/javase/8/docs/technotes/guides/net/index.html Python API: https://docs.python.org/3/howto/sockets.html Go lang API: https://appliedgo.net/networking/ 2/4/2019

Application Layers 2/4/2019

IPC Characteristics Message passing between processes is supported by “send” and “receive” Synchronous or asynchronous communication Message destination specification: addressing Reliability Ordering 2/4/2019

Sockets and ports message agreed port any port socket Internet address = 138.37.88.249 Internet address = 138.37.94.248 other ports client server Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Java API InetAddress = InetAddress.getByName(“timberlake.cse.buffalo.edu”); 128.205.32.8 Will return 4 bytes for IPV4 and 16 bytes for IPV6 UDP packet: Array of bytes, length of message, Internet address, Port Number 2/4/2019

UDP client sends a message to the server and gets a reply import java.net.*; import java.io.*; public class UDPClient{ public static void main(String args[]){ // args give message contents and server hostname DatagramSocket aSocket = null; try { aSocket = new DatagramSocket(); byte [] m = args[0].getBytes(); InetAddress aHost = InetAddress.getByName(args[1]); int serverPort = 6789; DatagramPacket request = new DatagramPacket(m, m.length(), aHost, serverPort); aSocket.send(request); byte[] buffer = new byte[1000]; DatagramPacket reply = new DatagramPacket(buffer, buffer.length); aSocket.receive(reply); System.out.println("Reply: " + new String(reply.getData())); }catch (SocketException e){System.out.println("Socket: " + e.getMessage()); }catch (IOException e){System.out.println("IO: " + e.getMessage());} }finally {if(aSocket != null) aSocket.close();} } Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

UDP server repeatedly receives a request and sends it back to the client import java.net.*; import java.io.*; public class UDPServer{ public static void main(String args[]){ DatagramSocket aSocket = null; try{ aSocket = new DatagramSocket(6789); byte[] buffer = new byte[1000]; while(true){ DatagramPacket request = new DatagramPacket(buffer, buffer.length); aSocket.receive(request); DatagramPacket reply = new DatagramPacket(request.getData(), request.getLength(), request.getAddress(), request.getPort()); aSocket.send(reply); } }catch (SocketException e){System.out.println("Socket: " + e.getMessage()); }catch (IOException e) {System.out.println("IO: " + e.getMessage());} }finally {if(aSocket != null) aSocket.close();} Instructor’s Guide for Coulouris, Dollimore, Kindberg and Blair, Distributed Systems: Concepts and Design Edn. 5 © Pearson Education 2012

Lets examine upper level protocols HTTP : Hyper Text Transfer Protocol HTML: Hyper Text Markup Language XML: eXtensible Markup Language Resource references on the web Web services SOAP: Simple Object Request Protocol REST: Representational State Transfer 2/4/2019

HTTP Protocol for communication among web entities. It is a standard from IETF (Internet Engineering Task Force) and W3C: (World Wide Web Consortium) Request-response model for client-server systems HTTP operates by sending requests with operations to be performed on resources referred by Uniform Resource Identifiers (URI) Request methods are: HEAD, GET, POST, PUT, DELETE, TRACE,… PATCH (just a few standard commands) 2/4/2019

HTML Hyper text mark-up language Standard markups for structural organization of web pages Example: <tr> <td style="vertical-align: top;"><br> </td> <td style="vertical-align: top;">File System<br> </td> <td style="vertical-align: top;"><a href=“ThisPres.pptx">FileSys</a><br> </td> <td style="vertical-align: top;"><br> </td> </tr> 2/4/2019

HTML over HTTP Web server Web Browser Web Browser Web Browser Request: http://www.cse.buffalo.edu/faculty/bina Request: Get http:… Web Browser browser interpretation of index.html Response: index.html Web Browser Web Browser 2/4/2019

XML XML is a markup language, developed by W3C (World Wide Web Consortium), mainly to overcome the limitations of HTML. But it took a life of its own and has become a very popular part of distributed systems. We will examine its definition, associated specifications (DTD, XSLT etc.), Java APIs available to process XML, protocols and services based on XML, and the role XML plays in a distributed computing environment. 2/4/2019

First Look at XML It has no predefined tags. It is stricter. Such as in HTML Domains may specify their own set of standard tags It is stricter. Most html document have errors and the browser have to built to take care of these. On the other hand XML has a strict syntax. There is a notion of validity and A notion of well-formed. 2/4/2019

An Example: Memo See the two documents enclosed: one in html and the other in XML formats. Observe the meaningful tags in XML. Compare it to a class definition: it looks like a class with data definitions and accessors (tags). 2/4/2019

Memo.html vs memo.xml <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>memo.html</title> </head> <body> <h3>Hello World</h3> Bina<br> CSE486 DS Students <br> Wake up everyone<br> BR<br> <br> </body> </html> <?xml version="1.0" ?>   <!DOCTYPE memo (View Source for full doctype...)> - <memo>   <header>Hello World</header>   <from>bina</from>   <to>CSE486 DS Students</to>   <body>Wake up everyone</body>   <sign>br</sign>   </memo> 2/4/2019

XML SOAP XML HTTP/Others TCP/IP REST 2/4/2019

XML to SOAP Simple xml can facilitate sending message to receive information. The message could be operations to be performed on objects. Simple Object Access Protocol (SOAP) Representational State Transfer (REST) is an architectural pattern on HTTP’s methods 2/4/2019

SOAP Request <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getProductDetails xmlns="http://warehouse.example.com/ws"> <productId>827635</productId> </getProductDetails> </soap:Body> </soap:Envelope> 2/4/2019

SOAP Reply <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getProductDetailsResponse xmlns="http://warehouse.example.com/ws"> <getProductDetailsResult> <productName>Toptimate 3-Piece Set</productName> <productId>827635</productId> <description>3-Piece luggage set. Black Polyester.</description> <price>96.50</price> <inStock>true</inStock> </getProductDetailsResult> </getProductDetailsResponse> </soap:Body> </soap:Envelope> 2/4/2019

SOAPWeb Services (WS)SOA Read this paper by Tim Berners Lee on WS: http://www.w3.org/DesignIssues/WebServices.html Service-oriented Architecture (SOA) Precursor to micro services But a monolithic collection of related functions/services 2/4/2019

WS Stack Service Flow WSFL Service Discovery UDDI Quality of Service Security Management Quality of Service Service Discovery UDDI Service Publication UDDI Service Description WSDL XML-based Messaging SOAP HTTP, FTP, MQ Email, IIOP Network 2/4/2019

WS Interoperability Infrastructure Service Description WSDL XML Messaging SOAP Network HTTP Do you see any platform or language dependencies here? 2/4/2019

Summary We looked at foundational concepts supporting web services: XML, SOAP, WSDL and Web Services standards. We also illustrated the concepts using sample programs. We will discuss REST-based web services and WDSL in the next lectures. 2/4/2019