C. Varela, RPI1 Distributed Computing with Python Carlos Varela Rensselaer Polytechnic Institute.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

.Net Remoting by James Stone. What is.Net Remoting? RemotingRemoting is a technology that allows.NET applications to communicate. Remoting Same machine,
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
RPC Robert Grimm New York University Remote Procedure Calls.
1 Chapter 9 Network Programming. 2 Overview Java has rich class libraries to support network programming at various levels. There are standard classes.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Remote Method Invocation in Java Bennie Lewis EEL 6897.
.NET Remoting. .Net Remoting Replaces DCOM (Distributed Component Object Model – a proprietary Microsoft technology for communication among software components.
COEN 445 Communication Networks and Protocols Lab 4
Network Programming in Python Modified from Steve Holden Dan Rubenstein DK Moon Mehmet Hadi Gunes.
Distributed Systems Lecture #3: Remote Communication.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Advanced Java Class Network Programming. Network Protocols Overview Levels of Abstraction –HTTP protocol: spoken by Web Servers and Web Clients –TCP/IP:
1 Java Networking – Part I CS , Spring 2008/9.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
1. Introducing Java Computing  What is Java Computing?  Why Java Computing?  Enterprise Java Computing  Java and Internet Web Server.
Introduction to Remote Method Invocation (RMI)
OSI model Presentation Application Session Transport Network Data Link Physical ftp, telnet, smtp http tcp;udp ip NIC, MAC application protocols socket,
Client-Server Communication Sockets Remote Procedure Calls Remote Method Invocation (Java)
.NET Mobile Application Development Remote Procedure Call.
Client-server interactions in Mobile Applications.
By: Joel Rodriguez.  International student from Mexico  Delicias, Chihuahua Mexico  Spanish  Sports and Music.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
1 G52IWS: Distributed Computing Chris Greenhalgh.
Enabling Embedded Systems to access Internet Resources.
CSCI 6962: Server-side Design and Programming Web Services.
Lecture 15 Introduction to Web Services Web Service Applications.
1. I NTRODUCTION TO N ETWORKS Network programming is surprisingly easy in Java ◦ Most of the classes relevant to network programming are in the java.net.
1 Cisco Unified Application Environment Developers Conference 2008© 2008 Cisco Systems, Inc. All rights reserved.Cisco Public Introduction to Etch Scott.
Web Client-Server Server Client Hypertext link TCP port 80.
 2003 Joel C. Adams. All Rights Reserved. Calvin CollegeDept of Computer Science(1/11) Java Sockets and Simple Networking Joel Adams and Jeremy Frens.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
CS390- Unix Programming Environment CS 390 Unix Programming Environment Java Socket Programming.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Eric Tryon Brian Clark Christopher McKeowen. System Architecture The architecture can be broken down to three different basic layers Stub/skeleton layer.
Socket Programming Introduction. Socket Definition A network socket is one endpoint in a two-way communication flow between two programs running over.
S O A P ‘the protocol formerly known as Simple Object Access Protocol’ Team Pluto Bonnie, Brandon, George, Hojun.
LECTURE 10 Networking. NETWORKING IN PYTHON Many Python applications include networking – the ability to communicate between multiple machines. We are.
LECTURE 11 Networking Part 2. NETWORKING IN PYTHON At this point, we know how to write a simple TCP client and simple TCP server using Python’s raw sockets.
Java Distributed Object Model A remote object is one whose methods can be invoked from another JVM on a different host. It implements one or more remote.
COMP2322 Lab 4 Socket Programming Toby Lam March 2, 2016.
Nguyen Thi Thanh Nha HMCL by Roelof Kemp, Nicholas Palmer, Thilo Kielmann, and Henri Bal MOBICASE 2010, LNICST 2012 Cuckoo: A Computation Offloading Framework.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
IST 201 Chapter 11 Lecture 2. Ports Used by TCP & UDP Keep track of different types of transmissions crossing the network simultaneously. Combination.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Web Services General [recap] about web services Project C# Java Python Python web service.
Client-Server Communication
Lecture 11 Networking Part 2.
Java Distributed Object System
Lecture 10 Networking.
CSE 486/586 Distributed Systems Remote Procedure Call
MCA – 405 Elective –I (A) Java Programming & Technology
What is RMI? Remote Method Invocation
03 – Pyro Python Remote Objects Distributed Object Technology RMI
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
Overview of RMI Architecture
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Overview of RMI Architecture
Presentation transcript:

C. Varela, RPI1 Distributed Computing with Python Carlos Varela Rensselaer Polytechnic Institute

C. Varela, RPI2 Distributed Computing with Python Using standard TCP/IP (or UDP) sockets Using high-level libraries for remote method invocation –XML-RPC –Pyro (PYthon Remote Objects)

C. Varela, RPI3 Networking with Python Sockets Resembles C socket API Can use UDP (datagrams) or TCP (streamed connections) Does not require “non-standard” libraries Low-level, yet relatively easy to use and portable Enables more efficient communication and is programming language independent. New features require protocol extensions

C. Varela, RPI4 Sockets: An Echo Server from socket import * def main(): s = socket(AF_INET, SOCK_STREAM) s.bind((‘’, 50007)) # port number s.listen(1) conn, (remotehost, remoteport) = s.accept() print 'connected by', remotehost, remoteport while 1: data = conn.recv(1024) # buffer size if not data: break conn.send(data) conn.close() main()

C. Varela, RPI5 Sockets: An Echo Client from socket import * def main(): s = socket(AF_INET, SOCK_STREAM) s.connect((‘localhost’, 50007)) # port number s.send(‘Hello World’) data = s.recv(1024) # buffer size s.close() print data main()

C. Varela, RPI6 Remote Procedure Calls with Python XML-RPC library XML-RPC is programming-language/O.S. independent Uses XML as message format for parameters and return values, e.g.: Hello World Uses HTTP as the transport protocol. Enabling technology for building “web services”. Example requires downloading xmlrpcserver.py library:

C. Varela, RPI7 XML-RPC: An Echo Server import SocketServer; import xmlrpcserver; import xmlrpclib class EchoReqHandler(xmlrpcserver.RequestHandler): def call(self, method, params): print "Dispatching: ", method, params try: server_method = getattr(self, method) except: raise AttributeError, ”No method: %s" % method return server_method(params) def echo(self, value): return xmlrpclib.dumps(value) server = SocketServer.TCPServer(('', 8000), EchoReqHandler) server.serve_forever()

C. Varela, RPI8 XML-RPC: An Echo Client import xmlrpclib echosvr = xmlrpclib.Server(" print echosvr.echo("Hello World") print echosvr.echo(10)

C. Varela, RPI9 Distributed Computing with Python Remote Objects (PYRO) Resembles Java RMI: Server Daemon, Client Proxy To find remote objects: –By name, e.g., “PYRONAME://echo”, requires name server –By location, e.g., “PYROLOC://localhost:7766/echo” –By URI, e.g., “PYRO:// :7766/7f b1892e90a71” Method arguments, return values, and exceptions marshalled (“pickled”) over the network Example code requires downloading and installing Pyro at:

C. Varela, RPI10 Pyro: An Echo Server import Pyro.core class Echo(Pyro.core.ObjBase): def __init__(self): Pyro.core.ObjBase.__init__(self) def echo(self, string): return string; Pyro.core.initServer() daemon=Pyro.core.Daemon() uri=daemon.connect(Echo(),"echo-object") print "The object's uri is:",uri daemon.requestLoop()

C. Varela, RPI11 Pyro: An Echo Client import Pyro.core echoProxy = Pyro.core.getProxyForURI( "PYROLOC://localhost:7766/echo-object") print echoProxy.echo("Hello World")

C. Varela, RPI12 Python Remote Objects (PYRO) Python programming language-dependent Event server for publish-subscribe communication Mobile code, but BEWARE: No security guarantees!

C. Varela, RPI13 Exercises 1.Compare the round trip time of the Echo application using: TCP/IP XML-RPC Pyro 2.Use the XML-RPC client in Python to connect to an existing web service (e.g., Google) 3.Modify the echo example in Pyro to use the name service. What are alternative ways to get to the name server? 4.Does Pyro support distributed garbage collection?