cpre 458/558: real-time systems
DESCRIPTION
CprE 458/558: Real-Time Systems. Real-Time MAC Protocols (Contd.). DCR protocol: disadvantages. Poor schedulability because it does not take message deadlines into consideration. DOD-P (Deadline-based DCR protocol). Uses the message class concept - PowerPoint PPT PresentationTRANSCRIPT
CprE 458/558: Real-Time Systems (G. Manimaran) 1
CprE 458/558: Real-Time Systems
Real-Time MAC Protocols
(Contd.)
CprE 458/558: Real-Time Systems (G. Manimaran) 2
DCR protocol: disadvantages
• Poor schedulability because it does not take message deadlines into consideration
CprE 458/558: Real-Time Systems (G. Manimaran) 3
DOD-P (Deadline-based DCR protocol)
• Uses the message class concept
• All the messages which have similar (fairly equal) deadlines are classified into one single class
• The total number of message classes is a design parameter
• A time tree is constructed with each node representing a message class
• The time tree is traversed in a pre-order manner
• Each node when traversed in turn runs the DCR to resolve collision with messages belonging to that class alone
CprE 458/558: Real-Time Systems (G. Manimaran) 4
DOD-P: Example
Time tree with three message
classes
Traversed in pre-order manner
1
2 5
3 4 6 7
1
32
Perform normal DCR with just the GREEN messages
Perform normal DCR with just the YELLOW messages
Perform normal DCR with just the PINK messages
CprE 458/558: Real-Time Systems (G. Manimaran) 5
DOD-P Protocol: State Diagram
READY
WAIT
IDLE
Channel busy
Channel idle
Successful transmission
Message arrival
TIME TREE SEARCH
TRANSMIT
End of epoch
TRANSMITDCR MODEEligible
transmission
Transmission completeNot eligible for
transmission
collision
Eligible transmission
Transmission complete
collisionDCR tree search
complete
Not eligible for transmission
CprE 458/558: Real-Time Systems (G. Manimaran) 6
Carrier Sense Medium Access (CSMA)
Channel busy ?
Have a message ?
YES
Transmit message
Collision ?
Re-transmit later
NO
YES
NO
This step depends on the exact
CSMA variation
CprE 458/558: Real-Time Systems (G. Manimaran) 7
Virtual Time CSMA (VTCSMA)
• The basic idea is to incorporate a priority mechanism into the CSMA
– various priority policies can be incorporated
• No coordination between nodes
• VT-CSMA uses the following to decide whether or not to attempt message transmission
– The state of the channel
– The priorities of the messages waiting for transmission
– The time according to the synchronized clock
– It has no knowledge about the priorities of the messages waiting at the other nodes
CprE 458/558: Real-Time Systems (G. Manimaran) 8
VTCSMA
• Maintains two clocks at each node: real clock (RC) and virtual clock (VC)
• RC gives real time
• VC gives virtual time
• RC and VC at a node are synchronized with the corresponding clocks at the other nodes.
• VC runs η ( > 1) times faster than the RC
• For example, η = 2 means that VC runs twice as fast as the RC when the channel is idle
CprE 458/558: Real-Time Systems (G. Manimaran) 9
VTCSMA
• When a channel is busy, the VC stops running
• When the channel is idle, the VC is reset according to the priority policy as follows
VC = • No change, for FCFS• RC, for EDF & LLF• 0, for SMF
CprE 458/558: Real-Time Systems (G. Manimaran) 10
Virtual time of the message
• When a message M arrives at a node, its VSM (virtual start time) is set as follows, depending on the policy:
VSM =
• AM (msg arrival time) for FCFS policy
• DM (msg deadline) for EDF policy
• LM (msg laxity) for LLF policy
• TM (msg transmission time) SMF policy
• A message is (eligible) transmitted only if its VSM <= VC
• Multiple messages may be eligible at the same time, which results in collision when they transmit simultaneously
CprE 458/558: Real-Time Systems (G. Manimaran) 11
Modifying VSM
• When a node senses the channel is idle and the node has an eligible message, it transmits the message
• If the message collides with another message, each node involved in the collision either retransmits its message immediately, with probability “p”, or modifies the VSM of its message, with probability (1 – p), to a random number drawn from an interval (A,B), where(A, B) =
• (VC, LM) for FCFS policy• (RC, DM) for EDF policy• (RC, LM) for LLF policy• (0, TM) for SMF policy
CprE 458/558: Real-Time Systems (G. Manimaran) 12
VTCSMA algorithm
New message ? Initialize VSM
Channel busy ? Initialize VC
Repeat1. Discard negative latency messages2. RC = RC + 13. VC = VC + ηUntil all messages with VSM less than VC are transmitted
OR the channel becomes busy
RC = RC + 1
Channel busy ?
Transmit message Collision ?Retransmit or modify VSM
YES
YES
NO
NO
YES
YES
NO
CprE 458/558: Real-Time Systems (G. Manimaran) 13
Impact of η
• Too large η– Too many collisions
• Too small η– Too many idle slots
CprE 458/558: Real-Time Systems (G. Manimaran) 14
VTCSMA-LLF: Example
Node RC at arrival
DM LM RC (VC) at transmission
1 0 28 12 6 (12)
2 12 38 22 22 (22)
3 16 52 36 38 (38)
4 20 68 52 45 (52)
5 20 68 52 45 (52)
Transmission status table for η = 2, transmission time = 16