home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / amiga / datacomm / 7750 < prev    next >
Encoding:
Text File  |  1992-11-17  |  10.7 KB  |  303 lines

  1. Newsgroups: comp.sys.amiga.datacomm
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!ICIL64.CILEA.IT!LABENRSA
  3. From: labenrsa@ICIL64.CILEA.IT
  4. Subject: amiga netwrk stdrd api
  5. Nntp-Posting-Host: icil64.cilea.it
  6. Sender: news-mail@ghost.dsi.unimi.it (News mail user)
  7. Organization: CILEA - v R. Sanzio 4 - Segrate - ITALY
  8. Date: Wed, 18 Nov 1992 11:21:17 GMT
  9. Message-ID: <1992Nov18.112117.9143@ghost.dsi.unimi.it>
  10. Reply-To: labenrsa@ICIL64.CILEA.IT
  11. Lines: 290
  12.  
  13.  
  14.  
  15. Amiga networking software is starting to bloom. Sadly, there seems to be
  16. very little concern about the _integration_ of networking software in
  17. the Amiga OS environment. So far, SANA has only addressed API standardization
  18. at the data link layer (or whatever they call it in SANA), and even that
  19. specification is not being followed by most networking software.
  20.  
  21. To provide both user and application programmer with a consistent
  22. networking environment, we need more than just raw ports of lots of net
  23. stacks.
  24.  
  25. Let me picture what I mean by getting a bit more technical.
  26.  
  27.  
  28. Case 1 : Network-Aware Applications and APIs
  29. ============================================
  30.  
  31. Network-aware applications use some network API directly. Two well-known
  32. examples are internet clients that use the BSD/SunOS sockets API with
  33. TCP/IP protocols and Novell NetWare clients.
  34.  
  35. In all cases where existing network stacks have been ported to the Amiga
  36. (e.g. see the socket.library), their APIs have been reproduced, with the
  37. goal to minimize the effort of porting existing software from other OSs.
  38.  
  39. Like it or not, all existing network APIs are designed to work well with the
  40. OS they were born in. Porting them over to another system often results in
  41. poor integration with the new environment, incompatibilities with the original
  42. implementation and resorting to gory hacks to get things working.
  43.  
  44. For example, BSD sockets fit in very well in BSD/SunOS systems or lookalikes
  45. *because they're designed as part of that system*. They simply clash with
  46. the Amiga programming model (signal/message IO vs. file descr. IO + fork()).
  47. When implementing socket applications on the Amiga, you may have to change
  48. quite a lot here and there. In the end, it's still some work and you'll end
  49. up with some pretty nasty code (compared to 'good' Amiga code).
  50.  
  51. Seriously, the only applications that really benefit from an
  52. 'as-close-to-bsd-as-possible' approach are the standard internet servers and
  53. their related console-oriented clients, which altogether stink when compared
  54. to standard Amiga applications. Any serious Amiga TCP/IP package will want
  55. to have them reworked from the ground up.
  56.  
  57. So, why not go for an All-Amiga networking API?
  58.  
  59. Please note that changing the API has nothing to do with the protocol you
  60. are using. You should be able to use TCP/IP, or any other transport, from
  61. a standard (well designed) Amiga network API.
  62.  
  63. Also note that it wouldn't be TOO hard to recode a socket (or other API)
  64. application for a standard Amiga API. In fact the Amiga API would more or
  65. less provide the same sort of services (connect/disconnect/accept/send/receive)
  66. only through a *cleaner* interface.
  67.  
  68. Imagine an implementation layered like this:
  69.  
  70.           ------------------------------------------
  71.           |                Applications            |
  72.           ------------------------------------------
  73.  
  74. -----------             -------------------
  75. DOS, Exec,|. ...........| network.library |                Standard API
  76. -----------             -------------------
  77.                -----------   ----------   ----------
  78.                | Internet|   | Decnet |   | Novell |       Protocol stacks
  79.                -----------   ----------   ----------
  80.  
  81.              -----------   ----------   ---------------- 
  82.              | Ethernet|   |  SLIP  |   | Exec MsgPort |  SANA-2 dev drivers
  83.              -----------   ----------   ----------------
  84.  
  85. Expected benefits :
  86.  
  87. 1 - All applications that go through the network.library would be able
  88.     to operate over any protocol stack.
  89.  
  90. 2 - Let users configure their networking setup easily and even
  91.     *choose* what transport to use for some services.
  92.  
  93. 3 - Multiple protocol stacks would be able to operate on the same
  94.     interface (already a goal of SANA).
  95.  
  96. 4 - Maximize robustness and efficiency of Amiga-specific software in
  97.     a networking environment.
  98.  
  99.  
  100. Expected problems:
  101.  
  102. 1 - Flame wars concerning the API calls (aw, come on... ;> )
  103.  
  104. 2 - How do we provide a clean interface to protocol-specific services
  105.     and options? (For options, taglists may work.)
  106.  
  107. 3 - Efficiency: net sw is heavy, and having one more implementation layer
  108.     isn't going to help.
  109.  
  110.  
  111. Now let me picture how a sample Amiga network application should work. This
  112. is NOT an API design (yet), but should clarify what I have in mind. No
  113. flames, please. Comments are welcome.
  114.  
  115.  
  116. /*
  117.  * Sample Amiga networking application. -- connectionless client.
  118.  *
  119.  * use HYPOTHETICAL (how do you spell it?) network.library
  120.  * PSEUDO-C PSEUDO CODE : all checks removed
  121.  */
  122.  
  123. #include <sana.h>
  124. #include <libraries/network.h>
  125.  
  126. void main (int argc, char *argv[])
  127.     NetProtocolSpec   default_prot = {"netbios", 0,0}; /*...or whatever */
  128.     NetProtocolSpec   *pr_list, *pr_chosen;
  129.  
  130.     NetProtocol       *pr;
  131.  
  132.     NetObject         *nobj;
  133.     NetAddress        *target_addr;
  134.  
  135.     TEXT              target_name = argv[1];
  136.     TEXT              message     = argv[2];
  137.  
  138.  
  139.     NetBase = OpenLibrary ("network.library", 0);
  140.  
  141.  
  142.     /* open user interface, etc.... */
  143.  
  144.  
  145.     if (prompt_user_for_transport)
  146.     {
  147.         pr_list = LockProtocolList();
  148.  
  149.         pr_chosen = request_protocol (mywindow, "Choose Transport", pr_list);
  150.  
  151.         pr = OpenProtocol (pr_chosen);
  152.  
  153.         UnlockProtocolList (pr_list);
  154.     }
  155.  
  156.     else
  157.     {
  158.         pr = OpenProtocol (&default_prot);
  159.     }
  160.  
  161.  
  162.     /* open a communication endpoint (equivalent to a socket) */
  163.     nobj = NewNetObject (pr, NTAG_OBJ_FLAGS,      my_netobj_flags,
  164.                              NTAG_PROTOCOL_FLAGS, my_protocol_flags,
  165.                              .......................................
  166.                              TAG_DONE ); 
  167.  
  168.     /* find out whom we wanna talk to */
  169.     target_addr = NetResolve (pr, target, NTAG_RESOLVE_OPTS, ...., TAG_DONE);
  170.  
  171.  
  172.     /* post message to target */
  173.     NetSend (nobj, target_addr, message, strlen(message) );
  174.  
  175.     /* handle post and user interface Amiga-style */
  176.     net_sigmask = NetObjectSignal (nobj);
  177.  
  178.     mask = window_sigmask | timer_sigmask | 
  179.  
  180.     for (;;)
  181.     {
  182.         sig_received = Wait (mask);
  183.     
  184.         if (sig_received & net_sigmask)
  185.             size_read = NetRead (nobj, reply_buf, bufsize);
  186.         
  187.         else if (sig_received & timer_sigmask)
  188.             break;
  189.  
  190.         /* etc... */
  191.     }
  192.  
  193.     /* make sure we don't have any pending net I/O */
  194.     NetWaitIO (nobj);
  195.  
  196.     /* clean up */
  197.     DisposeNetObject (nobj);
  198.     CloseProtocol (pr);
  199.  
  200.     CloseLibrary (NetBase);
  201. }
  202.  
  203. A connection-oriented application would need different calls, and so would
  204. the clients. It is pointless to try to sketch them here. Basically, get
  205. the flavor of this sample and apply it to the different communication models.
  206.  
  207. The main points I want to get through are : 
  208.   1) I want to access multiple protocol stacks through the same API
  209.   2) I want the API to be *designed for the Amiga OS*, specifically
  210.      supporting synchronous and asynchronous I/O, signals & c....
  211.  
  212. ISSUES :
  213.  
  214. The example above is a complete mess, since it mixes several
  215. Amiga programming approaches. Several options are indeed available :
  216.  
  217. - Should the  network.library actually be complemented by a network.device
  218.   so that we can do I/O via Exec calls : SendIO/DoIO, etc.... ?
  219.   (this is the sort of approach used by VMS/DECNET at the nontransparent
  220.    level. I may be wrong but maybe DNET does something like this...)
  221.  
  222. - Should the network.library actually have a network.handler, so that
  223.   we can do straight AmigaDOS I/O (both packet and file-oriented) ?
  224.   This option somewhat overlays the case of 'transparent' network
  225.   communication, discussed below.
  226.  
  227. - Make it just a no-fuss library which resembles either but is none of
  228.   them (as I sort-of did in the example)?
  229.  
  230.  
  231.  
  232. Case 2 : Network-Transparent Applications
  233. ==========================================
  234.  
  235. Another big issue is the need to have standard AmigaDOS applications
  236. operate over a network transparently, without calling a networking API.
  237.  
  238. It seems that the current approach taken by most Amiga networking software
  239. works like "mount the remote file/device, then use it as if it were a
  240. local filesystem". This scheme, notably used by NFS and most MS-DOS
  241. networks, is fine for many applications, but not for all.
  242.  
  243. If the network gets very large and a lot of services are available which
  244. you will not use on a regular basis, you definitely do _not_ want to
  245. have them all mounted at all times, or to have to mount and dismount them
  246. explicitely on occasion.
  247.  
  248. For instance, suppose you have a large LAN, where a single server hosts
  249. most of the application software. You install a new release on the server
  250. and that's fine. But then you have to install a license or just a 100 byte
  251. preference file in _every client_ node. Would you want to mount them all
  252. on the server, or walk to every machine with a disk, or just sit at the
  253. server and type something like:
  254.  
  255.    -- scheme 1
  256.  
  257.    COPY mydatabase.prefs vulcan"sysadm password"::sys:preferences
  258.    COPY mydatabase.prefs juno"sysadm password"::sys:preferences
  259.    .... etc ....
  260.  
  261. Many other examples could be provided where a remote mount is unsuitable.
  262. (I know *you* would use rcp or ftp, but, once again, let me point out
  263.  I'm talking about NATIVE, non-network aware AmigaDOS sw...).
  264.  
  265. What I'm suggesting is that there should be a _standard_ syntax to reference
  266. remote file systems in a normal AmigaDOS path _without_ needing to mount
  267. them.
  268.  
  269. This access method _does not replace_ remote mounts, but rather _complements_
  270. them where they are not suitable.
  271.  
  272. Scheme 1 shows just one the many possible extended pathname syntaxes. This
  273. one is patterned after DECNET usage, and is probably very poorly chosen.
  274. If a pathname syntax extension is used, the AmigaDOS library should have
  275. the DeviceProc() (and maybe others) call patched to detect a remote
  276. filesystem specification in the path name and go through a special
  277. dos handler.
  278.  
  279. Naturally, it would be best if we could maintain the current AmigaDOS
  280. syntax and use something like this:
  281.  
  282.    -- scheme 2
  283.    COPY mydatabase.prefs "NET_DEV:node/volume/path/account=xxx/passwd=yyy"
  284.  
  285. ISSUES:
  286.  
  287.  -  Can scheme 2 be made to work with all transport protocols and
  288.     remote operating systems (which may be unix/vms/dos/....) file
  289.     specification?
  290.  
  291.  -  In case we must resort to a pathname syntax extension, which syntax
  292.     is less likely to break pathname parsers in existing software?
  293.  
  294.  
  295.                               ---- o ----
  296.  
  297.  
  298.                          Tnx for your attention
  299.  
  300. ---------------
  301. Andy Zanna                           e-mail:   SDEVAX::ZANNA@icil64.cilea.it
  302.