Cpr E 458558 RealTime Systems RealTime Networks LAN

  • Slides: 13
Download presentation
Cpr. E 458/558: Real-Time Systems Real-Time Networks – LAN Medium Access Control (MAC) Protocols

Cpr. E 458/558: Real-Time Systems Real-Time Networks – LAN Medium Access Control (MAC) Protocols Cpr. E 458/558: Real-Time Systems (G. Manimaran) 1

Real-Time MAC protocols RT-MAC 1. Controlled Access TDMA Dynamic TDMA 3. Implicit Collision Resolution

Real-Time MAC protocols RT-MAC 1. Controlled Access TDMA Dynamic TDMA 3. Implicit Collision Resolution 2. Contention Based Access (CSMA/CD) VT-CSMA CAN Bus Deterministic Contention Resolution DCR Cpr. E 458/558: Real-Time Systems (G. Manimaran) DOD-P 2

FDMA, TDMA, CDMA Source: https: //www. itu. int/osg/spu/ni/3 G/technology/index. html#Access Technologies Cpr. E 458/558:

FDMA, TDMA, CDMA Source: https: //www. itu. int/osg/spu/ni/3 G/technology/index. html#Access Technologies Cpr. E 458/558: Real-Time Systems (G. Manimaran) 3

TDMA – Time Division Multiple Access • Transmission is divided into frames of fixed

TDMA – Time Division Multiple Access • Transmission is divided into frames of fixed duration • Frame is divided into fixed number of time slots • Channel is given fixed # slots in each frame • Pros: Suitable for periodic traffic • Cons: Cannot support aperiodic traffic • E. g. , Flex. Ray (used in Automotive) uses TDMA Cpr. E 458/558: Real-Time Systems (G. Manimaran) 4

CSMA: Carrier Sense Medium Access Have a message ? YES Channel busy ? NO

CSMA: Carrier Sense Medium Access Have a message ? YES Channel busy ? NO Transmit message NO Collision ? YES Re-transmit later Cpr. E 458/558: Real-Time Systems (G. Manimaran) depends on the exact CSMA variation (e. g. , Binary Exponential Back-off) 5

Pros vs. Cons. CSMA/CD • Pros – Dynamic sharing of link bandwidth among nodes

Pros vs. Cons. CSMA/CD • Pros – Dynamic sharing of link bandwidth among nodes – Efficient utilization (in case of less collisions) • Cons – Probabilistic collision resolution – Not suitable for real-time communication Cpr. E 458/558: Real-Time Systems (G. Manimaran) 6

DCR – Deterministic Collision Resolution protocol Channel busy WAIT Message arrival IDLE Channel idle

DCR – Deterministic Collision Resolution protocol Channel busy WAIT Message arrival IDLE Channel idle Successful transmission READY Collision End of epoch DCR MODE Eligible transmission TRANSMIT Transmission complete Not eligible for transmission Cpr. E 458/558: Real-Time Systems (G. Manimaran) 7

DCR pre-order traversal COLLISION (1, C, -) Slot 2: An exclusive slot is given

DCR pre-order traversal COLLISION (1, C, -) Slot 2: An exclusive slot is given to the NO root. COLLISION Slot 3: All 2’s children 3, can. X, transmit 1 (2, X, 1) (4, C, -) 2) (5, X, 5) 2 (6, X, 6) 3 Slot 1: All 1’s children can COLLISION transmit 4 6 5 (7, W, -) 7 Slot 5: exclusive to node 5 Slot 7: nothing to transmit, the channel is idle Each slot is labeled with the triplet: (slot_number, channel status, succesful_node index); Channel status: Transmit (X), Collision (C), Idle (W) Cpr. E 458/558: Real-Time Systems (G. Manimaran) 8

Pre-order traversal of a binary tree 1 2 3 5 4 6 7 Pre-order

Pre-order traversal of a binary tree 1 2 3 5 4 6 7 Pre-order traversal: 1, 2, 3, 4, 5, 6, 7 Cpr. E 458/558: Real-Time Systems (G. Manimaran) 9

The DCR protocol • DCR protocol resolves collisions in a deterministic way: • The

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 Cpr. E 458/558: Real-Time Systems (G. Manimaran) 10

DCR protocol (preorder) – working • Each node that has the message, senses the

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 Cpr. E 458/558: Real-Time Systems (G. Manimaran) 11

Adapting pre-order traversal to collision resolution • The slot following a collision is reserved

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 Cpr. E 458/558: Real-Time Systems (G. Manimaran) 12

DCR’s Worst-case channel access time • When all the nodes have a message to

DCR’s 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 } * Slot. Time Cpr. E 458/558: Real-Time Systems (G. Manimaran) 13