Simple peer to peer network?
Sean Conner
spc at conman.org
Mon Jan 28 23:04:01 CST 2008
It was thus said that the Great Jim Brain once stated:
> Sean Conner wrote:
> > Each computer has two serial connections. Can you send and receive on a
> >single "port" at the same time? Can you send and receive on both "ports"
> >at
> >the same time? The design of the protocol depends somewhat upon the
> >
> The sync ports are unidirectional, but they can be run together, so an
> SPI-like bus could be created.
> >capabilities of the ports. If you can't, then you might want something
> >like
> >token ring, where a "transmit" token is passed around, and any computer
> >with
> >the "token" can transmit. If you can send/receive without problems on
> >either port, then just let the computers transmit at will.
> >
> On the latter, I don't understand. Who would they transmit to? How
> would I deal with collisions?
Since each computer is connected to two others, you end up with a ring
configuration (small example here):
A -- B -- C -- D
| |
E L
| |
F K
| |
G -- H -- I -- J
What I meant was that if A could transmit and receive from B and E at the
same time, then no tokens (more on that in a bit) are needed. Say, A wants
to talk to D; to do so, it needs to send a packet to B, which will then
forward it to C, which will forward it to D. Since the links are
bidirectional (in this hypothetical situation) A can talk to B or E at any
time.
If the links are unidirectional, then there has to be some way for A to
signal B that it has a packet to send its way---that is, if B isn't already
sending a packet to A. But first, you need to solve this situation:
A -- B
(a very simple network). A and B want to send each other a packet, at the
same time. How is this resolved? How you resolve this dictates the final
format of your protocol.
> > About the only real problem to come up is configuration---how does each
> >computer get its address on the network? Manual configuration?
> >Automatic?
> I cna hard code the addresses, but how does the ring/bus know when a
> machine is alive, etc.
Well, how does A know that its neighbor B is up? Just how many wires go
between A and B?
-spc (From the sound of it, it sounds like the answer is "one" ... )
More information about the cctech
mailing list