This is g3net, an utility to send arbitrary files as attachments
to a fax. This is extremely useful to exchange data with people
which are only able to send/receive faxes with a faxmodem, and
cannot set up a proper data connection (uucp, kermit, slip/ppp,
etc.).

Since most people would wonder "Why should I use such a thing!",
the section ``MOTIVATION'' will explain why. Please take off your
"computer guru" hat when reading that.

================ USE =============================================

g3net has two operating modes:

* in ENCODING mode, it takes a set of input files and encodes them
  producing a TIFF-G3 file. Such a file can be easily handled by
  any (well, most) fax-handling packages and transmitted to the
  remote end as if it were a plain fax. No special software is
  required to send/receive this file.

* in DECODING mode, it takes a received fax document (usually
  containing G3 data) and decodes it. If the ``fax'' was produced
  by g3net, the files which are part of the archive are extracted.

Note that the ``fax'' includes a lot of redundancy, so that even
if up to 30% of fax lines are lost/corrupted, it is possible to
reconstruct the original document.

Transferring files with g3net is extremely simple:

1) the sender encodes files with g3net, producing a TIFF file
2) the TIFF file is transmitted as a fax, using a standard fax-handling
   software.
3) the TIFF file is received as a fax, using a standard fax-handling
   software.
4) the received fax is decoded using g3net in decode mode. Since this
   is the default operating mode, under Windows it suffices to
   drag the received document over g3net to extract the attachments.


================ MOTIVATION ======================================

Q: Why should one use this complex encoding, when there are
   better ways to transfer data across two modems, i.e.:
   - run UUCP
   - run PPP/SLIP
   - use some package like kermit, rzsz or the like.

A: Consider the typical uses of a fax:

  1. sending a facsimile of an existing paper document;
  2. send a short note (an order for a product, or a message, etc.)
  3. send a relatively long document (e.g. some product information,
     or a listing, or an article);
  4. exchange a document (e.g. a form to be filled in with proper
     data, or a document which is being edited/revised by different
     people);

A paper FAX is very well suited to situation 1. However, cases 2..4
probably account for the vast majority of faxes exchanged nowadays.
In all these cases, the receiver would greatly benefit from having
the document sent in some easy-to-process form, e.g. a file containing
the desired data. This is what modems and data network have been
designed for, you would say ...

Unfortunately, most people who own a faxmodem, and use it for cases
2..4, cannot set up a proper data interconnection.  They happily
run their faxmodems connected to a Windows/Macintosh box with the
fax-handling package which comes with the modem. To them, UUCP,
PPP, RZSZ are just obscure names.

The usefulness of an easy-to-use data-exchanging utility is so
strong that several producers try to support it. First of all, the
G3 standard includes a ``Binary File Transfer'' capability. None
of the Class2 faxmodem that I have tried support this option (maybe
they do in Class1 mode, this I don't know).

Some FAX-handling packages (e.g. WinFax PRO, Microsoft FAX in Win95)
claim to support transfer of binary files using Class1 modems and
probably use a proprietary standard to interpret information.

Requiring special capabilities for the hardware (or driving it in
a special way) and using proprietary protocols is the best way to:

    a) push the market to use your product, or
    b) make a feature totally useless

At least now, b) seems to be true for data transfers across faxmodems,
although big software companies are known to be able to drive the
market wherever they want.

g3net tries to overcome these limitations in two ways:

1) allows data transfer without requiring special capabilities for the
   sender/receiver. A plain fax modem will suffice (actually, files
   encoded with g3net will be received happily by your paper fax,
   although you'll have a hard time in using them other than for a
   nice background);
2) uses a non-proprietary data format (in the sense that full
   sources of the decoder/encoder are freely available), making it
   possible to exchange files between different architectures. As
   a side effect, this feature also makes data forwarding possible.

Error correction is an important feature of g3net. Transfers across
faxmodems are subject to errors due to noisy lines, or slow receiving
programs which cannot handle incoming data properly, and it is generally
time-consuming to request the retransmission of missing data. Hence,
files encoded with g3net include enough redundant information
(through the use of (192,255) Reed-Solomon codes and various forms
of interleaving) to be able to reconstruct the original document
even if 30% of fax lines are not received (or some of them are
received incorrectly).

================ APPLICATIONS ===================================

There are several applications for g3net:

  CUTTING PHONE BILL COSTS

    Typically fax messages include mostly textual information.
    The ``rendered'' version of these messages have a size of
    30..100KB per page, whereas the corresponding ASCII (or RTF,
    or DOC... ) files are 1-2KB at most. Hence, transmission times
    can be cut by 15..40 sec/page, with corresponding savings,
    especially on long distance calls and long documents.

  SENDING REUSABLE DATA

    Data sent with g3net can be easily reused at the receiver, since
    they are in binary format. This is extremely useful for people
    willing to exchange documents without having to set up some kind
    of ``networking''

  DATA PROTECTION

    Since g3net enables users to transfer arbitrary files, sensitive
    data can be sent as encrypted files, with the decryption key
    transferred separately. E.g. you can send reserved info to
    somebody's fax server without worrying that indiscrete eyes can
    watch at them, only the authorized people can read the
    information.

  DEVELOPING NEW APPLICATIONS

    The ability to transfer binary files in a transparent way enables
    a number of new applications. We mention only a few of them:

    + COLOR FAX (transfer images encoded with g3net; a JPEG image is
      not much bigger than a comparable-size fax page, and can be
      transferred easily);

    + DATA OVER FAX (use g3net and a fax connection as a transport for
      email for places which cannot setup a proper UUCP connection);

    + DATA ON DEMAND (include g3net-encoded files, e.g. drivers,
      pictures, among those server by a fax-on-demand system; this is
      trivial and does not require any change whatsoever to the
      existing setup);

    + DATA COLLECTION (a factory, store, or other site can receive
      reports from remote sites using the same line used for incoming
      faxes);


Sources compile fine with gcc (djgpp under DOS), and are written
to be as platform-independant as possible.  It is likely that it
can even compile on Apple systems.

=============== ACKNOWLEDGEMENTS ================================

This program could not have been written without the availability
of a Reed-Solomon implementation ("rs.c") by Phil Karn, Robert
Morelos-Zaragoza (robert@spectra.eng.hawaii.edu) and Hari Thirumoorthy
(harit@spectra.eng.hawaii.edu).  The file "tiff.h" and some details
on the structure of TIFF files come from the "libtiff" package by
Sam Leffler. The "getopt" implementation comes from the BSD sources.
Finally, this program can compile easily under MSDOS thank to the
DJGPP compiler (a port of GNU's gcc to MSDOS) by D.J. Delorie. The
proper Copyright messages appear in each file which has not been
written originally by me.

For this package as a whole, the Copyright conditions are specified in
"g3net.c". It is basically a BSD-style copyright.

	Luigi Rizzo (luigi@iet.unipi.it)
====================================================================
Luigi Rizzo                     Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it       Universita' di Pisa
tel: +39-50-568533              via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522              http://www.iet.unipi.it/~luigi/
====================================================================
