JAIN-SIP: Architecture, Implementation, Testing



Similar documents
JAIN SIP: A SIP For the People! Architecture, Implementation, Programming

JAIN SIP Tutorial Serving the Developer Community

Interfacing Java to SIP The story of the JAIN SIP API. Brian O Neill Technical Architect, Gestalt LLC bone@alumni.brown.edu mobile:

Implementing Multimedia Sessions. using SIP Architecture

Introduction to Oracle WebLogic. Presented by: Fatna Belqasmi, PhD, Researcher at Ericsson

JSLEE and SIP-Servlets Interoperability with Mobicents Communication Platform

AN IPTEL ARCHITECTURE BASED ON THE SIP PROTOCOL

MjSip-Mini-Tutorial. MjSip version: 1.5. Author: Luca Veltri Date: 24/4/2005 Document version: 0.1

Request for Comments: August 2006

Res iprocate S IP S tack

SIP: Ringing Timer Support for INVITE Client Transaction

Part II. Prof. Ai-Chun Pang Graduate Institute of Networking and Multimedia, Dept. of Comp. Sci. and Info. Engr., National Taiwan University

This presentation discusses the new support for the session initiation protocol in WebSphere Application Server V6.1.

IP-Telephony SIP & MEGACO

Università degli Studi di Napoli Federico II. Corsi di Laurea Specialistica in Ingegneria Informatica ed Ingegneria delle Telecomunicazioni

NAT TCP SIP ALG Support

Conferencing Using the IP Multimedia (IM) Core Network (CN) Subsystem

Session Initiation Protocol (SIP) The Emerging System in IP Telephony

Oracle Communications WebRTC Session Controller: Basic Admin. Student Guide

EE4607 Session Initiation Protocol

SIP: Protocol Overview

Developing and Integrating Java Based SIP Client at Srce

Session Initiation Protocol

SIP Protocol as a Communication Bus to Control Embedded Devices

Media Gateway Controller RTP

Developing SIP services

Linkbit IMS Master Advanced IMS simulation tool

Project SailFin: Building and Hosting Your Own Communication Server.

SIP: Ringing Timer Support for INVITE Client Transaction

SIP Introduction. Jan Janak

A standards-based approach to application integration

IxLoad: Advanced VoIP

TB640 SIP User's Guide

Session Initiation Protocol and Services

JSR 289: SIP Servlet 1.1 Provides Significant Benefits for SIP Application Developers

Implementing SIP and H.323 Signalling as Web Services

1 An application in BPC: a Web-Server

ETSI TS V6.8.0 ( ) Technical Specification

DESIGN AND IMPLEMENTATION OF SIP VOIP ADAPTER. Thesis Director: Dr. Laurent Gerorge

Personal Voice Call Assistant: VoiceXML and SIP in a Distributed Environment

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP LTM for SIP Traffic Management

SIP Essentials Training

Session Initiation Protocol (SIP) 陳 懷 恩 博 士 助 理 教 授 兼 計 算 機 中 心 資 訊 網 路 組 組 長 國 立 宜 蘭 大 學 資 工 系 TEL: # 340

SIP Messages. 180 Ringing The UA receiving the INVITE is trying to alert the user. This response MAY be used to initiate local ringback.

Firewall Support for SIP

SIP A Technology Deep Dive

SOA REFERENCE ARCHITECTURE: WEB TIER

SERVICE DISCOVERY AND MOBILITY MANAGEMENT

How To Write A Composition Engine In A Microsoft Ip System

Chapter 2 PSTN and VoIP Services Context

SIP : Session Initiation Protocol

: Test 217, WebSphere Commerce V6.0. Application Development

SHORT DESCRIPTION OF THE PROJECT...3 INTRODUCTION...4 MOTIVATION...4 Session Initiation Protocol (SIP)...5 Java Media Framework (JMF)...

Application notes for SIPERA UC-Sec 4.0 Remote User Enablement Solution with Avaya Multimedia Communication System 5100 release 4.0 Issue 1.

ExtraHop and AppDynamics Deployment Guide

Multimedia Conferencing with SIP

Alcatel OmniPCX Enterprise R11 Supported SIP RFCs

Integrating Avaya Aura Presence Services with Microsoft OCS

Multidomain Virtual Security Negotiation over the Session Initiation Protocol (SIP)

VoIP Application Development using SIP protocol

Session Initiation Protocol (SIP) Chapter 5

Application Notes for BT Wholesale/HIPCOM SIP Trunk Service and Avaya IP Office 8.0 Issue 1.0

Adding Multi-Homing and Dual-Stack Support to the Session Initiation Protocol

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

VoiceXML and VoIP. Architectural Elements of Next-Generation Telephone Services. RJ Auburn

Programming SIP Services University Infoline Service

Avaya Aura SIP Trunking Training

How to Build an E-Commerce Application using J2EE. Carol McDonald Code Camp Engineer

Telecommunication Services Engineering (TSE) Lab. Chapter V. SIP Technology For Value Added Services (VAS) in NGNs

Instrumentation for Linux Event Log Analysis

ΕΠΛ 674: Εργαστήριο 5 Firewalls

NetBeans IDE Field Guide

MD Link Integration MDI Solutions Limited

INTRODUCTION TO FIREWALL SECURITY

Design Document. Offline Charging Server (Offline CS ) Version i -

Technical Manual 3CX Phone System for Windows

Network Security. Chapter 3. Cornelius Diekmann. Version: October 21, Lehrstuhl für Netzarchitekturen und Netzdienste Institut für Informatik

Combining VoiceXML with CCXML

Automatic Configuration and Service Discovery for Networked Smart Devices

Grandstream Networks, Inc. GXP2130/2140/2160 Auto-configuration Plug and Play

Learning GlassFish for Tomcat Users

A Unified Messaging-Based Architectural Pattern for Building Scalable Enterprise Service Bus

Methods and tools for data and software integration Enterprise Service Bus

For internal circulation of BSNL only

SIP Server Requirements

Installation & Configuration Guide Version 1.0. TekSIP Route Server Version Installation & Configuration Guide

Interoperability Test Plan for International Voice services (Release 6) May 2014

Oracle9i Application Server: Options for Running Active Server Pages. An Oracle White Paper July 2001

An introduction to creating JSF applications in Rational Application Developer Version 8.0

Computer Networks Practicum 2015

Oracle Service Bus. Situation. Oracle Service Bus Primer. Product History and Evolution. Positioning. Usage Scenario

FioranoMQ 9. High Availability Guide

Session Initiation Protocol (SIP)

Transcription:

JAIN-SIP: Architecture, Implementation, Testing M. Ranganathan mranga@nist.gov Advanced Networking Technologies Division http://w3.antd.nist.gov National Institute of Standards and Techology http://www.nist.gov Gaithersrburg, MD 20899.

Speaker Introduction Speaker affiliation: NIST: National Institute of Standards and Technology. ANTD: Advanced Networking Technologies Division. Not a member of JAIN-SIP expert group. Our interests are: Applied Networking Research, Standards, Testing Architect and main developer of NIST-SIP: public domain JAIN-SIP Java SIP Stack.

Talk Outline Brief overview The function of JAIN SIP (why use it) JAIN architecture preliminaries JAIN-SIP abstractions and what they do Services provided by the JAIN stack Application responsibilities A skeleton application

Talk Outline (Contd.) Parsing SIP headers Wrapping a JAIN implementation around a SIP stack Testing the implementation The TCK Other useful test tools Loose ends and ideas for future spec

JAIN Architecture JAIN Provides an event-layer abstraction for applications. JAIN Events Application JAIN Layer Proprietary Primitives Protocol Stack

Overview: JAIN-SIP JAVA-Standard interface to a SIP Signaling Stack. Spec Lead: Chris Harris, DynamicSoft charris@dynamicsoft.com Wraps the low-level stack and protocol abstractions in a JAVA interface layer Allows a JAVA application/servlet or bean to imbed a SIP stack and access low level functions

Overview: JAIN SIP (Contd.) Simplifies the construction of SIP components: User Agents, Proxy Servers, Presence Servers. JAIN SIP can be utilized in a User Agent or Proxy Holy Grail: Application portability between JAIN SIP stacks via definition of interfaces and run-time behavior. Ensure interoperability via the TCK.

Application Portability How does JAIN-SIP aim to achieve application portability between JAIN-SIP compliant stacks? Standardize the interface to the stack. Standardize the events and event semantics. Standardize transactional semantics.

JAIN-SIP Architecture Listeners Listeners SIP Messages Events SIP Messages Events Provider Provider Stack Network Stack

Responsibilities the Application Application MUST go through the provider for all interactions with the stack (no direct access to the wire protocols). Application registers an implementation of the SipListener interface with the stack.

Responsibilities the Application (Cont.) Application sees all signaling traffic and is responsible for sending responses via the SipProvider. Application is responsible for retransmission processing on timeout for stateless implementation.

Responsibilities of the Stack Provide methods to format and send SIP messages Parse incoming sip messages and allow application to access / modify fields through a standardized JAVA interfaces Invoke appropriate application handlers when protocol significant events occur Provide transaction support Manage transactions on behalf of a user application

JAIN-SIP Packages jain.protocol.ip.sip Stack, provider and other packages. jain.protocol.ip.sip.header: Header factories, interfaces for each supported header. jain.protocol.ip.sip.message Message factories : Create messages for sending out. jain.protocol.ip.sip.address Address factories: Parse and create URL and address objects.

JAIN-SIP Abstractions jain.protocol.ip.sip.sipfactory: Creates the main Stack object. jain.protocol.ip.sip.sipstack Event generator: Fields incoming messages and generates events. Transaction handler: Manages transactions and generates transaction timeout events. Transaction objects are not directly accessible by the application.

JAIN-SIP Abstractions (Contd.) jain.protocol.ip.sip.listeningpoint: Corresponds to a Stack Address (UDP/TCP) IP address and port from which the stack can receive and send messages. The stack is configured with one or more listening points. jain.protocol.ip.sip.provider Provides helper facilities for the application program (sendrequest, sendresponse, sendack )

The SipListener Interface JAIN-SIP Application programs must implement the jain.protocol.ip.sip.siplistener interface public interface SipListener extends java.util.eventlistener { public void processresponse(sipevent responsereceivedevent); public void processrequest(sipevent requestreceivedevent); public void processtimeout(sipevent transactiontimeoutevent); }

JAIN-SIP Application Skeleton Create a SipFactory object instance sipfactory = SipFactory.getInstance(); sipfactory.setpathname("gov.nist"); Create a SIP Stack instance try { sipstack = sipfactory.createsipstack(); } catch(sippeerunavailableexception e) { System.exit(-1); } catch(sipexception e) { System.exit(-1); }

JAIN-SIP Application Skeleton (Contd.) Create factories to format headers and send messages HeaderFactory headerfactory = sipfactory.createheaderfactory(); AddressFactory addressfactory = sipfactory.createaddressfactory(); MessageFactory messagefactory = sipfactory.createmessagefactory(); format and send off invite message using sendmessage

JAIN-SIP Application Skeleton (Contd.) Handle incoming messages (delivered as events): public void processrequest(sipevent requestreceivedevent) { Request request = (Request)requestReceivedEvent.getMessage(); long servertransactionid = requestreceivedevent.gettransactionid(); try { if (request.getmethod().equals(request.invite)) processinvite(request,servertransactionid); else if (request.getmethod().equals(request.ack)).. } catch (SipParseException ex) { ex.printstacktrace(); } }

JAIN-SIP Application Skeleton (Contd.) Handle Timeout Events public void processtimeout(jain.protocol.ip.sip.sipevent transactiontimeoutevent) { try { if(transactiontimeoutevent.isclienttransaction()) { get the request for this transaction sipprovider.sendrequest(request); } } catch (Exception ex) { ex.printstacktrace(); } }

JAIN Implementation Wrappers JAIN API are defined as interfaces. Interface implementation is JAVA Protocol object can be JAVA/Native JAIN Object JAIN methods Native Protocol Object

Building a SIP Stack Parsing incoming messages. Rewriting/responding to messages: Generating outgoing messages from incoming messages. Routing outgoing messages: Sending them off to the right next hop. Transaction handling: Matching requests to responses.

Parsing SIP Headers The SIP grammar is specified in ABNF form. Grammar is compositional (includes grammar of other RFCs). Introduces some syntactic ambiguities. SIP headers can be parsed using a hand crafted parser or by inputting the grammar to a parser generator.

Parsing SIP Headers (Cont.) Parser generators are good for clearly identifying and dealing with syntactic ambiguities. Parser generators can generate slow and huge parsers. Lots of code means slow class loading. May not be good for production SIP stacks.

Parsing SIP Headers (Cont.) RFC grammar makes it difficult to directly use parser generator tools directly. Must be able to directly handle ABNF. Must be able to cleanly deal with ambiguities. A few tools like antlr are suitable: Allows closure operations on non-terminals. Syntactic and semantic predicates allow systematic dealing with syntactic ambiguities. Grammar composition features.

Eager and Lazy Parsing JAIN-SIP allows for either eager or lazy parsing. Eager parsing the entire message is parsed as soon as it is received. Lazy parsing the headers are parsed as needed by the application. Can provide performance advantages. When the message is received, text is stored but not parsed. Portions of the message parsed when needed.

Rewriting/Responding to Messages Follow RFC 2543 Rules in generating Responses to requests. These rules are implicit in the JAIN-SIP Spec/implementation.

Parsing: Error Reporting Errors are reported up to the application using SipParseException. Thrown on both set and get methods. Allows for lazy or eager parsing. SipParseException is supposed to capture the portion of the header that lead to the error.

Lazy Parsing public interface HeaderIterator { public boolean hasnext(); public Header next() throws HeaderParseException, NoSuchElementException; }

Transactions SIP transaction consists of a single request and any responses to that request, which include zero or more provisional responses and one or more final responses (from RFC 2543). The SIP protocol provides enough state in the SIP message to extract a transaction identifier.

Client and Server Transactions Server transaction Client transaction Server transaction Client transaction UAS UAC Statefull proxy

Transactions in JAIN-SIP JAIN-SIP identifies transactions by a long integer. Transactions are associated with all sipprovier.sendxxx methods. SipListener.processRequest(SipEvent) SipListener.processResponse(SipEvent) SipListener.processTimeout(SipEvent) The transaction identifier is retrieved from the SipEvent for the Timeout Event.

INVITE Transaction (RFC 2543) 300 699 ACK sent Invite Sent Timer A 1xx to TU 300-699 ACK sent Calling Proceeding Completed Invite from TU 2xx to TU 2xx to TU 300-699 ACK Sent Timer D fires Transport Err Timer B fires OR Transport Err Terminated

Transaction Timeouts Stateless implementation: The stack generates periodic timeout notifications for outstanding transactions. The application keeps track of the retransmission state machine. Timeouts are delivered to the application in an exponentially decaying fashion.

Transaction Timeouts (Contd.) Statefull implementation: The stack handles retransmissions. Timeout when the transaction does not complete as expected (longest arc in the previous diagram).

Statefull Vs. Stateless JAIN-SIP does not specify whether the implementation should be statefull or stateless. Controversy in mailing list discussions.

Statefull Vs. Stateless (Contd.) Statefull implementation: Makes it easier to implement user agents/b2bua/statefull proxy. Not suited for stateless proxy servers. Stateless implementation: Thinner implementation. Allows implementation of stateless proxy servers but puts more burden on implementation of user agents.

Dealing with Extensibility SIP extensibility: can add new request methods and new headers. JAIN-SIP provides support for all the headers in RFC2543. Headers can be created/accessed by name. Messages can be created with any method name (implementation can reject it and throw a SipParseException if needed).

The TCK A test suite that is supposed to ensure interoperability between JAIN implementations. Ideally if two implementations pass the TCK then they are plug replace-able.

JAIN-SIP TCK The TCK is a unit test. Can test all the set/get methods, stack creation, message send/receive and some transaction processing. Does not test timeouts and detailed transactional semantics. Lots of good protocol test tools available to test your application/implementation. NIST responder tool: allows you to test against a call flow.

Protocol Test Tool Flexible framework for.. Call Flow Generation Test Scripts, Error Scenarios Scripting Technology XML+NIST- SIP+JAVA/JYTHON XML State machine templates Event triggers, responses specified in XML+JAVA or XML + JYTHON NIST-SIP event engine drives script and implements responses. <!-- Expect an ACK and send a BYE 40 seconds after the ACK. Note that this includes some imbedded code that triggers when the ACK arrives. When the transaction complets the oncompletion attribute specifies the code fragment that runs --> <EXPECT nodeid = "node6" enablingevent = "INVITEReceivedOKSent" triggermessage = "ACK" generatedevent = "ACKReceived" executeontrigger = "onackreceived" executeoncompletion = "ontransactioncomplete" > <GENERATE delay = "100" retransmit = "true" > <SIP_REQUEST> <REQUEST_LINE method = "BYE" /> </SIP_REQUEST>

NIST-SIP Protocol Test Tool JAIN App Message Trace Test Proxy Responder XML Event Script Trace Viewer Responder XML Event Script

Responder XML Specification for Call Flow State Machine Event Engine Pattern Matcher SIP Stack

Visualizing Multiparty Traces Java Applet collects and visualizes distributed call flow trace files. Augmented with XML script state information. Enables debugging call flows & test scripts.

consults XML XML file file describing describing the the available available tests tests RMI Registry Gets Trace Controller launches User Agent Servlet launches notifies consults Logs http://is2.antd.nist.gov:8080/nistwebtester/setup messages Proxy Servlet Servlet Servlet Server Side Client Side Address: Port: Protocol: Test 1 Test 2 Test 3 IP address Port Trace Applet User Agent Test 4 GO GO GO

Selected Design Issues Issues from discussion list (gathered by Phelim O Doherty, sun Microsystems). Introduce management capabilities for ListeningPoints Including proxies capabilities explicitly in the API : Make the transaction model configurable?

Selected Design Issues (Contd.) sendbye should take a Request or a Response as argument as it does not rely on a previous transaction. sendack should not generate a new transaction.

Loose Ends: Dialogs and Tags Dialog: A peer-to-peer relationship between communicating SIP entities. Dialog is identified by to tag, from tag and call id. JAIN SIP does not deal directly with dialog objects. Need to deal with legacy issues (JAIN-SIP is based on RFC 2543 (no bis)). Semantic changes since the first spec release

Loose Ends: Statefulness Statefull versus stateless implementation? Application portability problem (a portable application has to be written assuming the least common denominator -- needless complexity). What is the correct spec interpretation? Better way to define the spec?

Loose Ends: Stack Configuration JAIN does not address stack configuration. Configuration parameters include such things as: IP address/port on which the listener will be configured. What transport types the listener will support. Proxy address. Transaction model (?).

Consistent Spec Definition ( Some Ideas -- comments solicited) JAIN SIP SIP Servlets JAIN Sip Lite XML Tags (State machine spec) SIP Stack

Related Specifications JSR-164 JAIN-SIMPLE: a set of extensions made to the SIP protocol to support presence and instant messaging. JSR-125 JAIN-SIP-Lite: is aimed User Agent application development. Hides the gory details of the SIP protocol and provides a high level abstraction for developers of User Agent (UAC/UAS) software. JSR-141 SDP API: Builds a wrapper around a SDP interface

Related Specifications JSR 21 JAIN Call Control API: Protocol Independent Call Control. Note that JAIN-SIP-LITE is UA only and protocol aware. JSR-116 SIP Servlets: HTTP Servlet like interface for SIP. Primarily for use on proxy servers.

Useful URLs JAIN SIP Specification: http://jcp.org/jsr/detail/032.jsp JAIN-SIP Disucssion List: mailto:jain-sip-interest@java.sun.com NIST IP-Telephony Project page (NIST-SIP): http://is2.antd.nist.gov/proj/iptel Web-based protocol tester (in development): http://is2.antd.nist.gov:8080/webtester/setup.html

Acknowledgement Chris Harris (DynamicSoft) and the JAIN- SIP expert group. JAIN-SIP interest mailing list. SIP-IMPLEMENTORS mailing list. Numerous contributors to the NIST-SIP project from the user community. NIST guest researchers: Olivier Deruelle, Christophe Chazeau, Marc Bednarek.