Project title
Context Aware Services for Mobile Users



Members
 Seno Park, Changgi Kwon

 

Description

Enable the support of context aware services to mobile users

 

Project Goal

-Define an XML-based user profile for the description of context aware services (device type, connectivity, bandwidth, media format).

-Design XML parser, Presence Server, Monitor for Service.

-Running the specified script.

-Implement calendar, http-get operations, join multicast discussion.

 

Index

 

Configuration

Task

1.   Coding and Test Environment

2.   Function

3.   Client (User Request Based on XML)

4.   Server (XML Parser, Presence Server Monitor)

How to operate it

Needed to be done

 

 

Configuration

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Tasks

 

1. Coding and Test Environment: Linux in CLIC Lab

  -Communication between Task: Socket using IP address

  -Monitors is generated in pthread by presence server.

 

2. Function: Calendar, http-get operations, join multicast

    discussion service with "variables" location, connectivity

    and device availability

 

 

 

3. Client (User Request Based on XML)

 

1)   Registration: Device Attirbutes (Laptop, PDA, Ephone)

  : A User registrates his device.

 

  -Laptop

        <?xml version="1.0"?>

        <!DOCTYPE device_registration SYSTEM "device_registration.dtd">

        <device_registration>

              <id user_id="sp83"/>

             <register device="PDA"/>

        </device_registration>

 

  -PDA

        <?xml version="1.0"?>

        <!DOCTYPE device_registration SYSTEM "device_registration.dtd">

        <device_registration>

              <id user_id="sp83"/>

             <register device="laptop"/>

        </device_registration>

 

  -Ephone

        <?xml version="1.0"?>

        <!DOCTYPE device_registration SYSTEM "device_registration.dtd">

        <device_registration>

              <id user_id="sp83"/>

             <register device="Ephone"/>

        </device_registration>

 

2)   User Request#1: Device Change Service

If a user (sp83)’s device is “PDA” and bandwidth is “low”,

       Then redirect to “laptop”.  Else, redirect to “PDA”.

 

         <?xml version="1.0"?>

         <!DOCTYPE user_preference SYSTEM "user_preference.dtd">

 

         <user_preference>

                <id user_id="sp83"/>

 

               <condition device="PDA">

                      <match>

                               <condition  bandwidth="low">

                                         <match>

                                                         <redirect target="laptop"/>

                                         </match>

                                         <nomatch>

                                                         <redirect target="PDA"/>

                                         </nomatch>

                                 </condition>

                        </match>

                </condition>

         </user_preference>     

 

  3) User Request#2: Location Service

        If device status for a user (sp83) is PDA and he is in Butler library,

       Then, redirect to laptop and if current date is April 27th,

       Forwards URL form (www.music.columbia.edu/index.html).

   

      <?xml version="1.0"?>

      <!DOCTYPE user_preference SYSTEM "user_preference.dtd">

 

      <user_preference>

              <id user_id="sp83"/>

 

             <condition device="PDA">

                     <match>

                           <condition location="butler">

                                   <match>

                                       <redirect target="laptop"/>

                                  </match>

                           </condition>

                   </match>

          </condition>

          <condition device="PDA">

                  <match>

                          <condition date="Apr-27">

                                 <match>

           <HttpGet URL="www.music.columbia.edu/index.html"/>

                                 </match>

                         </condition>

                  </match>

          </condition>

    </user_preference>

 

4. Server

 

  1) XML Parser

  Parsing User Request based on DTD type and Send to Presence.

       DTD File: device_registration.dtd  user_condition.dtd 

                         user_preference.dtd  user_profile.dtd

 

       user_profile.dtd

 

    <!-- proposed DTD for NOTIFY by Seno Park -->

        <!ELEMENT user_profile (id,condition+)>

        <!ELEMENT id EMPTY>

             <!ATTLIST id

                      user_id         CDATA #REQUIRED

             >

        <!ELEMENT condition (match, nomatch?)+>

        <!ATTLIST condition

                      email                 CDATA #IMPLIED

                      phone                CDATA #IMPLIED

                      hostname           CDATA #IMPLIED

                      IPaddr                CDATA #IMPLIED

 

                      time                  CDATA #IMPLIED

                      timespan           CDATA #IMPLIED

                      date                   CDATA #IMPLIED

                      datespan            CDATA #IMPLIED

 

                      country              CDATA #IMPLIED

                      state                   CDATA #IMPLIED

                      city                    CDATA #IMPLIED

                      address              CDATA #IMPLIED

                      location             (butler|mudd|pupin)  #IMPLIED

 

                      device                (laptop|cellphone|PDA)     #IMPLIED

                      connection         (on|off)                   #IMPLIED

                      bandwidth          (high|mid|low)             #IMPLIED

                      media_format     (text|full)              #IMPLIED

         >

    <!ELEMENT match (condition|redirect|media)+>

    <!ELEMENT nomatch (condition|redirect|media)+>

 

    <!ELEMENT redirect EMPTY>

        <!ATTLIST redirect

                      target                  CDATA #REQUIRED

        >

  <!ELEMENT media EMPTY>

       <!ATTLIST media

                      change_to           (text|full)        #REQUIRED

       >

 

3)    Presence Server   

   For the initialization, it receives each device status for a user

   and creates device monitor.

     From received data format from XML Parser, decide what kind 

     of service is requested and create monitor for the request.

 

     *Data Format

-         Registration Sample Format

registration:cc3336@cs.columbia.edu:mudd:dial:500:on:xml:subscribe

 

 - Location Service 1 Sample Format

subscription:ck236@columbia.edu:location:butler:redirect-laptop:null:end

 

 - Location Service 2 Sample Format

subscription:sp83:location:butler:redirect-laptop:null:end

subscription:sp83:bandwidth:low:media-text:media-full:end

subscription:sp83:device:laptop:<1>:null<1>:sp83:connection:off:redirect-PDA:null:end

 

   4) Monitor

They are located in Presence Server and there are 2 types of monitor; one is device monitor and the other , logic monitor.

Device Monitor manages device status for a user.

Logic Monitor manages user request condition based on device status.

If a service of a condition is needed, monitor reply to the user (Client).

 

 

How to operate it

 

1.   Start and Initializing

 

  -Server Side

. On the project directory, $cd  codes/register_handler/

. $prefServer TCP_PORT

  (ex, $prefServer 3000 )

 

       -Client Side

.On the project directory, $cd  codes/profile_client/

. $prefClient SERVER_ADDRESS TCP_PORT REFERENCE_FILE

 (ex, $prefClient 128.59.15.47 3000 device_registration.xml)

 

2.    http-get operations

  -Client Side

    . $prefClient SERVER_ADDRESS TCP_PORT REFERENCE_FILE

      (ex, $prefClient 128.59.15.47 3000 user_preference.xml)

 

*An html page (www.music.columbia.edu/index.html) including image file will be sent to the client to be served.

 

 

3.    join multicast discussion

 

  -Client Side

   Muticast Address  (Class D):  239.0.3.3

   Port: 4444

   . $discuss client_name

    (ex, $discuss cairo)

   . Other clients get to know which client has sent by client_name.

 

4.    Calendar: it will be done soon

 

Needed to be done

 

1. Adding Multicast function to original project code

2. Adding Calendar Service