Serial Port Complete - Latest Microcontroller projects

(lily) #1
Network Programming



; 




A primary/secondary protocol, also called the master/slave protocol, is often the
least complex network protocol a network can implement. One computer is
designated the primary node in charge of controlling all network traffic. The
other computers are secondary nodes that respond to communications from the
primary node. A network might have a PC as the primary node and embedded
systems as secondary nodes.


To give each node a chance to communicate, the primary node can poll, or send
a message to, each of the secondary nodes in sequence. Each poll can request a
response, which might contain an acknowledgment, requested data, an error
message, or other information. A secondary node transmits only when the pri-
mary node has requested a response. Any message from one secondary node to
another must pass through the primary node.


The main limitation of the protocol is the delays that occur as each node waits
to be polled. For a critical alarm system, waiting to be polled could be a prob-
lem, while a data-acquisition system might tolerate long delays.



' 


A token-passing protocol allows any node to obtain control of the network.
The node in control is said to have the token.


The network protocol defines how a node knows if it has the token and how to
pass the token to another node. The token can be a defined bit or variable that
each node sets to indicate whether or not the node holds the token.


A node that wants to pass the token to another node gives up the token it has
(by clearing its token bit, for example) and sends a message to inform another
node that it now has the token. This node then takes whatever action it wants
and passes the token on. The nodes can pass the token in a defined sequence or
use another method to decide who gets the token next.


This protocol enables any node that has the token to talk directly to another
node. But a node that doesn’t have the token can’t interrupt with an emergency
message.




 


A collision-detecting protocol allows any node to transmit whenever the trans-
mission path is free. If two or more nodes try to transmit at the same time, all of
the nodes (or with some protocols, all nodes but one), must detect the collision,

Free download pdf