home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0.bin / doc / HOWTO / mini / LBX < prev    next >
Text File  |  1995-10-29  |  14KB  |  356 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.       unpredictable results.
  205.  
  206.       The best way to avoid it is to get XFree86 3.1.2, where I think
  207.       the problem is resolved.
  208.  
  209.       Another simple way to avoid it is ensure that you always start the
  210.       lbxproxy on REMOTE before almost any other X apps are started on
  211.       LOCAL.
  212.  
  213.  
  214.   Q2) lbxproxy exits with a "access denied" error.
  215.  
  216.    A) Make sure you remembered to use "xhost +REMOTE" on the LOCAL
  217.       system to give access permissions to REMOTE.
  218.  
  219.       Try running a normal X app like xclock and have it display on the
  220.       local system:
  221.  
  222.         $ xclock -display LOCAL:0
  223.  
  224.       If that doesn't work, it's xhost or some other basic X problem,
  225.       not LBX.  If that does work, try re-running lbxproxy with access
  226.       permissions turned off:
  227.  
  228.         $ lbxproxy -display LOCAL:0 :1 -ac &
  229.  
  230.  
  231.   Q3) LBX runs for a while, but my X server crashes/lbxproxy crashes/my
  232.       apps exit abnormally (esp. with some apps)
  233.  
  234.    A) Yeah, well, LBX is a work-in-progress! :) :-/
  235.  
  236.       By this I don't mean that your apps will necessarily crash, but I
  237.       have no doubt that your environment with LBX will be less stable
  238.       then without it.  The more advanced your X apps are, the more
  239.       likely they are to upset LBX.
  240.  
  241.       As I mentioned before, everyone will have to make his/her own
  242.       judgment as to whether LBX is worth running at this early stage.
  243.       If not, you have something to look forward to! :)
  244.  
  245.  
  246.   10. LBX README
  247.  
  248.   Here I enclose some excerpts from the LBX README file, which is the
  249.   only documentation on using LBX distributed with X11R6 up to p12.  I'm
  250.   sure this is Copyright by the X Consortium; hopefully they won't mind
  251.   me quoting it here.  This is mostly FYI, but might be interesting.
  252.  
  253. ----- X11R6/xc/workInProgress/lbx/README --------------------------------------
  254. $XConsortium: README,v 1.2 95/01/06 19:12:51 gildea Exp $
  255.  
  256.                 Low Bandwidth X
  257.                      (LBX)
  258.  
  259. This tree contains a snapshot of the code for Low Bandwidth X, the effort to
  260. develop a standard for running X applications over serial lines, wide-area
  261. networks, and other low-bandwidth, high-latency transports.  While many of
  262. the major pieces of the eventual standard are represented here, LBX is *not*
  263. done yet; this code should be treated as an "alpha" or "prototype" for people
  264. who are interested in seeing the overall form that LBX is expected to take.
  265.  
  266.              ******************************************************
  267.              *                                                    *
  268.              *                      WARNING                       *
  269.              *                                                    *
  270.              *    This version of LBX is *NOT* a standard of      *
  271.              *    the X Consortium and will *NOT* be compatible   *
  272.              *    with the final version.                         *
  273.              *                                                    *
  274.              ******************************************************
  275.  
  276. The goal of LBX is to improve the startup time, performance, and interactive
  277. feel of X applications run over low bandwidth transports.  LBX does this by
  278. interposing a "pseudo-server" (called the "proxy") between the X clients and
  279. the X server.  The proxy caches data flowing between the server and the
  280. clients, merges the X protocol streams, and compresses the data that is sent
  281. over the low bandwidth wire.  The X server at the other end uncompresses the
  282. data and splits it back out into separate request streams.  The target is to
  283. transparently make many X applications usable over 9600 baud modems.
  284.  
  285. This code snapshot contains the following features:
  286.  
  287.     o    LZW compression of the binary data stream.  Since commercial use
  288.     of LZW requires licensing patented technology, we are also looking
  289.     for an unencumbered algorithm and implementation to provide as well.
  290.  
  291.     o    Delta compression of X packets (representing packets as "diffs"
  292.     against previously sent packets).
  293.  
  294.     o    Re-encoding of some graphics requests (points, lines, segments,
  295.     rectangles, and arcs).
  296.  
  297.     o    Motion event throttling (to keep from flooding the wire).
  298.  
  299.     o    Caching of data in the proxy for large data objects that otherwise
  300.     would be transmitted over the wire multiple times (e.g. properties,
  301.     font metrics, keyboard mappings, connection startup data, etc.).
  302.  
  303.     o    Short-circuiting of requests for constant data (e.g. atoms,
  304.     colorname/rgb mappings, and read-only color cells).
  305.  
  306. However, the following items have yet to be implemented (which is why it
  307. isn't a standard yet...):
  308.  
  309.     o    Re-encoding of a number of requests (e.g. QueryFont), events, etc.
  310.  
  311.     o    Support for BIG-REQUESTS extension.
  312.  
  313.     o    A non-networked serial protocol for environments which cannot
  314.     support os-level networking over serial lines.
  315.  
  316.     o    A full specification needs to be written describing the network
  317.     protocol used between the proxy and the server.
  318.  
  319. The LBX team is continuing to work on both the implementation of the remaining
  320. items and the full specification.  The goal is to have all of the pieces ready
  321. for final review by the public later this year.  Since the specification for
  322. LBX *will* change, vendors are discouraged from building products based on
  323. this prototype.
  324.  
  325. However, everyone is strongly encouraged to work with the code, examine the
  326. concepts, comments on alternatives, and volunteer to help finish it up!
  327.  
  328.                 Dave Lemke <lemke@ncd.com>
  329.                 Dale Tonogai <dct@ncd.com>
  330.                 Keith Packard <keithp@ncd.com>
  331.                 Jim Fulton <jim@ncd.com>
  332.                 Chris Kanterjiev <cak@parc.xerox.com>
  333.  
  334.  [...]
  335.  
  336.                      Usage
  337.  
  338. Start the X server as usual, and then start the proxy.  The lbxproxy
  339. is a pseudo-server, so any clients that wish to use it need to adjust
  340. their DISPLAY.  By default, the proxy will listen on hostname:1.
  341. This can be changed by using the ':portnum' argument.
  342.  
  343. Example:
  344.  
  345. If the proxy is to be running on a host named "sharedhost", connecting
  346. to an LBX-capable X server on a desktop machine named "mydesktop", you
  347. could use the following command to start the proxy (which would be
  348. known as display "sharedhost:7"):
  349.  
  350.     mydesktop%  rlogin sharedhost
  351.     sharedhost%  lbxproxy -display mydesktop:0 :7 &
  352.     sharedhost%  xclient -display sharedhost:7
  353.  
  354.  [...]
  355. -------------------------------------------------------------------------------
  356.