rbs@bute.ed.aiai (Robert Scott) (03/12/91)
I'm trying to turn a network of Sun4s in a multiprocessor executing a parallel language. So far I have implemented an interpreter for the langauge and can get two machines to cooperate to solve problems by communicating though a single socket. I want to generalise the system. I want an unlimited number of machine to be able to communicate. I can see that on each machine I need to create an array of sockets of length N (the number of machines) so that each machine can talk directly to any other. How do I do this cleanly? My first guess is that each machine would have a deamon running on it listening to a reserved port (like all the other deamons). Then I would need to design some protocol whereby one of the interpreters, the one connected to the human :-), would initiate startup by communicating with the interpreters on the other machines via the appropriate deamon. Apart from this very sketchy idea I haven't got a clue what I'm going to do. Has anyone tried this before (surely someone has) and do they have advice for me? Rob Scott Department of AI University of Edinburgh EDINBURGH SCOTLAND rbs@uk.ac.ed.aipna
mouse@thunder.mcrcim.mcgill.edu (der Mouse) (03/15/91)
In article <1991Mar13.053500.17782@neon.Stanford.EDU>, sidana@neon.Stanford.EDU (Ashmeet S Sidana) writes: > In article <4306@skye.ed.ac.uk> rbs@bute.ed.aiai (Robert Scott) writes: >> I want to generalise the system. I want an unlimited number of >> machine to be able to communicate. I can see that on each machine I >> need to create an array of sockets of length N (the number of >> machines) so that each machine can talk directly to any other. > If your communication requirements are not too high then you could > just communicate through one socket (with everybody listening), > whereby the first byte would indicate which machine the message was > for (assuming < 255 machines) Um, just how does one do this? A socket can be connected to at most one peer. The only case where I can see this being of any use is when using connectionless protocols like UDP, all machines involved are on a common network, and that network supports broadcasting. And as far as I know, all connectionless protocols implemented are unreliable, in that your packet may get dropped without notice. (Of course, the common network and broadcast restrictions may be relaxable in an environment with multicasting available. But if you're doing research like that into networking, you don't have to post networking questions like this.) Of course, if that's OK for your application, go ahead. :-) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu
jseymour@medar.com (James Seymour) (03/19/91)
In article <1991Mar15.101603.13968@thunder.mcrcim.mcgill.edu> mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes: >In article <1991Mar13.053500.17782@neon.Stanford.EDU>, sidana@neon.Stanford.EDU (Ashmeet S Sidana) writes: >> In article <4306@skye.ed.ac.uk> rbs@bute.ed.aiai (Robert Scott) writes: >>> I want to generalise the system. I want an unlimited number of >>> machine to be able to communicate. I can see that on each machine I >>> need to create an array of sockets of length N (the number of >>> machines) so that each machine can talk directly to any other. >> >> If your communication requirements are not too high then you could >> just communicate through one socket (with everybody listening), >> whereby the first byte would indicate which machine the message was >> for (assuming < 255 machines) > >Um, just how does one do this? A socket can be connected to at most >one peer. > If I understand the original question correctly, here's how ya do it (it's the way the so-called "super-daemon" works): In brief: 1) Create a daemon that listens on a "well-known" port. 2) When a connection is made, spawn a child (passing it the new socket fd) and let the child do the dirty work. 3) After spawning the child, go back and accept any more connections (if any). You can do the standard verification stuff in the child if you want (you know, the "peer" stuff). For details on this and other interesting IPC related subjects, get the book "UNIX Network Programming", written by Stevens and published by Prentice Hall. As an adjunct to this book, I also recommend "Advanced UNIX Programming", written by Rochkind and also published by P.H. [No, I don't work for the publisher :-).] Both books are clearly written and chock full of great example code. The code in the examples in the Stevens book is also available somewhere on the net (someone else here picked it up within the last couple of weeks). If I didn't understand the question correctly, I apologize in advance for the (useless?) reply. -- Jim Seymour | Medar, Inc. ...!uunet!medar!jseymour | 38700 Grand River Ave. jseymour@medar.com | Farmington Hills, MI. 48331 CIS: 72730,1166 GEnie: jseymour | FAX: (313)477-8897