Newsgroups: vmsnet.mail.pmdf
Subject: RE: How is estimated time to send FAX calculated?
From: "Daniel C. Newman" <dan@innosoft.com>
Date: 11 Jan 1993 10:45:34 -0700 (PDT)
Organization: The Internet
Return-Path: <epmdf@YMIR.CLAREMONT.EDU>
Resent-Date: 11 Jan 1993 10:45:34 -0700 (PDT)
Resent-From: epmdf@YMIR.CLAREMONT.EDU
Errors-To: epmdf@YMIR.CLAREMONT.EDU
Resent-Message-ID: <01GTEA14QRWI8WW94D@YMIR.CLAREMONT.EDU>
X-Vms-To: IN%"MAC@gvg34.gvg.tek.com"
X-Vms-Cc: IPMDF
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-Transfer-Encoding: 7BIT

> One of my users would like to know how
>
>      Estimated duration of the phone call:
>
> is calculated.  I assume that a good guess is made from the size of the file
> to be sent to the modem?

The time is indeed a guess-estimate.  However, I cannot derive it from the file
size for two reasons.  First, the FAX devices spend time on the phone line
doing negotiations at the start of the FAX transmission, before each page of
the transmission, and at the end of the transmission.  I have no idea how long
these negotiations may take.  In the first set of negotiations the machines
are, among other things, exploring the possible capabilities of each other
trying to see how best to transmit the data.  This in itself adds a lot a
variability to the length of the initial set of negotiations. Secondly, the FAX
devices can dynamically change the rate of data transmission depending upon the
quality of the phone line (as determined by the frequency of detected
transmission errors).  So, the first observation means that any estimate I will
make will be too low (as much as 30 seconds per page). The second observation
also indicates that my estimates will be low, but in this case may be off by a
non-minor multiplicative factor.  (The FAX modem will never increase the speed,
only decrease it.)


So, below is a description on how I estimate the call duration.  This
description takes the form of explaining a sample log entry.  (Read: "I
doctored a response I sent someone else so as to answer your question".)

> 14-JUL-1992 07:04:25 g3_to_fax    070135070304 S 2 HAL9000@ACME.COM
>   4551656 DI-070301 TS-070301 CO-070301 PS-070324 PS-070424 NT-070424
>   RD-070424

Here's a sample entry from one of the log files.  Let's dissect it:

(1) 14-JUL-1992 07:04:25 -- This is the time at which the log entry was made

(2) g3_to_fax  -- Name of the PMDF channel making the log entry

(3) 070135070304 -- Estimated start and end times for the FAX transmission:
                      Estimated start time was 07:01:35
                      Estimated end time was   07:03:04
                      ---------------------------------
                      Estimated elapsed time       2:31

    The estimated start time is the time at which we send the "DIAL this phone
    number" command to the FAX modem and then begin sending the actual FAX image
    data.  Now, the modem doesn't actually place the phone call for about 6 - 10
    seconds after this time.  Then, there's another delay while we wait for the
    remote FAX machine to answer the call.

    The estimated end time is when we stop sending data to the modem.  The
    modem, however, will still be transmitting data over the phone line for
    some unknown length of time

(4) S -- Call was successful.

(5) 2 -- 2 pages sent

(6) HAL9000@ACME.CMD -- Person sending the FAX

(7) 4551656 -- Destination FAX telephone number

(8) DI-070301 -- PMDF-FAX received the "dial" response from the FAX modem
    at the time 07:03:01.

    TS-070301 -- PMDF-FAX received the TSI data from the remote FAX machine
    at 07:03:01.

    CO-070301 -- PMDF-FAX received the "Connected" response from the FAX
    modem at 07:03:01.

    Now, note that these responses were all received at the same time by
    PMDF-FAX.  This is because the FAX modem batches up these things before
    sending them to the host.  These were most likely sent after the cover
    page was transmitted.  So, from this about all we can tell is that we
    started sending data to the modem at 07:01:35 [item (3)] and at 07:03:01
    the first page had finished transmitting.

(9) PS-070324 -- At 07:03:24, PMDF-FAX received an acknowledgment that the
    first page was sent successfully.

    PS-070424 -- At 07:04:24, PMDF-FAX received an acknowledgment that the
    second page was sent successfully.

    NT-070424 -- PMDF-FAX received from the FAX modem a "Call termination"
    response at 07:04:24.

    RD-070424 -- PMDF-FAX received from the FAX modem a "Ready" response at
    07:04:24.


Now, from the DI-070301 [(8)] and NT-070424 [(9)] we could estimate the call to
have had a duration of 1:24.  The estimate from (3), which is what was reported
in the status report mailed back to the sender, was 2:31.  Which estimate is
correct?  Hard too say.  The estimated from (8) and (9) is usually too small as
these responses are batched up by the modem and not sent at the time the event
they report occurred.  However, is what I've found to be the best estimate.
It's sometimes too low, sometimes too high, and never exact to within the
second.

Dan