90 likes | 287 Views
CprE 458/558: Real-Time Systems. Real-Time Networks – LAN MAC Protocols. Real-Time MAC protocols. RT-MAC. Controlled Access. Contention Based Access. TDM. Demand Adaptive. VTCSMA. Contention Resolution. DCR. DOD-P. The DCR protocol.
E N D
CprE 458/558: Real-Time Systems Real-Time Networks – LAN MAC Protocols CprE 458/558: Real-Time Systems (G. Manimaran)
Real-Time MAC protocols RT-MAC Controlled Access Contention Based Access TDM Demand Adaptive VTCSMA Contention Resolution DCR DOD-P CprE 458/558: Real-Time Systems (G. Manimaran)
The DCR protocol • DCR protocol resolves collisions in a deterministic way: • The DCR tree construction (designer’s task) • All nodes in a network are mapped onto vertices of a unique binary (UB) tree • An unique binary tree has the height of its leaf vertices differing by at most one • A node in a LAN is mapped onto a vertex or set of vertices in a UB tree by assigning to the node one or more indices called node indices • A node’s indices correspond to the positions of that node in the binary tree for the network • Multiple indices are assigned to a higher priority network node • Each node, transmits for a fixed number of slot (e.g., 1 slot) when it acquires the channel CprE 458/558: Real-Time Systems (G. Manimaran)
DCR protocol (preorder) – working • Each node that has the message, senses the channel • If the channel is idle, the node transmits the message • If no collision occurs, the transmission is successful • If a collision is detected, message transmission is aborted, and all nodes enter collision resolution mode. • Each node that has a message waits until its turn, according to the priority assigned to the node at the design stage, and transmits the message (assume fixed size messages) • In the event of a message collision, the UB tree is traversed in preorder to resolve the collision • Preorder traversal of a binary tree • Visit root • Visit left sub-tree in preorder • Visit right sub-tree in preorder CprE 458/558: Real-Time Systems (G. Manimaran)
Pre-order traversal of a binary tree 1 2 5 3 4 6 7 Pre-order traversal: 1, 2, 3, 4, 5, 6, 7 CprE 458/558: Real-Time Systems (G. Manimaran)
Adapting pre-order traversal to collision resolution • The slot following a collision is reserved for the root node of the tree, Tx, for transmission of a message (equivalently, visiting the root) • The next slot is reserved for the left sub-tree. All nodes in the left sub-tree of (Tx) are eligible to transmit in this slot. • The algorithm stops traversing the left sub-tree in preorder, upon successful transmission of messages from every node in that sub-tree that has a message to transmit or if the slot remains idle (indicating the left sub-tree has no more messages ready to transmit) • The right sub-tree is traversed in preorder • The algorithm continues to traverse the tree in preorder until the collision is resolved CprE 458/558: Real-Time Systems (G. Manimaran)
COLLISION DCR pre-order traversal (1, C, -) Slot 2: An exclusive slot is given to the root Slot 1: All 1’s child nodes can transmit COLLISION NO COLLISION (2, X, 1) 1 Slot 3: All 2’s child nodes can transmit (4, C, -) Slot 5: exclusive to node 5 (3, X, 2) 2 (5, X, 5) 5 Slot 7: nothing to transmit, the channel is idle (6, X, 6) (7, W, -) 3 4 6 7 Each sub tree is labeled with the triplet: (slot_number, channel status, succesful_node_index) CprE 458/558: Real-Time Systems (G. Manimaran)
State diagram of DCR protocol WAIT Channel busy Message arrival Channel idle IDLE READY Successful transmission Collision End of epoch DCR MODE TRANSMIT Eligible transmission Transmission complete Not eligible for transmission CprE 458/558: Real-Time Systems (G. Manimaran)
DCR Worst-case channel access time • When all the nodes have a message to transmit • Worst-case “epoch”, where epoch is the time taken to traverse the entire tree • Two cases: For a node, the message falls in current epoch or next epoch • Effectively, within one worst-case epoch time, the transmission right is given • For N node network in a balanced binary tree • # leaves is Ceiling(N/2) • # internal nodes Floor(N/2) • Internal nodes experience collision before successful transmission • Leaves don’t experience collision • Worst-case channel access time: { Floor(N/2)*2 + Ceiling(N/2)*1 } * SlotTime CprE 458/558: Real-Time Systems (G. Manimaran)