Cpr E 458558 RealTime Systems RealTime MAC Protocols

  • Slides: 14
Download presentation
Cpr. E 458/558: Real-Time Systems Real-Time MAC Protocols (Contd. ) Cpr. E 458/558: Real-Time

Cpr. E 458/558: Real-Time Systems Real-Time MAC Protocols (Contd. ) Cpr. E 458/558: Real-Time Systems (G. Manimaran) 1

DCR protocol: disadvantages • Poor schedulability because it does not take message deadlines into

DCR protocol: disadvantages • Poor schedulability because it does not take message deadlines into consideration Cpr. E 458/558: Real-Time Systems (G. Manimaran) 2

DOD-P (Deadline-based DCR protocol) • Uses the message class concept • All the messages

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

DOD-P: Example 1 1 2 3 2 Time tree with three message classes Traversed

DOD-P: Example 1 1 2 3 2 Time tree with three message classes Traversed in preorder manner 3 5 4 6 7 Perform normal DCRDCR with just the PINK YELLOW GREEN messages Cpr. E 458/558: Real-Time Systems (G. Manimaran) 4

DOD-P Protocol: State Diagram Channel busy WAIT Message arrival Channel idle Successful transmission IDLE

DOD-P Protocol: State Diagram Channel busy WAIT Message arrival Channel idle Successful transmission IDLE End of epoch Eligible transmission collision TIME TREE TRANSMIT Transmission complete SEARCH collision Not eligible for transmission READY Not eligible for transmission DCR tree search complete Eligible DCR MODE transmission TRANSMIT Transmission complete Cpr. E 458/558: Real-Time Systems (G. Manimaran) 5

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

Carrier Sense Medium Access (CSMA) Have a message ? YES Channel busy ? NO Transmit message NO Collision ? YES Re-transmit later Cpr. E 458/558: Real-Time Systems (G. Manimaran) This step depends on the exact CSMA variation 6

Virtual Time CSMA (VTCSMA) • The basic idea is to incorporate a priority mechanism

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

VTCSMA • Maintains two clocks at each node: real clock (RC) and virtual clock

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

VTCSMA • When a channel is busy, the VC stops running • When the

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, • RC, • 0, for FCFS for EDF & LLF for SMF Cpr. E 458/558: Real-Time Systems (G. Manimaran) 9

Virtual time of the message • When a message M arrives at a node,

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

Modifying VSM • When a node senses the channel is idle and the node

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

VTCSMA algorithm New message ? RC = RC + 1 YES Channel busy ?

VTCSMA algorithm New message ? RC = RC + 1 YES Channel busy ? YES NO Initialize VSM Initialize VC Repeat 1. Discard negative latency messages 2. RC = RC + 1 3. VC = VC + η 4. Until all messages with VSM less than VC are transmitted 5. OR the channel becomes busy YES Channel busy ? NO Transmit message YES Retransmit or Collision ? modify VSM NO Cpr. E 458/558: Real-Time Systems (G. Manimaran) 12

Impact of η • Too large η – Too many collisions • Too small

Impact of η • Too large η – Too many collisions • Too small η – Too many idle slots Cpr. E 458/558: Real-Time Systems (G. Manimaran) 13

VTCSMA-LLF: Example Node RC at arrival 1 0 DM LM 28 12 RC (VC)

VTCSMA-LLF: Example Node RC at arrival 1 0 DM LM 28 12 RC (VC) at transmission 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 Cpr. E 458/558: Real-Time Systems (G. Manimaran) 14