Chapter 4 Medium Access Control 1
Introduction Objectives To manage the access to the medium or channel To take into account the time constraints To schedule the traffics Different solutions History Different contexts Difficulty : knowledge of the needs abstraction of the MAC by upper layers (OSI model) 2
Summary Introduction General Model Taxonomy CSMA and variants TDMA Controlled access Token Passing Centralized Access 3
General model-1 MAC : manages the access to the medium Waits for a condition before sending a frame Controls the transmission Might select the frame to be sent according to time constraints according to the state of the system statically or dynamically The MAC protocols differ on the wait condition the selection of the frame 4
General model-2 Principle-1 Frame selection Y Sending Cond N Transmission N Success Y 5
General model-3 Principle-2 Frame selection?? Y Sending Cond N Transmission N Success Y 6
General model-4 General principle on receipt At the physical layer A frame arrival : physical signal for the physical layer Decoding OK or not (if not, lost frame) At the MAC layer 1-Verification of the frame correctness 2-Verification of the destination address 3-Transmission to the LLC by a MAC-Data-Indication except if it s a MAC service frame 4-If service frame, performing of internal task 7
General model-5 General principle on receipt In case of broadcasting network All the stations perform the same algorithm until the stage 3 If a group addressing is used, all the designated stations perform the same algorithm 8
General model-6 Addressing Two main addressing types Addressing of the station Usual addressing as in ISO 8802 Addressing of object CAN IEC 1158 WorldFIP 9
Summary Introduction General Model Taxonomy CSMA and variants TDMA Controlled access Token Passing Centralized Access 10
Taxonomy-1 Condition for sending Autonomy of each node State of the medium, free or busy Detected or foreseen CSMA and TDMA Cooperation by messages exchanges Explicit right to send Centralized or not Polling/Selecting and Token 11
Taxonomy-2 MAC protocols Autonomous Controlled CSMA Aloha CSMA-CD CSMA-DCR CSMA-CA / BA TDMA Polling Token TDMA centralized clock TDMA distributed clock Token bus Token ring 12
Taxonomy-3 MAC protocols Contention TDMA Controlled CSMA Aloha CSMA-CD CSMA-DCR CSMA-CA/BA TDMA centralized clock TDMA distributed clock Polling / Selecting Token Token bus Token ring 13
Taxonomy-4 Networks classification by MAC protocols CSMA Ethernet, CAN, DeviceNet, SDS, EHS, Batibus, EiBus, LON TDMA Sercos, Arinc, TTP-A and C Controlled access Polling WorldFIP, Interbus, HART, FF, IEC 1158, P-NET Token Bus Profibus, IEC 1158 14
Summary Introduction General Model Taxonomy CSMA and variants TDMA Controlled access Token Passing Centralized Access 15
CSMA and variants-1 Carrier Sense Multiple Access Aloha, 1970 Transmission and listening Ethernet Listening and transmission Collision detection CSMA-CD Variants CSMA-CA / BA CSMA-DCR 16
CSMA and variants-2 CSMA-CD Autonomous protocol Based on the detection of a free bus (no signal) Transmission and listening Collision detection if collision : stop the transmission and recovery if no collision : transmission OK 17
CSMA and variants-3 CSMA-CD Station 1 Distance d Station N Tt bus free collision 18
CSMA and variants-4 CSMA-CD Station 1 Distance d Tt bus free collision 19
CSMA and variants-5 CSMA-CD To detect a collision being transmitting when the collision signal arrives Tt > 2 * Tp + detection time Ethernet : d max = 2 km B = 10 Mbps Tp = 10 us Tt > 30 us Minimal frame length = 512 bits 20
CSMA and variants-6 CSMA-CD Recovery after collision Wait for a random delay Listen If bus free during Interframe delay then transmit Listen 21
CSMA and variants-7 CSMA-CD, transmission algorithm frame to be sent transmit Y BF N Postpone N C? Y stop and wait BF : bus free C? : collision 22
CSMA and variants-8 CSMA-CD, Wait state N : number of the frame transmissions L = min (N, 10) R = random (0, 2 L ) Tb = basic time = 51,2 us Wait-time = R*Tb 23
CSMA and variants-12 CSMA-CA (collision avoidance) CSMA-BA (Bitwise arbitration) like CSMA-CD but : one bit is transmitted collision is possibly detected the second bit is transmitted and so on The collision are detected bit by bit and not frame by frame 24
CSMA and variants-13 CSMA-BA Station 1 Distance d Tt 1 bit bus free collision collision detection 25
CSMA and variants-14 CSMA-BA Station 1 Station 2 Station 3 Network Station 1 continues 26
CSMA and variants-15 CSMA-DCR (Deterministic Collision Resolution) Idea : In case of collision with CSMA-CD, Determine a station which might transmit without collision Autonomous algorithm Algorithm according to the binary tree 27
CSMA and variants-26 CSMA-DCR Allows a bounded delay for all the frames involved in the collision Delays possibly a more important frame Implemented just over CSMA-CD integrated circuits 28
Summary Introduction General Model Taxonomy CSMA and variants TDMA Controlled access Token Passing Centralized Access 29
TDMA-1 TDMA (Time Division Multiple Access) Classical method for resource sharing CPU Time Telecommunication time 1 2 3 4 mpx shared line 30
TDMA-2 Allows a time interval periodically at each station Independently of their needs Each station detects the beginning of the time interval by its clock Data rate of the shared line > Station loads time 31
TDMA-3 Clocks must be synchronized Two solutions classes Centralized control of the clocks A station is in charge of synchronisation Distributed control of the clocks All the stations applied an algorithm Centralized SERCOS, TTP-A Distributed TTP-C 32
Summary Introduction General Model Taxonomy CSMA and variants TDMA Controlled access Token Passing Centralized Access 33
Controlled Access Basic condition to transmit A station may transmit only if it has received a special message Special message Poll indication Token Special messages transmitted on the same channel Other technique, control channel to transmit the special messages 34
Polling / Selecting-1 Polling : operation triggered by a master which allows a slave to transmit Transmission between a slave and the master Selecting : operation triggered by a master which allows a slave to receive Transmission between the master and a slave With or without transmission between slaves 35
Polling / Selecting-2 Schema Slave1 Slave2 Slave3 Master Slave4 Slave5 36
Polling / Selecting-3 Variants Transmission from a slave S1 to another one S2 Recovery of the token by the master Explicitely (how?) Implicitely (how?) Failure detection (how?) 37
Polling / Selecting-4 Explicitely by a message from S2 by a message from S1 Implicitely After a delay detected by the master Failure detection After a delay detected by the master Delay to answer to a poll frame allowed to each slave 38
Polling / Selecting-5 Frame format SOF CF @P EOF Poll SOF CF @Sel EOF Poll Sel 39
Conclusion Medium Access Control Centralized Most of the fieldbuses, WorldFIP, FF, Profibus-PA, ASI,... CSMA/BA CAN and derived networks as DeviceNet, SDS, TokenBus Profibus FMS, P-Net Token ring INTERBUS TDMA TTP, SERCOS 40