Git Product home page Git Product logo

rmi_udp's Introduction

Programming in RMI & UDP

Implementation and exploration of two client-server interactions: the Java Remote Method Invocation (RMI) and the User Data Protocol (UDP).

Coursework component of Imperial CO527 Computer Networks & Distributed Systems. Co-author: Nathan Amar

Background

This work is essentially a comparison of interaction methods- a first, primitive method (UDP), and a remote procedure call (Java RMI). A bit of background on these two methods, courtesy of the teachings from CO527:

UDP

The User Datagram Protocol (UDP) is simplest Transport Layer communication protocol available of the TCP/IP protocol suite. It involves minimum amount of communication mechanism. UDP is said to be an unreliable transport protocol but it uses IP services which provides best effort delivery mechanism.

General client-server interaction for UDP communication

Java RMI

However, basic message passing in UDP can leave a lot of work for the programmer e.g. constructing messages, transforming data types.

Remote Procedure Call, enabled by the Java RMI aim to make a call to a remote service look the same as a call to a local procedure. โ€“ The parameters to the call are carried in one or several request messages and the results returned reply message(s). โ€“ However calls to procedures implemented remotely can fail in different ways to procedures implemented locally, the semantics of an RPC are different from those of a local procedure.

General client-server interaction for RPC communication

Build & Execution

From root of repository,

make all

to build both the RMI and UDP component.

RMI

To run the RMIServer:

./rmiserver.sh 

To run the RMIClient

./rmiclient.sh [IP ADDRESS / SERVERNAME] [RECEIVING PORT] [NUMBER OF MESSAGES]

where [IP ADDRESS / SERVERNAME] is the server's IP address or the servername, and [NUMBER OF MESSAGES] is the number of messages you would like to transmit to the server. For example:

./rmiclient.sh localhost 100

or

./rmiclient.sh 116.99.232.120 100

UDP

To run the UDP Server:

./udpserver.sh [RECEIVING PORT]

where [RECEIVING PORT] is the agreed port you will use for communication with the client. For example:

./udpserver.sh 5000

To run the UDP Client:

./udpclient.sh [IP ADDRESS / SERVERNAME] [RECEIVING PORT] [NUMBER OF MESSAGES]

where [IP ADDRESS / SERVERNAME] is the server's IP address or the servername, [RECEIVING PORT] is the same as that used by the server, and [NUMBER OF MESSAGES] is the number of messages you would like to transmit to the server. For example:

./udpclient.sh 116.99.232.120 5000 1000

or

./udpclient.sh localhost 5000 1000

For a more in-depth analysis of this project, have a look at ProjectReport.pdf


If anything, the door is always open. Contact details in bio!

Enjoy :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.