INTERNET TELEPHONY (ITX):

DIRECTORY SERVICE

 

 

 

 

A Design Project Report

Presented to the Engineering Division of the Graduate School

of Cornell University

in Partial Fulfillment of the Requirements for the Degree of

Master of Engineering (Electrical)

 

 

 

by

Char Shing Wilson Ng

Project Advisor: Srinivasan Keshav

Degree Date: August 1999

Abstract

Master of Electrical Engineering Program

Cornell University

Design Project Report

Project title: Internet Telephony (ITX): Directory Service

Author: Char Shing Wilson Ng

Abstract: This report presents the Directory Service, part of the ITX joint project, which aims to provide an IP-Telephony computing architecture to enable the use of Internet for telephony. The core ITX platform consists of four necessary components: Signaling, Data, Gateway, and Directory Service. These core components expose a set of Java APIs on which many different kinds of ITX telephony applications can be developed. Directory Service provides a "phone book" lookup service for all registered users in the ITX network. It dynamically keeps track of each user's currently reachable locations, as well as his/her preset and customized locations, so that he/she can be reached anywhere from the telephone network as well as the Internet. Moreover, it also keeps information about ITX application, such as the Gateway, so that applications can find each other. It is a distributed database system in which multiple client-server components interact and cooperate with each other to provide the illusion of a single centralized directory service. This report examines the requirements of the directory service, evaluates a range of approach and solution, details its design and implementation, and analyzes its performance.

 

 

Report Approval by

Project Advisor: __________________________________ Date: _________________

Executive Summary

Directory service is one of the core components in the ITX system to provide IP-Telephony computing architecture to enable communication capable devices talking with each other. It is designed and implemented as a distributed database system, in which client API components (encapsulated in ITX-compliant applications) interact and cooperate with the database server component in a coordinate fashion to provide the illusion of a single centralized directory service. The database server component is implemented through extending the BIND implementation, which is already a robust and mature architecture. The client API component is platform-independent to support application interoperability. The client communicator (responsible for communication with the database server) is designed in a flexible way, so that any database server solution can be plugged in and interfaced with the communicator, in order to adapt to any system environment constraints. The directory service achieves: 1) scalability provided by the BIND hierarchical approach; 2) fault tolerant provided by primary-secondary server setup and log-based persistence scheme; 3) data replication provided by zone transfer between primary and secondary; 4) failure detection provided by an efficient resolver mechanism; 5) security and authentication provided by the client API component and the BIND server. Overall, the directory service provides availability and reliability guarantees. The satisfactory performance result is achieved by choosing this implementation choice.

Table of Contents

Executive Summary *

Table of Contents *

Project Overview *

Design Problem *

Approach and solution *

Design and Implementation *

Database Schema *

Database Server *

Client API *

Client Communicator *

Results Analysis *

Appendix *

Description of database files used by Directory database server *

Installation instruction on BIND server *

Classes/Methods description - Directory Service Client API *

Project Overview

This joint project (ITX project) is to build a telephony network computing architecture layered over the telephone network and the Internet to enable communication capable devices of any kind (computers, telephones, handheld or mobile PCs, etc.) talking to each other. It allows voice data to be sent between one communication device (such as a telephone or a PC with speaker and microphone) and another communication device. The ITX platform handles all the complexity of the following operations:

In addition, the ITX platform exposes a set of powerful application programming interface (API) by which ITX-compliant IP-Telephony applications can be developed. Application programmers are freed from the above complexity and only need to worry about their business logic at the application layer.

The following four core components in the ITX system are necessary to enable Internet Telephony:

 

Design Problem

In this ITX project, my responsibility is to design and implement one of the ITX core components: the Directory Service. The directory service is logically running as a centralized entity, but is physically distributed. It is made up of multiple client-server components that interact and cooperate with each other to provide the illusion of a single centralized directory service.

Among all core components, directory service sits at the central piece of the whole project. It consists the centralized database server that stores information about users in the ITX network and provides information retrieval, updates as well as various lookups. Each ITX application contains a directory service client component to interact and exchange information with the database server in a coordinated fashion.

This client-server framework allows a user on his/her ITX application, containing the directory service client component, to transparently locate other users in the ITX network by communicating with the directory server. The directory service layer is completely hidden from the ITX application layer, so that only the signaling layer is responsible for interfacing with the directory service on behalf of the user application. Alternatively, ITX application layer can directly access the functionality of the directory service by getting its handle through the signaling component.

Users of the directory service fall into a wide range. For example, the signaling component that resides in each ITX application directly interfaces with the directory service client component. Specialized server applications such as the gateway server, voice/email server, conferencing server are using directory service, so that they can be located by other user applications using the directory service as well.

Several distributed system properties need to be considered when designing the distributed directory service:

On the other hand, the directory service provides the following application-specific features:

 

 

Approach and solution

The following three approaches have been considered in designing and implementing the directory service. After evaluating tradeoffs between using different approaches, I decided to choose DNS-based client-server approach. Evaluations on the three approaches are described as follows:

  1. Building from the ground-up
  2. Using this approach to design and implement the directory service results in disadvantages far out-weighting advantages. The advantage is that the implementation can be very flexible, without under the constraints of existing implemented component such as platform dependence, different language implementation, and lack of extensibility. However, implementing the distributed directory service from scratch, especially taking into account different distributed system properties mentioned above, can be a complicated and insurmountable task.

  3. Web-based client-server approach
  4. There are wide variety of software tools and components to support implementing this approach. The communication between the client and the server components is HTTP-based. Basically, on the client side, client communicates with the web-based database server by sending HTTP request and receiving HTTP response. Database server processes and translates the request into a series of database transactions to communicate with the local database storage. This is a common and typical approach to provide proprietary data services. However, this approach does not satisfy our requirement of ITX system for the following reasons. First, the latency characteristic of this approach cannot provide certain degree of real-time characteristic guarantee to our system requirement. For example, the signaling component needs to communicate with the directory service component to setup and establish calls. The directory service needs to guarantee efficient response time (low latency guarantee), so that user should not feel any difference in using our ITX system to make calls than using the telephone system. The latency of using the web-based client-server approach can be unpredictably high, which can undermine our overall system's performance to provide consistent real-time guarantee. Second, there is no single software solution to fulfill our system requirement of distributed system properties. The implementation of this approach requires an integration of different software products to work coherently as a single system. Complications arise to evaluate different proprietary software products to the same solutions, and to make decision on choosing the suitable set of integration to fit our requirement. Cost of system updates and maintenance is also comparatively high in terms of the number of proprietary solutions chosen for building our system.

  5. DNS-based client-server approach

Domain Name System (DNS) is known to be the most successful distributed name service in the Internet. Its main responsibility is to provide name-to-address resolution for the entire Internet, which in other words provides translations between identifiers.

The DNS is distributed in hierarchical nature, instead of being centralized which is prone to central point of failure. It consists of distributed name servers, each being responsible for a sub-tree of name space partitioned into different domains. In other words, DNS is a distributed database system. It has robust and stable implementation architecture called BIND (which stands for Berkeley Internet Name Domain). BIND provides the following characteristics:

BIND is freely distributed and is fully supported by the Internet Software Consortium. It is portable on many different operating system platforms such as Solaris, HPUX, Linux, Ultrix, SunOS, and Windows, etc. Backward compatibility is also supported across different release versions.

The chosen of this approach is based on the mature and robust implementation architecture which has been justified by the popular use in the Internet community, and also on the role and functionality of DNS which best fit into the design requirement of the directory service. Moreover, most of the distributed system properties such as fault tolerant, scalability, availability, and failure detection, etc. has been implemented and taken care of in BIND. BIND guarantees low latency behavior (very efficient response time), which is a very desirable feature to the directory service. Lastly, the entire software product is free and provided by one organization, which saves substantial amount of cost for updates and maintenance.

Design and Implementation

The design of the directory service is basically decomposed into 4 parts:

The database schema is responsible for organization of the data. The fundamental question to address is the kinds of data the directory service stores, and how to organize those data in the database storage. The more well organized the data is stored in the database, the more efficient the server can retrieve the data. Of course, the efficiency of data access also depends on its available retrieval and serialization mechanisms and available data types supported.

The database server is responsible for interfacing with the client and the database storage. The server job is to accept queries from the clients; queries can be either update or lookup queries, which will then be parsed and translated into database commands to communicate with the database. In addition, the server is designed to take into account different distributed system properties mentioned above.

The client API is responsible for interfacing with the users and the client communicator (described next). It is the application programming interface (API) exposed to the users to use the functionality of the directory service. The client API is freed from server communication mechanism, the job of the client communicator. The interface is designed to be intuitive to use.

The client communicator is responsible for providing directory service a communication mechanism to the database server. It job is to hide the complexity of communicating with the server by providing a communication interface layer to the client API.

Database Schema

This area consists of two stages. The first stage is mainly the design phase: to determine the kinds of data directory service needs to maintain, and organize the data into separate relational entities or tables. The second stage is the implementation phase: to integrate the design into the existing BIND implementation.

First Stage:

The following three major categories of data were identified to be stored in the directory database:

The following describes different relational entities (tables) to organize the above data categories:

This entity is used to store extension numbers having been assigned and distributed so far by the directory service administrator. Each entry contains one field, the assigned extension number (the number of digits is from 1 to 7). Only administrator can manipulate this entity to assign extension numbers.

This entity maintains each registered user profile's entry. Each newly registered user must have one associated entry. Each entry contains three fields: extension number, user ID, and custom message. User ID is associated EITHER with a registered person in the form of email address OR with a registered server ITX-application. Therefore, "user" in ITX system represents a physical person or a server ITX-application. An entry is searched by the extension number. An example of an entry is shown below.

Extension

User ID

Custom Message (Optional)

123

jh23@cornell.edu

John Hudson

This entity contains security information for each registered user. Each newly registered user must have one associated entry. Each entry contains three fields: user ID, password, and access level. An entry is searched by the user ID. Password and access level are assigned by the directory service administrator. Only the password can be changed by the associated user. An entry is searched by the user ID. An example of an entry is shown below.

User ID

Password

Access level

jh23@cornell.edu

45364223 (encoded hash code)

user access

This entity maintains each registered user a roaming location. Each registered user has zero or at most one associated entry. Each entry contains two fields: user's extension number and location. An entry is searched by the extension number. An example of an entry is shown below.

Extension

(Roaming) Location

123

Internet location at host "host001.cs.cornell.edu" and port 4000 running Spot ITX application

This entity maintains each registered user a list of dynamic locations. When more than one ITX-application is running on behalf of a user, one location of an application enters the roaming location entity, and the rest enter the dynamic location list entity. Each registered user can have zero or more than one entry. Each entry contains two fields: user's extension number and location. An entry is searched by the extension number. An example of 2 entries associated with the same user is shown below.

Extension

(Dynamic) Location

123

Internet location at host " host001.cs.cornell.edu" and port 4001 running CUPS ITX application

123

Internet location at host " host001.cs.cornell.edu" and port 4002 running APP3 ITX application

This entity maintains each registered user a list of default locations. User can optionally setup a list of static locations to be reached at any time. Home phone number is one example. Another example is user can also specify another user as default "forwarding" location. Each registered user can have zero or more than one entry. Each entry contains two fields: user's extension number and location. An entry is searched by the extension number. An example of 2 entries associated with the same user is shown below.

Extension

(Default) Location

123

home telephone location at 607-2554540

123

user location at ae21@cornell.edu

These two entities maintain each registered user a list of custom location Ids. User can optionally setup a list of static locations to be reached at a specific time period. In addition to providing the same setup mechanism as in the default location list entity, the user can also setup the valid time period to use the custom location. Each registered user can have zero or more than one entry.

For the Custom Location ID List entity, Each registered user can have zero or more than one entry. Each entry contains two fields: user's extension number and custom location ID. An entry is searched by the extension number. An example of 2 entries associated with the same user is shown below.

Extension

Custom Location ID

123

123.1

123

123.2

  1. For the Custom Location entity, each entry contains four fields: location ID, start time, end time, and location. An entry is searched by the custom location ID. An example of 2 entries associated with a location ID is shown below.

Custom Location ID

Start Time

End Time

Location

123.1

8:00.00am 3/4/1998

5:00.00pm 3/4/1998

cellular telephone location at 607-2563456

123.1

8:00.00am 3/4/1998

5:00.00pm 3/4/1998

cellular telephone location at 607-2563457

Second Stage:

To integrate the entities defined above into the existing BIND, we need to understand the existing mechanisms provided by BIND to create database storage (For the details on the BIND implementation, please refers to the book, "DNS and BIND" by Paul Albitz and Cricket Liu). An extensive amount of time was spent on the book and related sources (such as the BIND web page and mailing list) to understand how BIND works. Basically, each entity is designed to be managed and serialized under different zones (a zone can be analogous to an entity name). Each zone is defined in a separate database file. DNS resource record is the storage format and syntax used in the database file.

The following zones were defined for each entity defined above:

One database file is created for each zone. Below shows the content of a database file for the zone "ext.to.user" (the explanation for the rest of the database files can be found in the appendix section):

$ORIGIN to.user.

ext IN NS sim1.cs.cornell.edu.

ext IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

    1. ; Serial

10800 ; Refresh after 3 hours

    1. ; Retry after 1 hour

604800 ; Expire after 1 week

86400 ) ; Minimum TTL of 1 day

$ORIGIN ext.to.user.

123 0 IN TXT "userid=jh23@cornell.edu;custmsg=John Hudson"

10015 0 IN TXT "userid=guest;custmsg=Guest Account"

1 0 IN TXT "userid=adm;custmsg=Administrator"

As mentioned before, the format and syntax used to write the database file is defined by DNS resource record. From the above database file, there are three different resource records defined:

<extension number> 0 IN TXT "userid=<user>; custmsg=<description>"

The above database file shows there are three entries existed.

For details of the definition of resource records, please refers to the book, "DNS and BIND" by Paul Albitz and Cricket Liu.

Database Server

To run the database server for the directory service, the BIND source code needs to be downloaded and installed. The details on download, installation, and running are fully explained in the appendix section.

After the installation, before the database server starts running, three pre-existing files are needed:

0.0.127.in-addr.arpa. IN NS sim1.cs.cornell.edu.

0.0.127.in-addr.arpa. IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 ; Serial

10800 ; Refresh after 3 hours

3600 ; Retry after 1 hour

604800 ; Expire after 1 week

86400 ) ; Minimum TTL of 1 day

1.0.0.127.in-addr.arpa. IN PTR localhost.

The first entry is the name server (NS) resource record. The second entry is the start of authority (SOA) resource record. The third entry is the pointer (PTR) resource record, used for address-to-canonical-name mapping.

// BIND configuration file for the primary server

options {

directory "/amd/sim1/z/itx_ds/primary";

// place any additional options here

};

zone "extdistrib1.itx.cnrg" in {

type master;

file "db.extdistrib1";

};

zone "extdistrib2.itx.cnrg" in {

type master;

file "db.extdistrib2";

};

zone "ext.to.user" in {

type master;

file "db.ext2user";

};

zone "0.0.127.in-addr.arpa" in {

type master;

file "db.127.0.0";

};

zone "." in {

type hint;

file "db.cache";

};

The options statement sets up global options to be used by BIND. This statement may appear at only once in a configuration file; if more than one occurrence is found, the first occurrence determines the actual options used, and a warning will be generated. If there is no options statement, an options block with each option set to its default will be used (Please refer to http://www.isc.org/bind8/options.html for details.).

Each zone statement represents each database domain information. For example, the domain "extdistrib1.itx.cnrg" resides on the database file "db.extdistrib1"; it is of type master, which indicates it is a primary database server. The last two zone statements are standard for the configuration.

The above setup is for the primary database servers. For the setup of the secondary database servers, the only database files needed are the three pre-existing files described above. No database files described in the database schema section needs to be created for the secondary database servers because they will take care of data synchronization and replication by loading the database data over the network from the primary database servers (a mechanism called zone transfer). One difference between the primary and the secondary database servers are their named.conf files. For the secondary name server, the content of the named.conf files looks like the following:

// BIND configuration file for the secondary server

options {

directory "/amd/sim1/z/itx_ds/slave";

// place any additional options here

};

zone "extdistrib1.itx.cnrg" in {

type slave;

file "db.extdistrib1";

masters {128.84.223.58; };

};

zone "extdistrib2.itx.cnrg" in {

type slave;

file "db.extdistrib2";

masters {128.84.223.58; };

};

zone "ext.to.user" in {

type slave;

file "db.ext2user";

masters {128.84.223.58; };

};

zone "0.0.127.in-addr.arpa" in {

type master;

file "db.127.0.0";

};

zone "." in {

type hint;

file "db.cache";

};

The above configuration file tells the database server that it is secondary for the zone in which the slave keyword is signified, and it should track its update against the primary server on the host 128.84.223.58. For robustness, the configuration file for the secondary database server can specify up to ten database servers for zone transfer.

Client API

The client API is implemented in JAVA, which enables fast application development cycle and portability across multiple platforms. The client API basically exposes necessary interface(s) at the application level. The main interface exposed is the DirectoryService class, along with other supporting classes, described below:

In addition, different exception classes are defined to handle unexpected things happened in the directory service client API during the course of running ITX application. They are all inherited from Java Exception class.

All classes described above are packaged in the cnrg.itx.ds API library. Other supporting classes are defined in the package but are not exposed outside to the application level. For complete details of all the classes and methods defined in the cnrg.itx.ds package, please refer to the appendix section.

Client Communicator

BIND implementation provides resolver, which is a set of library routines that are linked into client programs (such as telnet, ftp, nslookup, etc.) to access the server. The resolver basically handles:

Therefore, the client communicator needs to incorporate the resolver library, which are implemented in C. A DSComm JAVA interface is defined to interface between the client API and the resolver library. The DSComm interface provides necessary methods to the client API to perform query and update to the directory database server (The DSComm interface is defined in the cnrg.itx.ds package that is fully explained in the appendix section). Those methods are native methods allowed to be implemented in low-level languages like C/C++. The implementation of native methods is compiled (with the resolver library) into a dynamically linked library (DLL) called DSComm.dll to be loaded and referenced via the DSComm interface.

The client communicator is also designed to be flexible in its implementation. In other words, its design can be implemented to use different database solutions (other than BIND) such as MS Access, MS SQL database, and Oracle database, etc., in order to suit to the context of different business constraints. The reason to support this flexibility is to consider the fact that BIND server needs to start in super-user mode, which creates inflexibility in installing and running BIND. By overriding DSComm interface methods in a DSComm-derived class, users provide their implementation in the overridden methods of the DSComm-derived class to communicate with other database servers.

This area is the most challenging task compared with other three areas. First, a fair amount of time was spent on understanding and hacking the BIND query and update code since there is not enough documentation to explain query and update related data structure defined in the resolver library. Second, blending Java and C code together introduces interesting garbage collection issue because Java run-time system is managing garbage collection on behalf of the programmer, but C is not. Therefore, in DSComm.dll which reference Java classes, Java run-time garbage collection mechanism needs to be turned off and handled explicitly in the DLL. Third, although BIND has been ported to different platforms, the latest BIND resolver version ported to Windows turned out to be not up-to-dated (which is BIND 4.9.7), and the database server is running BIND 8.1.2, Even it is backward compatibility (meaning BIND 4.x resolver still can communicate with BIND 8.x server), BIND 4.9.7 lacks dynamic update functionality (query and update routines) which is only supported from BIND 8.x versions onwards. Therefore, a fair amount of the dynamic update codes need to be ported over from Unix-version BIND 8.1.2 resolver library to BIND 4.9.7 resolver library.

Results Analysis

The performance of the implementation of the directory service was evaluated based on the requirements set forth in the design problem section:

Appendix

The ITX joint project page is located at the following web page: http://www.cs.cornell.edu/cnrg/telephony/JavaDocs/

Description of database files used by Directory database server

$ORIGIN itx.cnrg.

extdistrib1 IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

$ORIGIN extdistrib1.itx.cnrg.

ds 0 IN TXT "1"

ds 0 IN TXT "3"

It shows there are two 1-digit extension numbers assigned by the administrator. The format is:

ds 0 IN TXT "<1-digit extension number>"

$ORIGIN itx.cnrg.

extdistrib2 IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

It shows there is no 2-digit extension number assigned by the administrator. The format is:

ds 0 IN TXT "<2-digit extension number>"

$ORIGIN itx.cnrg.

extdistrib3 IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

$ORIGIN extdistrib3.itx.cnrg.

ds 0 IN TXT "123"

It shows there is a 3-digit extension number assigned by the administrator. The format is:

ds 0 IN TXT "<3-digit extension number>"

$ORIGIN itx.cnrg.

extdistrib4 IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

The format is:

ds 0 IN TXT "<4-digit extension number>"

$ORIGIN itx.cnrg.

extdistrib5 IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

The format is:

ds 0 IN TXT "<5-digit extension number>"

$ORIGIN itx.cnrg.

extdistrib6 IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

The format is:

ds 0 IN TXT "<6-digit extension number>"

$ORIGIN itx.cnrg.

extdistrib7 IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

The format is:

ds 0 IN TXT "<7-digit extension number>"

$ORIGIN to.sec.

userid IN NS sim1.cs.cornell.edu

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

$ORIGIN userid.to.sec.

jh12@cornell.edu 0 IN TXT "pin=-1085180997;access=10"

It shows there is one entry assigned by the administrator. The format is:

<user> 0 IN TXT "pin=<hash code of password string>;access=<access level>"

$ORIGIN to.user.

ext IN NS sim1.cs.cornell.edu

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

$ORIGIN ext.to.user.

123 0 IN TXT "userid=jh12@cornell.edu;custmsg=John Hudson"

It shows there is one entry assigned by the administrator. The format is:

<extension number> 0 IN TXT "userid=<user>; custmsg=<description>"

$ORIGIN to.ext.

userid IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

$ORIGIN userid.to.ext.

jh12@cornell.edu 0 IN TXT "123"

It shows there is one entry assigned by the administrator. The format is:

<user> 0 IN TXT "<extension number>"

$ORIGIN to.roamloc.

ext IN NS sim1.cs.cornell.edu

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

$ORIGIN ext.to.roamloc.

123 0 IN TXT "128.84.223.135:1645+I+ITX Application"

It shows there is one entry associated with the extension number, 123. The format is:

<extension number> 0 IN TXT "<host address>:<port>+I+<location description>"

$ORIGIN to.dynamicloclist.

ext IN NS sim1.cs.cornell.edu

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

$ORIGIN ext.to.dynamicloclist.

123 0 IN TXT "128.84.223.20:1550+I+ITX Application 2"

0 IN TXT "128.84.223.20:1750+I+ITX Application 3"

It shows there two entries associated with the extension number, 123. The format follows the same as defined in the file db.ext2roamloc.

$ORIGIN to.defaultloclist.

ext IN NS sim1.cs.cornell.edu

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

$ORIGIN ext.to.defaultloclist.

123 0 IN TXT "607-2555520+T+home"

It shows there is one entry associated with the extension number, 123. The format is either:

<extension number> 0 IN TXT "<area code>-<phone number>+T+<location description>"; or

<extension number> 0 IN TXT "<user>+U+<location description>"

$ORIGIN to.customloclist.

ext IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

3 10800 3600 604800 86400 )

$ORIGIN ext.to.customloclist.

123 0 IN TXT "123.1"

It shows there is one entry associated with the extension number, 123. The format is:

<extension number> 0 IN TXT "<extension number>.<index number>"

$ORIGIN loc.

custom IN NS sim1.cs.cornell.edu.

IN SOA sim1.cs.cornell.edu. itx.cs.cornell.edu. (

1 10800 3600 604800 86400 )

$ORIGIN custom.loc.

123.1 0 IN TXT "starttime=887065594039;endtime=887095594039;607

-2551959+T+syslab"

It shows there is one entry. The format is either:

<extension number>.<index number> 0 IN TXT "starttime=<number of milliseconds since January 1, 1970, 00:00:00 GMT>;endtime=<number of milliseconds since January 1, 1970, 00:00:00 GMT>;<area code>-<phone number>+T+<location description>"; or

<extension number>.<index number> 0 IN TXT "starttime=<number of milliseconds since January 1, 1970, 00:00:00 GMT>;endtime=<number of milliseconds since January 1, 1970, 00:00:00 GMT>;<user>+U+<location description>"

Installation instruction on BIND server

Below shows an installation procedure for the BIND server running on a Solaris machine:

Pre-requisites:

  1. Make sure you have gcc compiler installed on your host. (the following procedure shown uses gcc version 2.7.2.3)
  2. Make sure you have yacc (or byacc) and lex installed.

Steps:

For example, assuming you are installing the BIND on the path, /usr/u/aaa:

  1. Get the bind-8.1.2.tar.gz from the bind site(http://www.isc.org/bind.html)
  1. Create a bind directory for installation:
  1. Do "make clean" in the bind directory
  2. (Optional) If you only have yacc (instead of byacc), edit the Makefile.set in bind/SRC/port/solaris:
  1. Do "make depend" in the bind directory
  2. Do "make" in the bind directory
  3. (Optional) If you don't want your resulting libraries and executables installed under the root directory, you can specify different destination path. For example, if you want the resulting libraries and executables installed under the path, /usr/u/aaa, you can do:
  1. Do "make install" in the bind directory
  1. Make sure you have your database and configuration files set up before running BIND (please refers to the document for setting up the database for BIND). At least three pre-existing files need to be created: db.127.0.0, db.cache, and named.conf.
  2. To run server, type named at the command prompt. Please look at the man page for possible options to the command.

 

Classes/Methods description - Directory Service Client API

(Details of this section can also be found at the web page: http://www.cs.cornell.edu/cnrg/telephony/JavaDocs/ds.html)

 

public class DirectoryService extends java.lang.Object

This class provides clients an interface to communicate with the directory server.

Constructor Summary

DirectoryService()throws DirectoryServiceException

Default constructor NOTE: It also sets up where to find the config file. Config file is used to locate the Directory Server. The default location of the config file is in the same directory as DSComm.dll resides.

DirectoryService(DSComm newDSComm) throws DirectoryServiceException
Constructor for a given DSComm-derived object. NOTE: It also sets up where to find the config file. Config file is used to locate the Directory Server. The default location of the config file is in the same directory as DSComm.dll resides.
Parameters:

newDSComm - a DSComm-derived object to provide customized interface communicating to user-defined directory database server.

DirectoryService(java.lang.String configFilePath) throws DirectoryServiceException

Constructor for a given config file path to locate the config file. Config file is used to locate the Directory Server. NOTE: If default constructor is used instead, the config file (called resolv.conf) is assumed to be resided in the same directory as DSComm.dll resides.
Parameters:
configFilePath - a full file path to locate the config file.

DirectoryService(java.lang.String configFilePath, DSComm newDSComm) throws DirectoryServiceException
Constructor for a given config file path to locate the config file and a given DSComm-derived object.

Parameters:
configFilePath - a full file path to locate the config file.
newDSComm - a DSComm-derived object to provide customized interface communicating to user-defined directory database server.

Method Summary

void

addCustomLocation(CustomLocation newCustomLocation) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
Adds the custom location list of the user authenticated with this directory service

Parameters:
newCustomLocation - a new custom location object

void

addUser(UserID id, Digits newExtension, Password newPin, int accessLevel, java.lang.String customMsg)
throws AuthenticationException, AccessDeniedException, RecordAlreadyExistsException, DirectoryServiceException

Adds a new user into the directory database based on an input extension number. If the input extension number is already assigned, RecordAlreadyExistsException will be thrown.
NOTE: Only the administrator has privilege to use this method; otherwise, AccessDeniedException will throw.
Parameters:
id - new user's id
newExtension - new extension number to be assigned to the new user
newPin - new user's password
accessLevel - new user's access level (USER_ACCESS_LEVEL, SERVER_ACCESS_LEVEL, ADM_ACCESS_LEVEL)
customMsg - custom message (can be empty)

Digits

addUser(UserID id, int numberOfDigitForExtension, Password newPin, int accessLevel, java.lang.String customMsg)
throws AuthenticationException, AccessDeniedException, RecordAlreadyExistsException, DirectoryServiceException

Adds a new user into the directory database. Returns a new extension associated with the new user. If user already exists in the database, RecordAlreadyExistsException will be thrown. If there is no available extension number, AccessDeniedException will be thrown.
NOTE: Only the administrator has privilege to use this method; otherwise, AccessDeniedException will throw.
Parameters:
id - new user's id
numberOfDigitForExtension - requested number of extension digits [DirectoryService.MIN_EXTENSION_SIZE...DirectoryService.MAX_EXTENSION_SIZE]
newPin - new user's password
accessLevel - new user's access level (USER_ACCESS_LEVEL, SERVER_ACCESS_LEVEL, ADM_ACCESS_LEVEL)
customMsg - custom message (can be empty)
Returns:
extension of the new user

void

declareIdentity(UserID id, Password pin) throws AuthenticationException
Authenticate this directory service with the ID and corresponding PIN of the client BEFORE calling any methods. Client only needs to call this method once. New user needs to register his/her ID and PIN via the administrator of the directory server.

Parameters:
id - user's ID
pin - user's PIN

void

deleteCustomLocation(java.lang.String customLocationID)
throws AuthenticationException, AccessDeniedException, RecordNotFoundException

Deletes the custom location of the user authenticated with this directory service

Parameters:
customLocationID - ID of the custom location to be deleted

java.util.Vector

dumpAllUsers()throws AuthenticationException, AccessDeniedException, RecordNotFoundException, DirectoryServiceException

Dump all users' records from the directory database to the terminal output.

Returns:
a Vector of UserProperty objects

int

getAccessLevel()throws AuthenticationException
Get the access level of the user authenticated with this directory service

Returns:
the access level of the user (e.g. DirectoryService.USER_ACCESS_LEVEL, DirectoryService.SERVER_ACCESS_LEVEL, DirectoryService.ADM_ACCESS_LEVEL, DirectoryService.NULL_ACCESS_LEVEL)

java.util.Vector

getCustomLocationByExtension(Digits extension)
throws AuthenticationException, AccessDeniedException, RecordNotFoundException

Gets all custom locations of the user authenticated with this directory service

Parameters:
extension - user's extension
Returns:
vector of CustomLocationRecord objects

java.lang.String

getCustomMessage()throws AuthenticationException, AccessDeniedException, RecordNotFoundException

Get the custom message of the user authenticated with this directory service

Returns:
message string

java.util.Vector

getDefaultLocationByExtension(Digits extension)
throws AuthenticationException, AccessDeniedException, RecordNotFoundException

Gets all default locations of the user authenticated with this directory service

Parameters:
extension - user's extension
Returns:

vector of location objects

Digits

getExtension()throws AuthenticationException, AccessDeniedException, RecordNotFoundException
Get the Extension of the user authenticated with this directory service

Returns:
Digits object to store user's extension

Digits

getExtension(UserID id) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
Get the extension from a given UserID

Parameters:
id - user's ID
Returns:
user's extension represented by Digits object

UserID

getID()throws AuthenticationException, AccessDeniedException, RecordNotFoundException
Get the ID of the user authenticated with this directory service

Returns:
user's ID

UserID

getID(Digits extension) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
Get the UserID from a given extension

Parameters:
extension - user's extension
Returns:
user's ID

LocationList

getLocationListByExtension(Digits extension) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
Get the location list from a given extension

Parameters:
extension - user's extension
Returns:
a list of location

LocationList

getLocationListByID(UserID id) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
Get the location list from a given UserID. UserID can be one of the following:
1. email (physical person registered in our directory database)
2. server application (e.g. Gatewaysrv, PBXsrv, Vmailsrv, etc.)
3. phone number
Parameters:
id - user's ID
Returns:
a list of location

void

registerLocation(int locationType, Location newLocation) throws AuthenticationException, AccessDeniedException, RecordNotFoundException

Register the location of the user (authenticated with this directory service) when he/she starts up an application. Dialable location is allowed to be added ONLY as ROAMING or DYNAMIC location. Non-Dialable location is allowed to be added ONLY as DEFAULT location. Otherwise, an AccessDeniedException is thrown.

Parameters:
locationType - (e.g. Location.ROAMING, Location.DEFAULT, Location.DYNAMIC)
newLocation - a new location object to be registered

void

removeUser(Digits extension)
throws AuthenticationException, AccessDeniedException, RecordNotFoundException, DirectoryServiceException

Removes a user from the directory database. NOTE: Only the administrator has privilege to use this method
Parameters:
extension - extension of the user to be removed

void

setCleanUp(boolean bCleanup)
Turn off or turn on the cleanup thread. The default is ON, which means when a user call declareIdentity, the cleanup thread starts automatically.
Parameters:
bCleanup - false to turn off the cleanup thread; true to turn it on

void

setCustomMessage(java.lang.String newCustomMsg) throws AuthenticationException, AccessDeniedException, RecordNotFoundException

Set the custom message of the user authenticated with this directory service

Parameters:
newCustomMsg - new custom message

void

setPIN(UserID id, Password currentPin, Password newPin) throws AuthenticationException, AccessDeniedException, RecordNotFoundException

Change the PIN of the user authenticated with this directory service.

Parameters:
id - user's ID
currentPin - user's PIN
newPin - new user's PIN

void

unregisterLocation(int locationType, Location newLocation) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
Unregister the location of the user (authenticated with this directory service) when he/she exits from an application.

Parameters:
locationType - (e.g. Location.ROAMING, Location.DEFAULT, Location.DYNAMIC)
newLocation - a location object to be unregistered

 

public class DSComm extends java.lang.Object

This class is an inteface to the java native methods talking to the directory server. User should not directly call any methods of this class. Alternatively, if user prefers to provide his/her directory database server, he/she can define DSComm-derived class and the directory server.

Method Summary

void

addRecord(byte[] key, byte[] rec)
Add an record associated with the domain entry.

Parameters:
key - domain entry
rec - a record (associated with the entry) to be added. If the record already exists in the directory database, the input record will be ignored.

void

deleteRecord(byte[] key, byte[] rec)
Delete a record (or all records) associated with the domain entry.

Parameters:
key - domain entry
rec - an existing record (associated with the entry) to be deleted. If rec is null, it deletes all records associated with the domain entry.

java.lang.String

getCustomLocDomain()
Gets directory database domain for storing customLocation entries.

Returns:
String object to represent the domain name

java.lang.String

getExt2CustomLocListDomain()
Gets directory database domain for storing extension-to-customLocationList entries.

Returns:
String object to represent the domain name

java.lang.String

getExt2DefaultLocListDomain()
Gets directory database domain for storing extension-to-defaultLocationList entries.

Returns:
String object to represent the domain name

java.lang.String

getExt2DynamicLocListDomain()
Gets directory database domain for storing extension-to-dynamicLocationList entries.

Returns:
String object to represent the domain name

java.lang.String

getExt2RoamLocDomain()
Gets directory database domain for storing extension-to-roamingLocation entries.

Returns:
String object to represent the domain name

java.lang.String

getExt2UserDomain()
Gets directory database domain for storing extension-to-userRecord entries.

Returns:
String object to represent the domain name

java.lang.String

getExtDistribDomain(int nSubDomain)
Gets directory database doamin for storing extension distribution entries.

Returns:
String object to represent the domain name

java.lang.String

getGatewayUserID()
Gets the gatewaysrv username in the ITX network.

Returns:
String object to represent the username

int

getMaxSubDomain()
Gets largest sub-domain index of the extension distribution domain.

Returns:
int value to represent the index

int

getMinSubDomain()
Gets lowest sub-domain index of the extension distribution domain.

Returns:
int value to represent the index

ArrayRecords

getRecord(byte[] key)
Get record(s) associated with the domain entry. A domain entry can be associated with 1 or more than 1 record.
For example, in the domain, "ext.to.user.", an entry, "10011.ext.to.user." has 1 and only 1 record, which is "userid=mr85@cornell.edu;custmsg=".
For example, in the domain, "ext.to.defaultloclist.", an entry, "10011.ext.to.defaultloclist." can have more than 1 record.
Parameters:
key - domain entry (e.g. "10011.ext.to.user.")
Returns:
record(s) (associated with the entry) to be returned (e.g. "userid=mr85@cornell.edu;custmsg="). If no record found, it returns an empty ArrayRecords object.

java.lang.String

getUserID2ExtDomain()
Gets directory database domain for storing userid-to-extension entries.

Returns:
String object to represent the domain name

java.lang.String

getUserID2SecDomain()
Gets directory database domain for storing userid-to-extension entries.

Returns:
String object to represent the domain name

void

setConfigPath(byte[] filepath)
Set the config filepath in the DSComm.dll to be able to communicate with the directory server.

Parameters:
filepath - a file path of the config file (resolv.conf)

 

public class Location extends java.lang.Object implements java.io.Serializable

This class provides a abstraction of where the application or system is located.

Constructor Summary

Location(Location otherLoc)
Copy constructor

Parameters:
otherLoc - other location object
Location(java.lang.String rawLocationStr)
Constructor for formatted record string retrieved from the directory database. If the record string is not in expected format, the location remains un-initialized.
Parameters:
rawLocationStr - a raw string from record entry (e.g. "pit052.cs.cornell.edu:5000+I+testapp"; "607-2775627+T"; "vmailsrv+U+voice mail server")
Location(java.lang.String type, java.lang.String value, java.lang.String label)
Constructor
Parameters:
type - type of the location (e.g. Location.TELEPHONE_TYPE or Location.INTERNET_TYPE or Location.USER_TYPE)
value - value of the location
label - label of the location (can be empty)

Method Summary

java.lang.String[]

enumerateValue()
Parses the value of location into a array of string and returns
e.g. String[0] = "pnt01.cs.cornell.edu"; String[1] = "5001"
e.g. String[0] = "607"; String[1] = "2551595"
e.g. String[0] = "bergmark@cs.cornell.edu"
Returns:
an array of string; null if not applicable

java.lang.String

getIP()
Return the hostname address if this location can be directly dialed. . Otherwise, return null.
Returns:
string value containing the hostname address; null otherwise

java.lang.String

getLabel()
Get the Location (optional) label

Returns:
location label in string

int

getPort()
Return the port number if this location can be directly dialed. Otherwise, returns -1.
Returns:
int value containing the port number; -1 otherwise

java.lang.String

getType()
Get the Location type

Returns:
location type in string

UserID

getUID()
Return the UID of this user-type location (if this is a internet-type location, returns null).

Returns:
UserID object of the user-type location

java.lang.String

getValue()
Get the Location value

Returns:
location value in string

boolean

isDialable()
Determine if this location can be directly dialed (connected)

Returns:
True if it can be dialied; False otherwise

boolean

isPhone()
Determine if the Location is destined to the telephone end

Returns:
true if the location is destined to the telephone end; false otherwise

boolean

isSameAs(Location otherlocation)
Compares with other location object to determine if they are identical

Parameters:
otherlocation - other location object to be compared
Returns:
true if identical; false otherwise

void

setLabel(java.lang.String label)
Set the Location (optional) label

Parameters:
label - location label in string

java.lang.String

toString()
Convert into raw location string format. Returns empty if the location object's properties are not sufficient enough to form a string.
Returns:
string representation of the location object.
Overrides:
toString in class java.lang.Object

 

public class LocationList extends java.lang.Object

This class represents a list of locations.

Constructor Summary

LocationList()
Default constructor

LocationList(LocationList newLocationList)
Copy constructor

Parameters:
newLocationList - an input location list object

Method Summary

void

add(Location newLocation)
Add a new element to the end of the list

Parameters:
newLocation - the new location object to be added to the list

void

add(LocationList newLocationList)
Add the given location list to the end of the list

Parameters:
newLocationList - the new location list to be added to the list

int

count()
Get the number of elements.

Returns:
number of elements

Location

first()
Get the first element (also Reset to the first element position)

Returns:
the first location object in the list

Location

getAt(int index)
Get the element at a particular position (zero-based index)

Parameters:
index - the index of the element to be retrieved
Returns:
the element at the given position. NULL if the given position is out of range.

Location

next()
Get the next element. Returms NULL if call Next on the last element.
NOTE: To traverse the list from the beginning, call first(), then calling next() to traverse to the end of the list
Returns:
the next location object in the list

void

removeAll()
Remove all the elements from the location list object

void

reset()
Reset to the first element position

 

public class CustomLocation extends LocationList

This class represents a list of locations with user-specified time interval

Constructor Summary

CustomLocation(java.util.Calendar startTime, java.util.Calendar endTime, LocationList lstLocation)
Constructor

Parameters:
startTime - specifying the starting time
endTime - specifying the ending time
lstLocation - list of location

CustomLocation(java.lang.String strRawString)
Constructor for formatted entry string retrieved from the directory database.

Parameters:
strRawString - formatted entry string

Method Summary

boolean

currentValid()
Check if this custom location object is currently valid for use

Returns:
True if the custom location is valid for use at the current time

java.util.Calendar

getEndTime()
Get EndTime

Returns:
Calender object representing an ending time

LocationList

getLocationList()
Get Location list

Returns:
LocationList object

java.util.Calendar

getStartTime()
Get StartTime

Returns:
Calendar object representing a starting time

void

setEndTime(java.util.Calendar newEndTime)
Set EndTime

Parameters:
newEndTime - specifying a new end time

void

setLocationList(LocationList newLocList)
Set the Location list to the given new location list

Parameters:
newLocList - the given new location list (if newLocList is null or empty, it does nothing and exits)

void

setStartTime(java.util.Calendar newStartTime)
Set StartTime

Parameters:
newStartTime - specifying a new starting time

java.lang.String

toString()
Convert into formatted entry string to be stored in the directory database

Returns:
String to represents the formatted entry string to be stored in the directory database
Overrides:
toString in class java.lang.Object

 

public class UserID extends java.lang.Object implements java.io.Serializable

This class provides an abstraction to identify a user uniquely

Constructor Summary

UserID(java.lang.String str)
Constructor for string E.g. "jh12@cornell.edu", "gatewaysrv"

Parameters:
str - UserID in string format

Method Summary

java.lang.String

toString()
Convert to string

Returns:
a string representation of userID
Overrides:
toString in class java.lang.Object

 

public class Password extends java.lang.Object

This class provides an encapsulation to store user's password information.

Constructor Summary

Password(java.lang.String strPW)
Constructor for String

Parameters:
strPW - input password string

Method Summary

java.lang.String

toString()
Converts to string representation to be stored in the directory database

Returns:

string representation of this Password object

boolean

verified(Password inputPW)
Verify against a given password object

Parameters:
inputPW - input password
Returns:
true if verified successfully; false otherwise

 

public class Digits extends java.lang.Object implements java.io.Serializable

This class provides an abstraction to digits

Constructor Summary

Digits(int num)
Constructor for integer.

Parameters:
num - integer value

Digits(int[] n)
Constructor for integer array

Parameters:
n - array of int

Digits(java.lang.String num)
Constructor for string of digits.

Parameters:
num - string of digits

Method Summary

int

count()
Count the number of digits in this digits object

Returns:
the number of digits in this object

boolean

equals(Digits digits)
Compare with other digits instance to determine if they are identical

Parameters:
digits - another digits object to be compared
Returns:
true if identical; false otherwise

int[]

getArray()
Returns itself represented as an array of int

Returns:
array of int

int

getValue()
Get the digits value

Returns:

integer value of this Digits object

java.lang.String

toString()
Returns itself represented as a string

Returns:
string of digits
Overrides:
toString in class java.lang.Object

 

public class UserProperty extends java.lang.Object

This class stores information on userID, extension, roaming location (if any), and custom message.

Constructor Summary

UserProperty(UserID id, int extension, Location roamLoc, java.lang.String customMsg)
Constructor

Parameters:

id - UserID object

extension - integer value of the extension number

roamLoc - roaming location

customMsg - custom message

Method Summary

java.lang.String

getCustomMessage()
Gets custom message

Returns:
a string object

int

getExtension()
Gets extension field

Returns:

an int to represent an extension

Location

getRoamingLocation()
Gets roaming location object (if any)

Returns:
a roaming location object

UserID

getUserID()
Gets userID field

Returns:
a UserID object

 

public class ArrayRecords extends java.lang.Object

This class is used to hold returned record entries from the directory database

Method Summary

void

add(byte[] newValue)
Add a new element to the end of the list

Parameters:
newValue - the new element to be added to the list

void

add(java.lang.String newValue)
Add a new element to the end of the list

int

count()
Get the number of elements. Zero implies empty list.
Returns:
number of elements

java.lang.String

first()

Get the first element (also Reset to the first element position)

Returns:

the first element in the list

java.lang.String

next()
Get the next element. . Returns NULL if call Next on the last element. NOTE: To traverse the list from the beginning, call first(), then calling next() to traverse to the end of the list
Returns:

the next element in the list

void

reset()
Reset to the first element position

 

public class CustomLocationRecord extends java.lang.Object

This class is used to hold customLocationID-customLocation pair retrieved from the directory server.

Constructor Summary

CustomLocationRecord(java.lang.String id, CustomLocation customLoc)
Constructor for ID and customLocation

Parameters:
id - a String to represent a custom location ID
customLoc - CustomLocation object

Method Summary

CustomLocation

getCustomLocation()
Gets the custom location

Returns:

CustomLocation object

java.lang.String

getID()
Gets the ID of the custom location

Returns:

String represents the ID

 

public class DirectoryServiceException extends cnrg.itx.ITXException

This base class represents an exception thrown by the directory service.

Constructor Summary

DirectoryServiceException(java.lang.String msg)

Constructor

Parameters:

msg - string explaining the cause of exception

 

public class AccessDeniedException extends DirectoryServiceException

This class represents an access-denied exception thrown by the directory service.

Constructor Summary

AccessDeniedException(java.lang.String msg)
Constructor

Parameters:
msg - string explaining the cause of exception

 

public class AuthenticationException extends DirectoryServiceException

This class represents an authentication exception thrown by the directory service.

Constructor Summary

AuthenticationException(java.lang.String msg)
Constructor

Parameters:

msg - string explaining the cause of exception

 

public class RecordAlreadyExistsException extends DirectoryServiceException

This class represents a record-already-exists exception thrown by the directory service.

Constructor Summary

RecordAlreadyExistsException(java.lang.String msg)
Constructor

Parameters:

msg - string explaining the cause of exception

 

public class RecordNotFoundException extends DirectoryServiceException

This class represents a record-not-found exception thrown by the directory service.

Constructor Summary

RecordNotFoundException(java.lang.String msg)
Constructor

Parameters:
msg - string explaining the cause of exception