P2P to D-space GUI and Application Layer

P2P to 2D-space
GUI and Application Layer
Lab Chief Engineer: Dr. Ilana David
Instructor: Uri Schonfeld
Lily Itkin & Inna Gelfer





Overview
In the present time, a lot of machines are being connected to the
Internet.
Some of them are providing a lot of services to a lot of
endpoints, they are large and powerful (Servers)
Some of them are small, used by one user at the time, this type is
the most common one (Clients). When connected among them,
can provide services to different amount of users and devices at
the same time.
This powerful structure can be very useful in a lot of ways, and
many initiatives were made in order to take an advantage of such
a structure. There are several ways that it can be done – on
hierarchical base, managed centrally; or collaborative basis, with
no centralization and small amount of coordination from central
location.
P2P is a technology based on the second solution.
P2P characteristics





Many devices perform server-functions
Any device that performs server-functions is able
to perform all server-functions.
Any device that is acting as a client is able to find
one or more devices that are performing serverfunctions .
Servers assist clients to find more servers.
Many multiply-connected devices.
“Peer-to-peer (P2P) is a network architecture in which
nodes are relatively equal, in the sense that each node is in
principle capable of performing each of the functions
necessary to support the network, and in practice many
nodes do perform many of the functions “
Quoting from “Peer-to-Peer (P2P) - An Overview”, by Roger Clarke
P2P to 2DSpace implementation
P2P to 2D-Space


P2P2DSpace is a P2P-based system, supplying a
platform for a map-base interactive application.
The purposes of the project:
To demonstrate a possible usage of the P2P
technologies.
 To study about a problems and possible solutions
typical for P2P-based system development.

P2P to 2D-Space Layers
Application
Node
Transport
Map
Application overview
 The
idea of application based on a
popular “Civilization” game
principals.
 The users travel on a map, interact
with other users via several
channels and able to perform
different actions.
User description

User details


User has a nickname
Friends List

A list of ‘known’ application users. Used to defined an
interaction destination:




Connect to the friend’s world
Visit the friends home
Chat
Items List

User manages a set of its items, which may be placed both on
user’s local space and on the global map



Items can be moved all over the map [local and global]
New items can be created by the user
Actions can be performed on the items
User Home-Base




Each user has his personal home.
The home can be designed by user.
Items may be added/performed action
on/deleted from the house.
Other users may visit this home too, and “play”
with the items.
username
This is how homebase of user looks like
item
avatar
Friends list
Connection
status
Items list
Global Map


The user may travel on the global map.
In order to enter the global map, the user have two
options:




To connect to the world of some other user (which will be
the bootstrapper for him)
To create its own world .
The user may travel on the global map, “play” with the
items located on the map
If, upon his travel, the user meets the home of other
user, he may visit this home.

If user A ran into the home of user B, and user A is not yet
familiar to user B, then user B is automatically added to users
A friends list.
This is how
global map looks
like
General Operations

The following general operations are available
for each user all the time (both on global map
and inside some home):
Add new friend – The user may add new friend
manually (by inserting his name and ip), or
automatically, by entering this users’ home.
 Add new item – The user may add new item to his
item list. The new item input requires a name for an
item and a several picture (to represent items’
different states).

Chat support
Chat



Users, while traveling within the global map or
‘arranging their home place’, have an ability to
use additional way of an interaction with other
users – CHAT
Along with the textual messages, the application
is able to deliver voice messages
The chat functionality is based on ‘out of box’
jain-sip packages, which after certain changes,
deployed into the application.
SIP - Session Initiation Protocol



SIP is a signaling protocol for creating,
modifying and destroying dialogs between
multiple endpoints
JAIN SIP is the standardized Java
interface to the Session Initiation Protocol
for desktop and server applications.
JAIN SIP supports the SIP protocol
functionality described in RFC 3261. [see the
link to the RFC in the ‘Links’ section]
JAIN-SIP Packages

In order to support chat feature, 3 jain sip
packages are used

Jain-sip
Sip layer implementation.

Jain-sip presence proxy
The proxy runs on each application host, confirming P2P
technology

Jain-sip applet phone
Instant text messaging and VOIP technology implementation
SIP Architecture *
* The slide is taken from the official Jain Sip Tutorial
Jain SIP Messaging Architecture *
* The slide is taken from the official Jain Sip Tutorial
Forced changes

General changes
Full omission of jain sip graphical interface
 Automatic creation and configuration of chat
entities

Sip registration
 Sip subscription


Changes forced by p2p technology obedience

Remote registration
Design decisions, principles and
considerations


In order to avoid logical connection that is too tight
between the user and the server he's logging into,
logical separation was made between the region, which
the server is responsible of, and a "user's room". Upon
login, coordinate being assigned to user (according to
username hashing). In this coordinate a link to user's
room created. The link represented by house item.
Due to the fact, that user can travel between regions of
different servers, and the application should present the
relevant background. The querying is preformed via
Map layer and the calculation and connection to other
servers is transparent to application layer.
Design decisions, principles and
considerations – cont.


Due to the fact, that several users can be located and performing
actions on objects in the same region simultaneously, a decision
was made, to create a "refresh" button, such as every time a user
would like to get the most updated map, he will press this
button. If several actions performed simultaneously, it's up to
the peer in charge to decide in which order the actions would be
carried out.
It was decided to use one centralized background supplier. To
get a piece of global map, a peer must send a request to the
background manager, with the wanted coordinates. The
background manager computes the suitable piece, and returns it
to the peer.
Example Flows
Login flow

When user logs into the system, the following
parameters are loaded from his configuration
file:
Paths to his: avatar, background of his home
 List of friends (with usernames and URLs)
 List of items which located inside his house
(including location, possible state and current state).
 Parameters of the background manager
 Parameters of chat proxy.

Login flow – cont.


Now the user can “organize” his home, change
the background, move, add or delete the items
and perform action on them.
If user wishes to connect to the global map:
If he wish to create his own world, it chooses to
connect via <New User> (the default), and his peer
will be the root of this world.
 If he wish to connect to an already existing world,
he should choose (in friends list) some user that will
be his bostrapper.

Go To Flows



Go To coordinate: shows a piece of global map,
while the requested coordinate is its center
Go To user: goes to the requested user home,
located on global map. The needed coordinate is
computed by username hashing.
Go To home: shows users’ home base.
Logout flows

Upon logout, the users’ personal information
saved to configuration file, in order to recreate
all the relevant data upon user re-logon.
Application installation

Requirements
jmf 2.1.1.e
 Java > 1.5


Configuration


Application home (xml,bat)
Execution

run_p2p.bat
Links
P2P technology
http://www.anu.edu.au/people/Roger.Clarke/EC/P2POview.ht
ml
Sip project http://www-x.antd.nist.gov/proj/iptel/
Sip implementation https://jain-sip.dev.java.net
SIP RFC http://www.rfc-archive.org/getrfc.php?rfc=3261