CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.

Slides:



Advertisements
Similar presentations
RMI Varun SainiYing Chen. What is RMI? RMI is the action of invoking a method of a remote interface on a remote object. It is used to develop applications.
Advertisements

Remote Method Invocation CS587x Lecture Department of Computer Science Iowa State University.
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
Advanced Programming Rabie A. Ramadan Lecture 4. A Simple Use of Java Remote Method Invocation (RMI) 2.
Java Remote Method Invocation (RMI) In Java we implement object systems: O1O2 O3 thread 1thread 2 execution scheme JVM 1JVM 2 distribution scheme.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
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.
DISTRIBUTED FILE SYSTEM USING RMI
Cis e-commerce -- lecture #6: Content Distribution Networks and P2P (based on notes from Dr Peter McBurney © )
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
FRIENDS: File Retrieval In a dEcentralized Network Distribution System Steven Huang, Kevin Li Computer Science and Engineering University of California,
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Introduction to Remote Method Invocation (RMI)
Protecting Free Expression Online with Freenet Presented by Ho Tsz Kin I. Clarke, T. W. Hong, S. G. Miller, O. Sandberg, and B. Wiley 14/08/2003.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Freenet A Distributed Anonymous Information Storage and Retrieval System I Clarke O Sandberg I Clarke O Sandberg B WileyT W Hong.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Internet Software Development Remote Method Invocation Paul Krause.
Freenet. Anonymity  Napster, Gnutella, Kazaa do not provide anonymity  Users know who they are downloading from  Others know who sent a query  Freenet.
Peer-to-Peer Computing CS587x Lecture Department of Computer Science Iowa State University.
1 Java Programming II Java Network II (Distributed Objects in Java)
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Vulnerabilities in peer to peer communications Web Security Sravan Kunnuri.
+ A Short Java RMI Tutorial Usman Saleem
LAB 1CSIS04021 Briefing on Assignment One & RMI Programming February 13, 2007.
Java RMI: Remote Method Invocation January 2000 Nancy McCracken Syracuse University.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI RMI is the java API that facilitate distributed computing by allowing remote method calls. A remote method call represents a method invocation between.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
RMI Continued IS Outline  Review of RMI  Programming example.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
1 Peer-to-Peer Technologies Seminar by: Kunal Goswami (05IT6006) School of Information Technology Guided by: Prof. C.R.Mandal, School of Information Technology.
P2PComputing/Scalab 1 Gnutella and Freenet Ramaswamy N.Vadivelu Scalab.
Li Tak Sing COMPS311F. RMI callbacks In previous example, only the client can initiate a communication with the server. The server can only response to.
Java Remote Method Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
1 Java Remote Method Invocation java.rmi.* java.rmi.registry.* java.rmi.server.*
ADVANCED COMPUTER NETWORKS Peer-Peer (P2P) Networks 1.
 Java RMI Distributed Systems IT332. Outline  Introduction to RMI  RMI Architecture  RMI Programming and a Sample Example:  Server-Side RMI programming.
Remote Method Invocation A Client Server Approach.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Java RMI. RMI Any object whose methods can be invoked from another Java VM is called a remote object.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
P2P Networking: Freenet Adriane Lau November 9, 2004 MIE456F.
CSC 480 Software Engineering Lab 6 – RMI Nov 8, 2002.
Netprog Java RMI1 Remote Method Invocation.
Using RMI The Example of A Remote Calculator 1. Parts of A Working RMI System A working RMI system is composed of several parts. –Interface definitions.
RMI1 Remote Method Invocation Adapted from “Core Java 2” by Cay Horstmann.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
January 26, Ann Wollrath Copyright 1999 Sun Microsystems, Inc., all rights reserved. Java ™ RMI Overview Ann Wollrath Senior Staff Engineer Sun Microsystems,
Java Remote Method Invocation (RMI)
RMI Packages Overview java.rmi java.rmi.server java.rmi.registry
What is RMI? Remote Method Invocation
Remote Method Invocation
Comparison of LAN, MAN, WAN
null, true, and false are also reserved.
Chapter 40 Remote Method Invocation
Remote method invocation (RMI)
Chapter 46 Remote Method Invocation
Using RMI -The Example of A Remote Calculator
Chapter 46 Remote Method Invocation
Java Remote Method Invocation
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina

4/21/20052 Peer-to-Peer Internet was designed to be an open and cooperative network Commercial applications and security concerns push Internet to client-server model A new trend for peer-to-peer File sharing Online chatting Resource sharing No boredom, more freedom!

4/21/20053 Issues in Peer-to-Peer Flexibility Scalability Anonymity Accountability

4/21/20054 Peer-to-Peer Applications Napster Gnutella Freenet Free Haven

4/21/20055 Napster Popular online music service Users first connect to Napster server to search for other users who have the target songs Server returns search results to users Users connect to each other to share songs Legal problems

4/21/20056 Gnutella A decentralized search system A language with many Gnutella-compatible implementations Emphasis on flexibility No privacy

4/21/20057 Freenet A decentralized system for distributing files User forwards a request to a node he/she knows and trusts Next node returns a hit or forwards request to a likely node Nodes in Freenet become increasingly connected Use unique ID for each file Provide partial anonymity

4/21/20058 Freenet Request Sequence From “Freenet: A Distributed Anonymous Information Storage and Retrieval System”, I. Clarke, O. Sandberg, B. Wiley, and T. Hong.

4/21/20059 Free Haven A system to provide anonymous storage that resists attempts of adversaries to find or destroy any stored data Emphasis on anonymity Publisher anonymity Reader anonymity Server anonymity Use a reputation system to address accountability

4/21/ Anonymity in Peer-to-Peer From “Tarzan: A Peer-to-Peer Anonymizing Network Layer”, by M. Freedman and R. Morris, ACM CCS’02.

4/21/ Overlay Networks A virtual network that uses underlying infrastructure network to provide connection between its nodes Messages between nodes are tunneled via underlying network Conceal unnecessary details about underlying network Can provide specialized functions

4/21/ Overlay Architecture

4/21/ Peer-to-Peer Overlay Networks Satisfy special need of a small group Make peer-to-peer application more scalable Improve efficiency

4/21/ An RMI Peering Example A peer-to-peer client locates central peering server and makes a remote call to obtain a partner If server has no client waiting to be partnered, it stores a reference to calling client and returns false If server has client waiting for same service, it notifies both clients of their new partner and returns true Remote interfaces PartnerServer and Partner Implementation classes PartnerServerImpl and PartnerImpl

4/21/ Interface PartnerServer /* Java Network Programming, Second Edition * Merlin Hughes, Michael Shoffner, Derek Hamner * Manning Publications Company; ISBN X * * * * Copyright (c) Merlin Hughes, Michael Shoffner, Derek Hamner; * all rights reserved; see license.txt for details. */ import java.rmi.*; public interface PartnerServer extends Remote { public boolean assignPartner (String service, Partner myself) throws RemoteException; }

4/21/ Interface Partner /* Java Network Programming, Second Edition * Merlin Hughes, Michael Shoffner, Derek Hamner * Manning Publications Company; ISBN X * * * * Copyright (c) Merlin Hughes, Michael Shoffner, Derek Hamner; * all rights reserved; see license.txt for details. */ import java.rmi.*; public interface Partner extends Remote { public void partnered (String service, Partner partner) throws RemoteException; }

4/21/ Class PartnerServerImpl /* Java Network Programming, Second Edition * Merlin Hughes, Michael Shoffner, Derek Hamner * Manning Publications Company; ISBN X * * * * Copyright (c) Merlin Hughes, Michael Shoffner, Derek Hamner; * all rights reserved; see license.txt for details. */ import java.rmi.*; import java.util.*; import java.rmi.server.*; import java.rmi.registry.*; public class PartnerServerImpl extends UnicastRemoteObject implements PartnerServer { // public PartnerServerImpl () throws RemoteException … // public synchronized boolean assignPartner (String service, Partner myself) throws RemoteException … // public static void main (String[] args) throws RemoteException, AlreadyBoundException … }

4/21/ Constructor PartnerServerImpl protected Hashtable pending; public PartnerServerImpl () throws RemoteException { pending = new Hashtable (); }

4/21/ Method assignPartner public synchronized boolean assignPartner (String service, Partner myself) throws RemoteException { if (!pending.containsKey (service)) { pending.put (service, myself); return false; } else { Partner partner = (Partner) pending.get (service); pending.remove (service); partner.partnered (service, myself); myself.partnered (service, partner); return true; }

4/21/ Method main public static void main (String[] args) throws RemoteException, AlreadyBoundException { if (args.length != 2) throw new IllegalArgumentException ("Syntax: PartnerServerImpl "); int port = Integer.parseInt (args[0]); String service = args[1]; PartnerServerImpl partnerServer = new PartnerServerImpl (); try { Registry registry = LocateRegistry.getRegistry (port); registry.bind (service, partnerServer); } catch (ConnectException ex) { Registry registry = LocateRegistry.createRegistry (port); registry.bind (service, partnerServer); }

4/21/ Class PartnerImpl /* Java Network Programming, Second Edition * Merlin Hughes, Michael Shoffner, Derek Hamner * Manning Publications Company; ISBN X * * * * Copyright (c) Merlin Hughes, Michael Shoffner, Derek Hamner; * all rights reserved; see license.txt for details. */ import java.rmi.*; import java.rmi.server.*; import java.rmi.registry.*; public class PartnerImpl implements Partner { // public void partnered (String service, Partner partner) … // public static void main (String[] args) throws RemoteException, NotBoundException … }

4/21/ Methods of PartnerImpl public void partnered (String service, Partner partner) { System.out.println ("Partnered with " + partner + " for " + service + '.'); } public static void main (String[] args) throws RemoteException, NotBoundException { if (args.length != 3) throw new IllegalArgumentException ("Syntax: PartnerImpl "); PartnerImpl partner = new PartnerImpl (); Partner partnerRef = (Partner) UnicastRemoteObject.exportObject (partner); String host = args[0]; int port = Integer.parseInt (args[1]); String service = args[2]; Registry registry = LocateRegistry.getRegistry (host, port); PartnerServer server = (PartnerServer) registry.lookup (service); if (!server.assignPartner ("Testing", partnerRef)) System.out.println ("waiting..."); }

4/21/ Final Exam Will be held on Saturday, April 30, 9-11am Count for 20% toward your final grade More emphasis on programming than midterm