home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LINUX / HOWTO / mini / lbx.txt < prev    next >
Text File  |  1997-07-07  |  14KB  |  357 lines

  1.   The LBX Mini-HOWTO
  2.   Paul D. Smith <psmith@BayNetworks.com>
  3.   v1.01, 23 Oct 1995
  4.  
  5.   This document describes how to use Low-Bandwidth X (LBX): an
  6.   extension to the X distribution which provides better service for
  7.   running X applications over serial lines, wide-area networks, and
  8.   other low-bandwidth, high-latency transports.
  9.  
  10.  
  11.   1.  Introduction
  12.  
  13.   Low-Bandwidth X (LBX) attempts to recognize that in this day and age,
  14.   not everyone will be a fast LAN hop or two away from the system that
  15.   they are running their applications on.
  16.  
  17.   The X protocol can generate an extraordinary amount of traffic,
  18.   especially for simple-seeming things such as creating new windows.  As
  19.   anyone who has tried to use X over a dial-in modem at 14.4 or even
  20.   28.8 can attest, creating new X windows can involve an excruciating
  21.   wait.
  22.  
  23.   LBX is fundamentally a compression and caching scheme designed to
  24.   minimize the amount of X traffic generated between two systems.
  25.  
  26.  
  27.   2.  What's The Status Of LBX?
  28.  
  29.   Currently the X Consortium is distributing an LBX snapshot with the
  30.   X11R6 distribution as a "Work In Progress".  That means that it
  31.   probably has bugs, may not be extremely stable, and won't be
  32.   compatible with the final version of LBX.
  33.  
  34.   Fortunately, there are *no* code changes needed to X clients to use
  35.   LBX, so, unless you are trying to write applications which somehow
  36.   explicitly interact with the LBX library, you don't have to worry
  37.   about the fact that the interface will change.
  38.  
  39.   The instability of LBX is another matter; it is indeed not extremely
  40.   solid.  You will have to judge for yourself whether the speed-up you
  41.   gain by using it is worth the instability it introduces.
  42.  
  43.   Patches to LBX are being distributed with patches to X11R6, and
  44.   nowhere else (that I'm aware of).  If you want to use LBX you should
  45.   be sure to get the latest version of X11R6 (for Linux users that's
  46.   currently XFree86 3.1.2).
  47.  
  48.  
  49.   3.  Who Can Benefit From LBX?
  50.  
  51.   If you use a modem to dial into a service provider, then run X
  52.   applications on remote machines with their DISPLAYs set to your local
  53.   machine (or vice versa), LBX will speed up that connection.  Also if
  54.   you set DISPLAYs from systems across WANs (other countries, for
  55.   example) or other slow links, LBX can help.
  56.  
  57.  
  58.   4.  Who Doesn't Need LBX?
  59.  
  60.   LBX is useless, of course, if you're only running applications
  61.   locally, or if you're not running X at all :).
  62.  
  63.   Also, if you're running on a fast LAN LBX won't be much help.  Some
  64.   people say "if LBX cuts down on network traffic, wouldn't it be good
  65.   to use even on fast LANs?"  It might be, if your goal is to reduce
  66.   network traffic.  But if your goal is to get better response time LBX
  67.   probably isn't what you want.  Although it does introduce caching and
  68.   compression, that comes at a cost on both ends (extra memory for
  69.   caching, and extra CPU for decompression).  If your link is fairly
  70.   speedy LBX will probably result in an overall slowdown.
  71.  
  72.  
  73.   5.  How Does LBX Work?
  74.  
  75.   LBX works by introducing a "proxy server" at the client side, which
  76.   performs caching and compression.  The X server knows that the client
  77.   is using a proxy server, and decompresses accordingly.
  78.  
  79.   Here's a "normal" setup for remote X clients.  In our discussion,
  80.   LOCAL is always the workstation sitting in front of you, whose monitor
  81.   you're looking at, and REMOTE is the remote workstation, where the
  82.   actual application is running.
  83.  
  84.        REMOTE                               LOCAL
  85.    +-----+                                             +-----+
  86.    | APP |-\          Network            +----------+  |     |\
  87.    +-----+  \--------------------------->| X SERVER |=>|     ||
  88.    +-----+  /       (X Protocol)         +----------+  +-----+\
  89.    | APP |-/                                          /_____//
  90.    +-----+
  91.  
  92.  
  93.   When using LBX, a proxy server (lbxproxy) is introduced on the remote
  94.   side, and the applications talk to that process instead of directly to
  95.   the LOCAL server.  That process then performs the caching and
  96.   compression of X requests and forwards them.  It looks like this:
  97.  
  98.        REMOTE                                         LOCAL
  99.                                                                  +-----+
  100.    +-----+  +-------+           Network            +----------+  |     |\
  101.    | APP |->| PROXY |----------------------------->| X SERVER |=>|     ||
  102.    +-----+  +-------+       (LBX/X Protocol)       +----------+  +-----+\
  103.    +-----+   /                                                  /_____//
  104.    | APP |--/
  105.    +-----+
  106.  
  107.   Details on exactly what caching and compression LBX does is beyond the
  108.   scope of this document (and probably would be quickly out-of-date
  109.   anyway :).
  110.  
  111.  
  112.   6.  What Do I Need To Use LBX?
  113.  
  114.   You need an X server on your LOCAL system which has the LBX extension
  115.   compiled in.  For Linux systems, XFree86 3.1.2 servers do not come
  116.   with LBX linked in.  You will need to get the XFree86 Link Kit from
  117.   your friendly neighborhood XFree86 or Linux FTP site and relink your
  118.   server (this is quick and easy and doesn't take up too much room,
  119.   unlike rebuilding X from scratch).
  120.  
  121.   You can use the xdpyinfo command to see if your server has the LBX
  122.   extension: run xdpyinfo and look at the list just under "number of
  123.   extensions"; you should see LBX listed there.
  124.  
  125.   Next, you need to get an lbxproxy program compiled for the REMOTE
  126.   system.  This is the tricky part.  There is unfortunately no "broken
  127.   out" distribution of lbxproxy, so you will have to either (a) get and
  128.   build most of the standard X11R6 and workInProgress hierarchies, or
  129.   (b) find someplace to get a pre-compiled lbxproxy binary for your
  130.   system.  The latter is much preferred of course :)
  131.  
  132.   The lbxproxy is a single executable.  There are no configuration
  133.   files, resource files, etc. associated with it.
  134.  
  135.  
  136.   7.  What Don't I Need To Use LBX?
  137.  
  138.   The REMOTE system *does not* need a new X server (as always, the
  139.   REMOTE system doesn't even need *any* X server running).  Also, the
  140.   application you want to run *does not* need to be linked with any
  141.   special version of X11, or any special libraries; I regularly use
  142.   commercial X11R5 apps over LBX with no trouble.
  143.  
  144.   You *do not* need root or other privileged access on the REMOTE
  145.   system; the lbxproxy process runs under your normal access
  146.   permissions.  Further, you can run it right from your home directory:
  147.   it does not have to be installed anywhere.
  148.  
  149.  
  150.   8.  How Do I Start LBX?
  151.  
  152.   OK, here it is... after all that it's actually quite simple.  Replace
  153.   LOCAL and REMOTE below with the hostnames of your local workstation
  154.   and remote system, respectively (don't get them mixed up! :)
  155.  
  156.   On LOCAL:
  157.  
  158.    1. Start your X server.
  159.  
  160.    2. Use "xhost +REMOTE" to give the remote system access to your X
  161.       display, if necessary.
  162.  
  163.   On REMOTE:
  164.  
  165.    1. Start lbxproxy and tell it to forward to the LOCAL X server, like
  166.       this:
  167.  
  168.         $ lbxproxy -display LOCAL:0 :1 &
  169.  
  170.       (this tells lbxproxy to use display :1; if you have >1 display
  171.       already you can use :2 or whatever instead).  You also probably
  172.       want to redirect stdout and stderr; depending on how your lbxproxy
  173.       was compiled it might generate some debugging output.
  174.  
  175.    2. Set your DISPLAY environment variable to point to lbxproxy:
  176.  
  177.         $ DISPLAY=:1
  178.         $ export DISPLAY
  179.  
  180.       Or, if you use csh or clones:
  181.  
  182.         % setenv DISPLAY :1
  183.  
  184.    3. Start your X applications!
  185.  
  186.   That's it; all X apps that are started up pointing to :1 will use LBX.
  187.   Note in theory there's no reason you couldn't also start X apps
  188.   pointing to LOCAL:0 and have both running at the same time, but in
  189.   practice I've found LBX to be unstable in that configuration
  190.   [[although testing on this was done with XFree86 3.1.1]].  All or
  191.   nothing is safest.
  192.  
  193.  
  194.   9.  Problems.
  195.  
  196.   Here're some common problems:
  197.  
  198.   Q1) I tried the above, but nothing happens/X server crashes/app
  199.       crashes/lbxproxy crashes...
  200.  
  201.    A) There's a bug in LBX released with X11R6 p11 (XFree86 3.1.1) where
  202.       lbxproxy must be one of the first 7 or 8 clients to attach to your
  203.       X server, or LBX will corrupt memory in your server causing
  204.