ITS LAB Introduction

advertisement
ITS LAB Introduction
2008 Mobile All-IP Networking Laboratory
National Chung Cheng University
Dept. Computer Science & Information Engineering
National Chung Cheng University
Dept. Computer Science & Information Engineering
Outline
Goal
Scenario
LAB 1
– Install Open IMS Core
LAB 2
– Install OSGi Service Platform
LAB 3
– Implementation
2
National Chung Cheng University
Dept. Computer Science & Information Engineering
Goal
Construct a environment with Open IMS
Core and OSGi Service Platform, and
simulate a client access service through
OSGi gateway to IMS network.
Implement an Application Server(AS) in
a IMS network.
Also, a UPnP device software needs to
be developed.
3
National Chung Cheng University
Dept. Computer Science & Information Engineering
Scenario
Implement elements:
– Application Server(AS)
– UPnP device
IMS
network
UPnP
devices
OSGi
gateway
4
Internet
National Chung Cheng University
Dept. Computer Science & Information Engineering
LAB 1
Install Open IMS core
–
–
–
–
What is Open IMS Core?
Requirements
How to install
Test your Open IMS Core
5
National Chung Cheng University
Dept. Computer Science & Information Engineering
What is Open IMS core?
 The Open IMS Core is an implementation of
IMS Call Session Control Functions (CSCFs)
and a lightweight Home Subscriber Server
(HSS).
6
National Chung Cheng University
Dept. Computer Science & Information Engineering
What is Open IMS core?(cont.)
P-CSCF
I-CSCF
S-CSCF
HSS
Client
AS
7
National Chung Cheng University
Dept. Computer Science & Information Engineering
Requirements
Hardware
– A current Linux desktop class machine
should be enough
– If you want to get ultimate performance:
• Add several Gigabytes of RAM
• Have as many CPUs/Cores as
• Gigabit Ethernet would help
8
National Chung Cheng University
Dept. Computer Science & Information Engineering
Requirements(cont.)
Network access
– Inter-domain NAT is not something we are
interested in, so a public IP address would
be great
– Controllable DNS server if you don't want
to have one on your Linux box
9
National Chung Cheng University
Dept. Computer Science & Information Engineering
Requirements(cont.)
Software
– ~100 MBytes of disk space to be on the
safe side
– GCC3/4, make, JDK1.5, ant
– MySQL installed and started (or other
DBMS if you can deal with it)
– bison, flex
– libxml2 (> 2.6), libmysql - both with
development
10
National Chung Cheng University
Dept. Computer Science & Information Engineering
Requirements(cont.)
Software
– Linux kernel 2.6 and ipsec-tools (setkey) if
you want to use IPSec security
– Optional: openssl if you would like to
enable the TLS security
– bind installed and running (or other name
server if you can deal with it)
– Browser on the box or that can connect to
the box (for user provisioning)
11
National Chung Cheng University
Dept. Computer Science & Information Engineering
Requirements(cont.)
Install Tips: Ubuntu Linux as example
– First, install these software first in the
terminal, type sudo apt-get install
subversion
ant
sun-java6-jdk
bison
flex
mysql-server
libmysqlclient15-dev
libxml2
libxml2-dev
bind9
12
National Chung Cheng University
Dept. Computer Science & Information Engineering
Requirements(cont.)
Install Tips: Set up JAVA HOME
environment.
– After install Java(JRE & JDK), modify the file:
profile
• vim /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-1.X.X-sun
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
13
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install
Step 1: Get the Source Code
– Start the Linux terminal
– Create /opt/OpenIMSCore and go there
mkdir /opt/OpenIMSCore
cd /opt/OpenIMSCore
– Create a new directory ser_ims and
checkout the CSCFs there
mkdir ser_ims
svn checkout
http://svn.berlios.de/svnroot/repos/openimsco
re/ser_ims/trunk ser_ims
14
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
– Create a new directory FHoSS and checkout
the HSS there
mkdir FHoSS
svn checkout
http://svn.berlios.de/svnroot/repos/openimsco
re/FHoSS/trunk FHoSS
15
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
Step 2: Compile
– ser_ims
– Do "make install-libs all" in ser_ims
cd ser_ims
make install-libs all
cd ..
– If something breaks, you probably don't
have all the prerequisites.
16
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
– FHoSS
– If you don't have a JDK >=1.5, get one
before proceeding
# java -version
– Do "ant compile deploy" in FHoSS
cd FHoSS
ant compile
ant deploy
cd ..
17
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
Step 3: Configure the Environment
– Notes
• All the installation examples configured to work
only on the local loopback and the default
domain configured as "open-ims.test".
• Replace 127.0.0.1 where required with your IP
address.
18
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
– DNS
• A sample DNS zone file can be found in
ser_ims/cfg/open-ims.dnszone
• Copy it to your bind configuration
directory(/etc/bind9)
• Edit named.conf and insert the file there .
19
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
• Restart the name server
• Test that the names are resolvable (don't forget
about /etc/resolv.conf pointing to your new
DNS server!)
• Example: ping open-ims.test
20
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
– MySQL
• Type the MySQL comands:
mysql -u root -p -h localhost <
ser_ims/cfg/icscf.sql
mysql -u root -p -h localhost <
FHoSS/scripts/hss_db.sql
mysql -u root -p -h localhost <
FHoSS/scripts/userdata.sql
21
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
Step 4: Configure the IMS Core
– By now you should have MySQL and DNS
working
– Copy the following files to
/opt/OpenIMSCore:
pcscf.cfg, pcscf.sh, icscf.cfg, icscf.xml,
icscf.sh, scscf.cfg, scscf.xml, scscf.sh
– Take a look at the configuration files in
FHoSS/deploy/
22
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
Step 5: Start the components
– CSCFs
• Start pcscf.sh, icscf.sh and scscf.sh
– FHoSS
• Start FHoSS/deploy/startup.sh
• Check the web interface on
http://localhost:8080/
• Username: hssAdmin
• password: hss
23
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
Step 6: Configure Subscribers
– By default, FHoSS comes provisioned with a
couple of sample users:
• alice@open-ims.test
• bob@open-ims.test
24
National Chung Cheng University
Dept. Computer Science & Information Engineering
How to install(cont.)
Step 7: Test!
– Use Wireshark to see what's going on:
• Monitor ports 4060, 5060 and 6060 for SIP
traffic
• Monitor ports 3868, 3869 and 3870 for
Diameter traffic
For detail guide, please refer to:
– http://www.openimscore.org/installation_g
uide
25
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core
 Ubuntu Linux as example:
– Strat linux terminal
– Change the directory to /opt/OpenIMSCore/
– Type ./pcscf.sh to run P-CSCF.
26
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core(cont.)
– You can see the P-CSCF start running.
27
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core(cont.)
– Open another two Linux terminal.
– Type ./icscf.sh in one terminal and ./scscf.sh in
another terminal to run I-CSCF and S-CSCF.
– After above, you can see both are running.
28
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core(cont.)
– Again, open one Linux terminal.
– Type ./fhoss.sh to run HSS(FHoSS).
29
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core(cont.)
– You can see the HSS is running.
30
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core(cont.)
– Check the web interface on http://localhost:8080/
31
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core(cont.)
FOKUS OpenIC
– Client for IMS network.
– You can test your Open
IMS Core by setting up
the clients to make a
test call.
32
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core(cont.)
Run OpenIC
– Type ./OpenIC_Lite.sh in
terminal where your OpenIC
directory is.
– First time you run it, you will
see the Configuration Wizard.
– Take bob as example:
•
•
•
•
•
•
Display name: Bob
Public Identity: bob@open-ims.test
Private Identity: bob@open-ims.test
Secret Key: bob
Proxy Server: 127.0.0.1:4060
Realm: open-ims.test
33
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core(cont.)
– Start two clients at the same time, set one as Alice,
another one as Bob.
– Login them to the Open IMS core.
34
National Chung Cheng University
Dept. Computer Science & Information Engineering
Test your Open IMS core(cont.)
– Make a call from Alice to Bob.
– Call connected?
– If successful, two clients will be connected.
35
National Chung Cheng University
Dept. Computer Science & Information Engineering
LAB 2
Install OSGi Service Platform
– Reference the OSGi ppt.
36
National Chung Cheng University
Dept. Computer Science & Information Engineering
LAB 3
Implementation
– Application Server
• JAIN SIP
– UPnP device
37
National Chung Cheng University
Dept. Computer Science & Information Engineering
Introduction to JAIN SIP
The Java-standard interface to a SIP
signaling stack.
– Standardizes the interface to the stack.
– Standardizes message interface.
– Standardizes events and event semantics.
– Application portability - verified via the
TCK.
38
National Chung Cheng University
Dept. Computer Science & Information Engineering
Introduction to JAIN SIP(cont.)
Designed for developers who require
powerful access to the SIP protocol.
JAIN SIP can be utilized in a user agent,
proxy, registrar or imbedded into a
service container.
39
National Chung Cheng University
Dept. Computer Science & Information Engineering
JAIN SIP Functionality
JAIN SIP supports the SIP protocol
functionality described in RFC 3261.
JAIN SIP the following SIP extensions;
– RFC 2976 allows for the carrying of session
related control information that is
generated during a session.
– RFC 3262 provide information on progress
of the request processing.
– RFC 3265 the ability to request
asynchronous notification of events.
40
National Chung Cheng University
Dept. Computer Science & Information Engineering
JAIN SIP Functionality(cont.)
– RFC 3311 allows the caller or callee to
provide updated session information
before a final response.
– RFC 3326 the ability to know why a SIP
request was issued.
– RFC 3428 allows the transfer of Instant
Messages.
– RFC 3515 requests that the recipient refer
to a resource provided in the request.
41
National Chung Cheng University
Dept. Computer Science & Information Engineering
JAIN SIP Object Architecture
42
National Chung Cheng University
Dept. Computer Science & Information Engineering
JAIN SIP Messaging Architecture
43
National Chung Cheng University
Dept. Computer Science & Information Engineering
SipStack Interface
 Manages Listening Points and Providers.
 SipStack associated with an IP address.
– Can have multiple Listening points.
 Application can have multiple SipStacks.
 Cannot be deleted once created.
 Instantiated by the SipFactory and initialized with a
property set.
 "javax.sip.*” properties are reserved and names
defined for stack configuration properties.
 Defines retransmission settings.
 Defines router information.
44
National Chung Cheng University
Dept. Computer Science & Information Engineering
SipProvider Interface
 Register a SipListener to the SipProvider.
– Notifies registered Listener of Events
 De-register a SipListener from the SipProvider.
– Once de-registered, no longer receive Events from
SipProvider.
 Client and Server Transaction creation methods.
– For sending Request and Response messages statefully.
 CallIdHeader creation method.
 Send Requests and Responses statelessly.
 Listening Point manipulation methods.
– Only one provider per listening point.
45
National Chung Cheng University
Dept. Computer Science & Information Engineering
SipListener Interface
 A single SipListener per SipStack which
implies a single Listener in the architecture
– All SipProviders associated to a Sipstack have the
same SipListener.
 Process Request's either statefully or
statelessly dependent on application logic.
 Process Response's to a recently sent
Requests statefully.
 Process Transaction timeouts and retransmits
Timer events.
– Transaction processing46notifications
National Chung Cheng University
Dept. Computer Science & Information Engineering
Generic SIP Application Structure
47
National Chung Cheng University
Dept. Computer Science & Information Engineering
Code Overview
Import the SIP libraries.
The file name is the same with the main
class.
48
National Chung Cheng University
Dept. Computer Science & Information Engineering
SIP Stack Preparation
Init() – initiate SipStack and Factories
Initiate it in main section.
49
National Chung Cheng University
Dept. Computer Science & Information Engineering
Receiving a SIP Request
processRequest() - SIP stack will call it
automatically when receiving a request.
50
National Chung Cheng University
Dept. Computer Science & Information Engineering
Receiving a SIP Response(cont.)
processResponse() - which is called by
the SIP stack when a SIP response
message arrives
51
National Chung Cheng University
Dept. Computer Science & Information Engineering
Sending a SIP Request
 Procedure can roughly be split into four subsections:
–
–
–
–
1. Create main elements
2. Create message
3. Complete message
4. Send message
 The following main SIP elements are minimally needed to
construct a message:
–
–
–
–
–
–
–
Request URI
Method
Call-ID header
CSeq header
From header
An array of Via headers
Max-forwards header
52
National Chung Cheng University
Dept. Computer Science & Information Engineering
Sending a SIP Request
processINVITE()
processACK()
processBYE()
processCANCEL()
processOPTION()
processREGISTER()
…
53
National Chung Cheng University
Dept. Computer Science & Information Engineering
Dealing With Error Conditions
processTimeout()
– is called when the end point receiving the
message doesn't answer in time in time.
processIOException()
– is called when an I/O Exception happens
54
National Chung Cheng University
Dept. Computer Science & Information Engineering
References
 FOKUS Open IMS Core - http://www.openimscore.org/
 OpenIC - http://www.open-ims.org/openic/
 JAIN SIP - https://jain-sip.dev.java.net/
55
National Chung Cheng University
Dept. Computer Science & Information Engineering
Q&A

Any Questions?
56
Download