home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / protocol / misc / 649 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  3.7 KB

  1. Path: sparky!uunet!sun-barr!news2me.ebay.sun.com!exodus.Eng.Sun.COM!pepper.Eng.Sun.COM!cmcmanis
  2. From: cmcmanis@pepper.Eng.Sun.COM (Chuck McManis)
  3. Newsgroups: comp.protocols.misc
  4. Subject: Re: compare socket based and RPC based...
  5. Date: 4 Sep 1992 08:20:07 GMT
  6. Organization: Sun Microsystems, Mt. View, Ca.
  7. Lines: 63
  8. Message-ID: <lae71nINNbfd@exodus.Eng.Sun.COM>
  9. References: <1992Aug24.192322.49539@ccvax.ucd.ie>
  10. NNTP-Posting-Host: pepper
  11.  
  12. In article <1992Aug24.192322.49539@ccvax.ucd.ie> bharat@ccvax.ucd.ie writes:
  13. >Hi Net Gurus,
  14. >could any one tell me the advantages of "Socket Based interprocess
  15. >communication" over "Remote Procedure Call based interprocess communication"?
  16.  
  17. General question, deserves a general answer. The short answer is that
  18. they are the same thing, only the specification of the protocol is
  19. different. Andrew Birrell et al in a paper in the Feb '84 ACM Transactions
  20. on Computing Systems noted that by using a request/response protocol
  21. and a procedure call model you could accomplish a lot of useful work
  22. over a network. As you know a procedure call, as compiled by a high
  23. level language, generally has a prologue which places parameters to
  24. be used by the procedure into some common area, then transfers control
  25. to the procedure, then fetches the results of the common area and
  26. continues executing. Generalized to networks you marshall up all of
  27. your parameters, then send them over the wire to another thread of
  28. execution which uses them in some computation, and then it returns
  29. results to you and you pull them off the wire and use them.
  30.  
  31. So what a good (for some definition of good) RPC system does for you
  32. is allows you to specify what is going to come over the wire, where
  33. it is going to go, and what sort of results you expect to get back.
  34. Other things it can do for you are to transmit the data in an architecture
  35. independent format so that you can communicate to systems which have
  36. different architectures without worrying about what byte order that
  37. system uses or what floating point format it requires. It can also
  38. provide a buffer between you and different network "stacks" or transports
  39. to make porting your code easier.
  40.  
  41. >My questions are: 
  42. >1.why and when the socket based communication is used?
  43.  
  44. Well if you absolutely must have the highest possible performance and
  45. are willing to pay the maintence burden of rewriting your code for different
  46. networks, then sockets are for you. Its analagous to programming in
  47. assembler.
  48.  
  49. >2.Why always RPC based communication is prefered over socket based 
  50. >communication is prefered?
  51.  
  52. They aren't always. Some things you might want to do with the network
  53. don't really map well into a procedure call model. An example of this
  54. is doing "one to many" communication where a single "call" from your
  55. application results in several network messages being generated to
  56. several servers. The ISIS system is a good example of some of the things
  57. you can do using a network that certainly don't make sense on a uniproccessor
  58. system, and probably not on an MP system either. (They do loosely coupled
  59. operations spanning multiple systems)
  60.  
  61. >3. Is it possible to implement a 'Client-Server' model using  sockets? if yes,
  62. >can i call 'My-application-program=X.25-switch' (as given in steps 1-4) as
  63. >a 'cleint=server' model?
  64.  
  65. Of course it is. Get a copy of the source to Sun's RPC library from rice.edu
  66. or an archive server near you and take a peek. Its whole purpose in life is
  67. to make writing and maintaining network applications easier. Your application
  68. in particular sounds like a good fit for this kind of technology.
  69.  
  70. --
  71. --Chuck McManis                            Sun Microsystems
  72. uucp: {anywhere}!sun!cmcmanis   BIX: <none>   Internet: cmcmanis@Eng.Sun.COM
  73. These opinions are my own and no one elses, but you knew that didn't you.
  74. "I tell you this parrot is bleeding deceased!"
  75.