Advanced Internet Services - CS 6998-03: Homework 4

  1. Internet telephone (8 pts.): Extend your Internet radio program so that it can send audio (from microphone or line input) as well as receive audio, in full-duplex mode. Please refer to the resources (in particular, the technical report) listed with HW#3. Your Internet telephone should interoperate with vat -r or NeVoT. Your radio was multicast-capable; the telephone should be able to send either multicast or unicast RTP over UDP. You do not need to support RTCP.

    At CUCS, vat can be found at ~hgs/sun5/bin/vat and nevot is invoked through isc at ~hgs/sun5/bin/isc.


  2. Silence detection (5 pts.): Add silence detection to your Internet telephone. Sample source code is here (types.h). Make sure both playout and sending work properly.
  3. Signaling (8 pts.): Add basic SIP signaling capability to your phone. Your phone should be able to initiate and receive a call using the INVITE and ACK SIP requests using TCP to an address of the form "user@host". You do not have to implement BYE. Only the Content-Length, To, From, Cseq and Call-ID headers are necessary. You do not have to support SDP; simply connect audio to wherever the SIP request originated from, at a default port of 5004 (RTP) and 5005 (RTCP). Your program should handle syntactically incorrect requests gracefully (i.e., without crashing) and be able to handle variations in SIP syntax such as upper/lower case requests, various amount of white space, etc. Your program should interpret status codes, but anything but 2xx only needs to be displayed, not acted upon. You may either use an audio ringing signal or some form or visual indication.

    The program should be able to answer and originate calls, for example, "phone -e me@cs.columbia.edu foo@bar.com" might make a phone call to the named host, while "phone" simply waits for an incoming call. Here, the parameter "e" specifies the local user's email address.

    The default port for SIP is 5060.

    A request from the caller may look like

    INVITE sip://foo@bar.com SIP/2.0
    To: foo@bar.com
    From: me@cs.columbia.edu
    CSeq: 1
    Content-Length: 0
    Call-ID: 256403891744996588@erlang.cs.columbia.edu
    
    The CSeq is the request sequence number, unique for each Call-ID. The Call-ID is a random number, generated in the example here by a concatenation of two 32-bit random numbers using the "random32.c" utility function cited below. You can also use the output of "gettimeofday()", for example.

    The callee accepts the call by responding with

    SIP/2.0 200 OK 
    To: foo@bar.com
    From: me@cs.columbia.edu
    CSeq: 1
    Content-Length: 0
    Call-ID: 256403891744996588@erlang.cs.columbia.edu
    
    It simply echoes the headers in the request.

    Finally, the caller confirms the call with

    ACK sip://foo@bar.com SIP/2.0
    To: foo@bar.com
    From: me@cs.columbia.edu
    CSeq: 1
    Content-Length: 0
    Call-ID: 256403891@erlang.cs.columbia.edu
    

    If using C, you may (but don't have to) use the following routines for the first three problems:


  4. SIP (2 pts.): Describe how SIP (or an extension) might be used to implement a "home phone"-like service, with several different phones that all ring when a call comes in. As soon as the first member of the family picks up, all phones should stop ringing. However, other members of the family should be able to pick up later and join the call. When the last person hangs up, the call is terminated. Hint: assume that the household supports IP multicast.
  5. Call Setup (2 pts.): Compute the average amount of time it takes to set up a call with SIP, assuming that the network drops all packets with some Bernoulli probability p and that the one-way delay is T. Compute the value for p=0.1 (10%) and T=100 ms.
  6. TCP Connection Setup (3 pts.): Compute the average time until a TCP connection is established for a packet loss probability p. SYNs are retransmitted at intervals of 6, 24, 48, ... seconds, with intervals measured from the previous SYN packet. ("Real" TCP will typically give up after 75 seconds from the first SYN, but you can ignore this.)
  7. SIP URLs (2 pts.): What is the difference between the addresses in the request URL and To field in a SIP request?