On Mon, 18 May 2009, Vitaliy wrote: > sergio masci wrote: > >> - Avoid "vague" commands ("toggle") in favor of more specific ones ("turn > >> off") > >> - Have the transmitter request the status before issuing the command > >> again > > > > This implies that comms between two nodes is "serial" i.e. commands and > > responses must ping pong back and fore between two nodes (say A and B) > > before comms between other nodes can be accepted by either A or B > > otherwise things start getting really hairy. > > > > The other thing to consider is what happens if the "turn off" command is > > sent before the "turn on" command but arrives AFTER the "turn on" command. > > Here "toggle" actually is an advantage. Yes packet sequence numbers are > > definiately very useful for deciding what to do here. > > Well, yes. We weren't talking about some abstract protocol where you could > get messages out of sequence. But it's easy to end up with a protocol where messages can be delivered out of sequence. Consider a protocol that requires a node to ack a successful packet delivery before the next packet can be sent. Node A sends a packet to node B. Node B receives the packet does a little processing on it then sends an ack or nack back. During this turn around time node A cannot send anything else to node B (and probably wont be able to send anything else to any other node depending on the exact protocol). So this throttles the bandwidth. Now consider that the lag may become large depending on the workload of the node being talked to. Node A might actually be running several tasks each of which might need to talk to a different node. It makes sense to be able to send out as many packets as you can without waiting for any particular node to reply (the task waiting for the reply could simply sleep in this case). This is where out of order packets creeps in. Node A sends several packets to node B (say 4 packets). One of the packets (say packet 2) arrives corrupt. Node B sends back ACKs for packets 1, 3 and 4 and nothing for packet 2 (times out packet 2). Node A then resends packet 2 which is now out of order. Regards Sergio Masci -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist