+ All Categories
Home > Documents > Xmpp Server Demo Scenario

Xmpp Server Demo Scenario

Date post: 27-Oct-2014
Category:
Upload: if05041736
View: 55 times
Download: 0 times
Share this document with a friend
28
The Binaries You can download the latest binary from intranet There are 2 component of the demo for this application : 1. Xmpp Server 2. Xmpp Client You can find the server executable (Petrolink.XmppServer.StartPanel ) in folder server.
Transcript
Page 1: Xmpp Server Demo Scenario

The Binaries

You can download the latest binary from intranet

There are 2 component of the demo for this application :

1. Xmpp Server

2. Xmpp Client

You can find the server executable (Petrolink.XmppServer.StartPanel ) in folder server.

Page 2: Xmpp Server Demo Scenario

You can find the client executable (Petrolink.XmppServer.ClientEmulator) in Client Directory

XMPP Server Control Panel

To initialize an xmpp server we have to define domain name, client port and server port.

Domain name or domainpart is used to identified the server, so every client that connect to this server

will have the identifier/JID like the following format local@domain/resource. The complete guide to the

address explanation is available from RFC 122

Page 3: Xmpp Server Demo Scenario

Client ports is the port that used by client to connect to the server. The default value for this port is

5222. For this demo because there are multiple server will be running in the same computer, so we have

to make the port configurable.

Server port is the port that used by another Xmpp server to connect to the server

You can start the server by press start button.

When the XMPP Server is started the server bind the client port and server port and waiting for

incoming connection. The listener is simply listen to incoming TCP connection to each port. We can see

the event from the logger.

The internal working of the server is something like this. ClientConnectionHandler will be resposible for

receiving incoming connection from client on port 5222 and ServerConnectionHandler will be

responsible for receiving connection from server on port 5333.

xmpp server ClientConnectionHandler

ServerConnectionHandler

Page 4: Xmpp Server Demo Scenario

For receiving socket connection the server using Asynchronous Programming Model (APM), so there's

no blocking for receiving each connection.

XMPP Client Panel

After we started the server then we can start the client to connect to the xmpp server.

Some parameter has to be configure for the client. User and domain is required to build the JID for this

server. Resource is already provided for this demo. Username is identifier for the client to authenticate

to the server, domain is use to join to the correct server and the default port for client to connect is

5222.

After filling all the parameter then we can start the client. Press Login button to connect to the server.

You can see some log regarding the login and handshake process from the logger. The logger is available

in the server side too.

Page 5: Xmpp Server Demo Scenario

You can find the explanation about the handshake process from the specification.

http://xmpp.org/rfcs/rfc6120.html#examples-c2s

After the client authenticate to the server then the client is identified by jid (

tambunanw@jakwt/PetroLink). The resource has been hardcoded for the demo purpose. This can be

created from the client or generated by the server.

The connection between server and client is now secured because right now it used TLS as the

specification define.

http://xmpp.org/rfcs/rfc6120.html#tls

Sending Message between client in the same server

We will demo the scenario based on this schema.

jakwt

farnanm@jakwt/PetroLink tambunanw@jakwt/Petrolin

k

Page 6: Xmpp Server Demo Scenario

Start another client with the following parameter and press login button

Now we can send the message from tambunanw to farnanm. In order to do that, we have to specify the

destination. Fill that blank with farnanm@jakwt/PetroLink and klik Send Message button. You should

see the logger will log the message stanza.

The message is received by server, the server get the session of the destination message and pass the

message to the receiver. Maybe the event order in the server log is unordered, that because the event is

asynchronous and push to the user interface by using asynchronous dispatcher too.

Page 7: Xmpp Server Demo Scenario

You can check that the client (farnanm@jakwt/PetroLink) receive the message by verifying in its log.

User can send Iq too to another user with full jid. Press the Send Iq button to send Iq.

Page 8: Xmpp Server Demo Scenario

The difference from Message stanza and Iq is you can send the message to the bare Jid

(farnanm@jakwt) but you have to use full JId to send an Iq. From the picture below you can see the

client send the message to the server with the bare jid (farnanm@jakwt). tambunanw try to send the Iq

to the bare jid but it won't receive by the client, because it has to use the full jid for destination.

Take a look the logger for the farnanm . There's no Iq received from the server. Only the message.

Page 9: Xmpp Server Demo Scenario

What's need to be completed from this demo is that the server should return the Iq Error if the server

can't route the Iq to the destination server.

Server to Server

We will run the following scheme for this scenario

Start another server with the following configuration. Make sure that you change the domain and

especially the port if you run the program within the same computer. In this case we fill

domain : datacenter

Client Port : 5224

Server Port : 5225

jakwt datacenter

tambunanw@jakwt aristo@datacenter

Page 10: Xmpp Server Demo Scenario

Now we want to connect the jakwt server to the datacenter server. Fill this configuration

Destination Domain : datacenter (fill this with the server destination we want to connect with)

Port : 5225 (fill this with the datacenter server port). After fill all the configuration press Connect To. The

server will be connected to the datacenter server using server to server mechanism based on the

RFC6120-ServerToServer.

After you fill all the configuration you can press Connect To button

Because there's only one server connected to this server so the datacenter should be the default

gateway.

The same thing happen with the datacenter server here.

Page 11: Xmpp Server Demo Scenario

Client to Client between different Server

Now we want to start a client that can connect to datacenter. Fill the configuration with the following.

user : aristo

domain : datacenter

port : 5224 (datacenter client port)

Press Login button.

Page 12: Xmpp Server Demo Scenario

We can send message from tambunanw at jakwt to aristo at datacenter. We've just need to change the

destination of the message in the tambunanw.

you can send the message back to tambunanw from aristo

Page 13: Xmpp Server Demo Scenario
Page 14: Xmpp Server Demo Scenario

Three Server Chain

Start the third server with the following configuration

domain : office

client port : 5226

server port : 5227

Connect the data center server to office server. You can do this by using the same method as previous.

Fill this configuration in data center control panel.

destination domain : office

port : 5227

After you fill all the configuration you can press Connect To button

jakwt datacenter office

tambunanw@jakwt

t

basir@office

Page 15: Xmpp Server Demo Scenario

You can check the log in both logger to make sure that both server is connected.

As usual the default gateway is always the first conected server for this demo.

Now we need to create a client for this office server. Start the client with the following configuration.

Press login button

Page 16: Xmpp Server Demo Scenario

We can send the message from basir@office to aristo@datacenter

Page 17: Xmpp Server Demo Scenario

From the office we can send the message to the jakwt via intermediary server (datacenter). In this case

basir@office can send the message to tambunanw@jakwt.

Page 18: Xmpp Server Demo Scenario
Page 19: Xmpp Server Demo Scenario

Four Server Chain

Start the fourth server with the following configuration

domain : aberdeen

client port : 5228

server port : 5229

And click start button.

Now we connect the office with aberdeen. Fill the following configuration on office control panel. And

press ConnectTo button

jakwt datacenter office

tambunanw@jakwt

t

anas@aberdeen

aberdeen

Page 20: Xmpp Server Demo Scenario

Abeerden will receive the office as its default gateway

Now Start a client with following configuration to connect to aberdeen

user : anas

domain : aberdeen

port : 5228

Page 21: Xmpp Server Demo Scenario

anas@aberdeen can send the message to basir@office, aristo@datacenter and tambunanw@jakwt

Page 22: Xmpp Server Demo Scenario

anas@aberdeen to tambunanw@jakwt

Page 23: Xmpp Server Demo Scenario

Branch Server with Additional Routing

For this scenario we will need to add 2 more server to the previous configuration.

We need to configure branch with the following configuration

domain : branch

client port : 5230

server port : 5231

Press start button to start branch server

jakwt datacenter

office

tambunanw@jakwt

t

anas@aberdeen

aberdeen

branch mexico

trino@mexico

Page 24: Xmpp Server Demo Scenario

we now connect the datacenter to branch by configure the datacenter panel.

fill the configuration with the following parameter :

destination domain : branch

port : 5231

after that press connecto button and the branch will be added to connected server.

you can verify the datacenter will be added to branch too.

Page 25: Xmpp Server Demo Scenario

Now we need to start mexico server and connect that to branch.

start mexico server with this configuration

domain : mexico

client port : 5232

server port : 5233

Connect the branch to mexico server by configuring this parameter in branch panel

Destination Domain : mexico

Port : 5233

The server will be added to the mexico server too.

Page 26: Xmpp Server Demo Scenario

Now because the client in jakwt can't contact the client in mexico or aberdeen directly, so we have to

add a route in datacenter.

There are two route need to be add, we have to tell that if the datacenter want to contact mexico then

it has to go through branch and if the data center want to contact aberdeen then it has to go through

office.

Now let's add the mexico through branch in datacenter routing.

fill connect route with "mexico branch" and press add route button

Page 27: Xmpp Server Demo Scenario

after that fill connect route with "aberdeen office" and press route button

Now let's add a client that connect to mexico server.

user : trino

domain : mexico

port : 5232

Press login button

Page 28: Xmpp Server Demo Scenario

Now let's try to send the message to tambunanw@jakwt and vice versa

But it can send the message from trino@mexico to anas@aberdeen.


Recommended