Wednesday, May 12, 2010

Use SDS as Presence Server Simulator

Pre-setup

1) make sure Ericsson SDS has been properly installed (SDS 4.2 in this case). Refer to another earlier note/blog for this.
2) Verify the provisioning/user setting. The default data should be ok....however, you data may be changed if you have some earlier version of SDS installed. So double confirm them again

- Go to menu->windows->preference / Ericsson SDS /Server /CSCF, make sure "ericsson.com" is the domain name. Otherwise, click "Restore Defaults". If you make any change, you need to restart CSCF

- Check IMS Core provisioning . Go to menu-> SDS -> server -> provisioning
Under DNS, you should have 3 default URI: sip:pgm.ericsson.com; sip:poc.ericsson.com; sip:imsm.ericsson.com and there DNS record (see the picture)

- make sure "alice@ericsson.com" "bob@ericsson.com" are there in the HSS -> User Profile
and the users' Service Profile = "profiel" (default)


start/stop server

Start the Sailfin server, DNS server and CSCF. Refer to the earlier note/blog for this. Presence Server is automatically started after you start the sailfin.

same idea for stop.

Demonstrate Presence Server is working properly

Use "SDS -> Test tools -> start test agent" for this testing. You need to start two of them, one for "alice" and one for "bob".

The use case will be the following:
step 1: Alice registers itself
- use the default message generated by the tool. Make sure: method = "Register". URI="sip:ericsson.com"; To Name "Alice", To URI: "sip:alice@ericsson.com", From Name "Alice" From URI": sip:alice@ericsson.com

Headers
user-agent = SDS test-Agent

"Message created"
REGISTER sip:ericsson.com SIP/2.0
Max-Forwards: 70
CSeq: 1 REGISTER
Content-Length: 0
Contact:
User-Agent: SDS Test-Agent
From: "Alice";tag=1558
To: "Alice"
Call-ID: [!!!generated by the tool !!!]
Via: SIP/2.0/UDP 138.85.197.100:6060;branch=z9hG4bKc085250bd23e233208b3fd568ce54b18


step 2: Bob registers itself
same as step 1, except for the user name

REGISTER sip:ericsson.com SIP/2.0
Max-Forwards: 70
CSeq: 1 REGISTER
Content-Length: 0
Contact:
User-Agent: SDS Test-Agent
From: "Bob" ;tag=7751
To: "Bob"
Call-ID: [!!!generated by the tool !!!]
Via: SIP/2.0/UDP 138.85.197.100:6061;branch=z9hG4bKa35ec1b761b9963ec8991d81e8e64dd4


Step 3: Alice subscribe to Bob's presence status
On "Alice" test agent

pick Method="subscribe". And do the following twist to the default values:
URI: "sip:bob@ericsson.com"

To Name "Bob"
To URI "sip:bob@ericsson.com"
From Name "Alice"
From URI "sip:alice@ericsson.com"
Add "Event" header. value="presence"

Example Message will be:
SUBSCRIBE sip:bob@ericsson.com SIP/2.0
Max-Forwards: 70
Event: presence
CSeq: 1 SUBSCRIBE
Content-Length: 0
Contact:
User-Agent: SDS Test-Agent
From: "Alice";tag=7739
To: "Bob"
Route: ,
Call-ID: [!!!generated by the test client!!!!]
Via: SIP/2.0/UDP 138.85.250.52:6060;branch=z9hG4bK72641769945c0c12c064e43aca221d4c


After "send message", the "200 OK" button on the right side will be available. Click it quickly, otherwise, the "subscribe" request may timeout.


step 4: Bob publishes it's presence status
On "Bob" test agent. Create a "PUBLISH" message.

URI: sip:ericsson.com
TO Name: Bob
To URI: sip:bob@ericsson.com

From Name: Bob
From URI: sip:bob@ericsson.com

Add "event" header, value="presence"

Message Content = "Home" // or "office, I'm available..."

Example message will be:
PUBLISH sip:ericsson.com SIP/2.0
Max-Forwards: 70
Event: presence
CSeq: 1 PUBLISH
Content-Length: 4
Contact:
User-Agent: SDS Test-Agent
Route: ,
From: "Bob";tag=544
To: "Bob"
Call-ID: [!!!generated by the test client!!!!]
Content-Type: text/plain
Via: SIP/2.0/UDP 138.85.250.52:6061;branch=z9hG4bK7c3cefb34cb5220df70bac24778f1f4f

home


step 5: Alice gets notified about Bob's presence status change

Now, on "Alice" test agent, it will receive the notification. Click "200 OK" to accept it.


Attached pictures:

Screenshots
default HSS-User profile



default DNS setting



Tuesday, May 11, 2010

Install Ericsson Service Development Studio (SDS)


Download and follow instruction from http://www.ericsson.com/developer/sub/open/technologies/ims_poc/tools/sds_40

This note added the following content to the standard installation instruction:
- added some environment settings to avoid errors during the installation
- recommend the best installation option
- added verification process
- Added trouble shooting to solve the frequent issues may happen during the installation

Pre-installation preparation
Some component installation (sailfin part) requires a "JAVA_HOME". Under Windows, open a cmd window and use "echo %JAVA_HOME%" to check the setting. If it does not exist, add "JAVA_HOME" (I'm using JDK 1.6 on my laptop)


Recommended Installation Option

1) Don't use the Eclipse + Pulsar way of installation. It does not allow you to select all components at one time and it's error prone

2) Use the Eclipse J2EE one:
http://www.eclipse.org/downloads/

1. Download and install Eclipse JEE Edition (Galileo or Ganymede).

2. Ensure that the proxy settings are correct in Eclipse preferences.
It's under menu: window -> preference -> General -> Network Connections...

3. Select Software updates under the Help menu.
4. Add the following URL: http://www.ericsson.com/developer/sds/pulsar.
- De-select "Show only the latest version...."
- De-select "Group items by category"






















5. Install specific components by selecting them and clicking ‘Install’.
6. Complete installation by restarting Eclipse.


Installation Verification

  • Open the Eclipse Environment
- go to the installation folder (e.g. C:/lab/sds/eclipse) and double click eclipse.exe

  • Start the sailfin server
- In the Eclipse, switch to the "Java EE perspective"
- And you will see the "Servers" window below. If not, try to open it from Menu->Window->Show View-> Servers
- you will see "Sailfin v1 at localhost[stoped]". Right click on it and choose "start".
- If server starts properly, you will see the server status will change to [started, synchronized]. Check "console" view for more info.

  • Start the DNS Server
There will be a "SDS" menu in the Eclipse menu:

Menu -> SDS - > Server -> DNS -> start DNS

see "console" for info

  • Start the CSCF Server
Menu -> SDS - > Server -> CSCF -> start CSCF

  • Start the PoC Server
Menu -> SDS - > Server -> PoC Server -> start Poc

// I have some issue of this...but I don't need PoC server for now.


--Congratulations! the SDS has been correctly installed.


Troubleshooting

1. Sailfin could not start. go to the [install folder]\Ericsson SDS\Sailfin\bin
you should see asadmin.bat and many other files. If there are no such files, the sailfine is not properly installed due to the "JAVA_HOME" issue.
- reset JAVA_HOME
- under sailfin folder, explicitly execute this command "lib\ant\bin\ant -f setup.xml"
- Then try to start the sailfin server again.

Sunday, May 2, 2010

setup a 3-server MPI cluster environment

Environment Description

Hardware/OS: 3 servers running Linux (server 0, 1, 2)

MPI Software: Intel MPI 4.0 for Linux (Redhat 5.0)

download trial version from Intel web site. Try this link (no registration, my link): http://registrationcenter-download.intel.com/akdlm/irc_nas/1718/l_mpi_p_4.0.0.025.tgz. If the link does not work, please download it from here (requires registration)

Example: Matrix Multiplier



Key reference doc
Intel MPI 4.0 Documentation (get started, reference manual)


Installation

1) Prepare servers

The hostname of my 3 servers are:
ericsoa1
ericsoa2
ericsoa3

From each server, user can ssh to the other 2 server (by using host name, Not IP address) via SSH and NO PASSWORD required.
If not, please follow this instruction


2) Installation Intel MPI SDK [Note: ONLY NEED TO DO THE FOLLOWING ON SERVER 0/zero, it will install SW on all other servers]
  • Follow the installation instruction [1] above. DO Step 1, 2, 3
  • Step 4 of installation instruction [1]: install the Intel MPI Library on all nodes of your cluster, ASSUMING NO shared file system, create a machines.LINUX file, with the following content:
ericsoa1
ericsoa2
ericsoa3
  • SKIP Step 5 of of installation instruction [1]
  • Step 6 of [1]
  • Step 7 of [1]. // use default choice
  • steep 8 of [1]. choose 2 // Install cluster node software on every node of your cluster
  • It will ask for "machine.LINUX". Press enter directly since there is one under the current directory
  • review and accept the agreement
  • accept default in the following part
When you finishes the installation, you will see the following result: "Completed cluster installation successfully."



3) prepare mpd.hosts file
create mpd.hosts under directory $PWD (user's home directory. For root user, $PWD is /root)
Include the following content in the file:
ericsoa1
ericsoa2
ericsoa3

4) setup MPI runtime environment (paths, etc)

cd /opt/intel/impi/4.0.0.025/bin
. mpivars.sh //// note the . in the beginning
export CC=gcc


4) start the mpd process
goto $PWD , for root user: cd /root
mpdboot -n 3 -r ssh

use mpdtrace to verify the result. It should shows all the server nodes.


Compile and Run the application

DO BELOW from Serevr 0/zero ONLY

1) Setup project folder in Server 0/zero
mkdir /opt/tp/project

extract example files (*.c, *.h) into this project

cd /opt/tp/project/

mpicc -o tp_10_5_5 *.c // note, tp_10_5_5 is the name of the output file. it means A (1000*500) * B (500*500)

use "ls" to check the file has been generated)


2) Do the following from Server 0/zero:

Create project folder (e.g. /opt/tp/project) in all servers.
ssh ericsoa2 mkdir -p /opt/tp/project
ssh ericsoa3 mkdir -p /opt/tp/project

3) copy the generated executable files to all other servers:
scp /opt/tp/project/tp* root@ericsoa2:/opt/tp/project
scp /opt/tp/project/tp* root@ericsoa3:/opt/tp/project


4) Run the example application from server 0/zero
run the following from the project folder:
mpiexec -n 3 ./tp_10_5_5

and you should see the result.


Good luck!

Linux (redhat) configuration

SSH Login without password


First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

a@A:~> ssh-keygen -t rsa 
Generating public/private rsa key pair. Enter file in which to save the key (/home/a/.ssh/id_rsa):  Created directory '/home/a/.ssh'. Enter passphrase (empty for no passphrase):  Enter same passphrase again:  Your identification has been saved in /home/a/.ssh/id_rsa. Your public key has been saved in /home/a/.ssh/id_rsa.pub. The key fingerprint is: 3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A 

Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):

a@A:~> ssh b@B mkdir -p .ssh 
b@B's password:  

Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:

a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys' 
b@B's password:  

From now on you can log into B as b from A as a without password:

a@A:~> ssh b@B hostname B 

A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:

  • Put the public key in .ssh/authorized_keys2
  • Change the permissions of .ssh to 700
  • Change the permissions of .ssh/authorized_keys2 to 640

Chang host name

  1. Change the hostname on a running system

hostname NEW_NAME
will set the hostname of the system to NEW_NAME. This is active right away and will remain like that until the system will be rebooted

  • Permanent hostname change

RedHat based system use the file /etc/sysconfig/network to read the saved hostname at system boot. This is set using the init script /etc/rc.d/rc.sysinit
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME="plain.domainname.com"
GATEWAY="192.168.0.1"
GATEWAYDEV="eth0"
FORWARD_IPV4="yes"

Also need to change the /etc/hosts if the host name is there.

Archive tool example command

tar -xvzf apache-ant-1.7.1-bin.tar.gz -C /opt/sce

//unzip file to a specific folder, note: gunzip does not support this.
unzip package.zip -d /opt


rpm example command:

rpm -ivh downloads/oracle-xe-univ-10.2.0.1-1.0.i386.rpm