1 / 109

Chapter 3 MAC (Media Address Control) Layer

Chapter 3 MAC (Media Address Control) Layer. Chapter 3 Outline. 3.1. 802.11 碰撞議題相關研究 3.2. 802.11 MAC 機制 3.3. 802.11 節能、省電議題相關研究 3.4. 802.15.4 MAC 3.5. MAC protocols for WSN. Chapter 3 Outline. 3.1. 802.11 碰撞議題相關研究 3.2. 802.11 MAC 機制 3.3. 802.11 節能、省電議題相關研究

trang
Download Presentation

Chapter 3 MAC (Media Address Control) Layer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 3 MAC (Media Address Control) Layer

  2. Chapter 3 Outline • 3.1. 802.11 碰撞議題相關研究 • 3.2. 802.11MAC機制 • 3.3. 802.11 節能、省電議題相關研究 • 3.4. 802.15.4 MAC • 3.5. MAC protocols for WSN Jang Ping Sheu

  3. Chapter 3 Outline • 3.1. 802.11 碰撞議題相關研究 • 3.2. 802.11MAC機制 • 3.3. 802.11 節能、省電議題相關研究 • 3.4. 802.15.4 MAC • 3.5. MAC protocols for WSN Jang Ping Sheu

  4. Collision Avoidance Reservation based TDMA、FDMA、CDMA (Slotted)ALOHA、CSMA、MACA Contention based DAMA Hybrid Jang Ping Sheu

  5. ReservationBased • TDMA → 一個點可以用到的較多頻寬,輪到時間較短。 F(頻帶) 1234…n 1 T(時間) Jang Ping Sheu

  6. Guard Band ReservationBased • FDMA → 一個點可以一直傳送,但頻寬較少。 F(頻帶) T(時間) Jang Ping Sheu

  7. ReservationBased • CDMA CDMA can transmission in the same space and time Code Time Frequency FDMA、TDMAcan use resource Jang Ping Sheu

  8. Contention Based • Pure ALOHA 當想要傳送Data時就直接往外傳送。 特點:traffic load low → 成功率高,反之碰撞率高 • Slotted ALOHA 加入slotted概念,在每個slot的開始點才可以傳送。 特點:改善了隨時隨地都有可能有結點來撞封包的缺點。 S (Throughput per Packet Time) 0.4 Slotted ALOHA 0.3 0.2 Pure ALOHA 0.1 0 0.5 1.0 1.5 2.0 3.0 G (Attempts per Packet Time) Jang Ping Sheu

  9. Contention Based • 1-persistent CSMA • When medium is • Idle → Transmit • Busy → Continue listening(Carrier Sense) • Non-persistent CSMA • When medium is • Idle → transmit • Busy →Wait an amount of time drawn from a probability distribution and repeat to listen Jang Ping Sheu

  10. Contention Based • p-persistent CSMA • When medium is • Idle → transmit probability: • transmit probability : p • defer probability : 1- p • Busy → listen until medium is idle Note: For 1-persistent CSMA Transmit probability 1) transmit probability : 1 2)defer probability : 0 Jang Ping Sheu

  11. Contention Based • MACA (Multiple Access with Collision Avoidance) • NAV (Network Allocation Vector) RTS CTS GET RTS: Can transmitbut can’t receive Disadvantage: GET CTS: Can receive but can’t transmitCan’t check frame GET CTS and RTS: Can’t transmit and receive transmission success or not Sender Receiver Sender Receiver Jang Ping Sheu

  12. Hybrid • DAMA (Demand Assigned Multiple Access) Two phases: 1)Contention-based: use slotted ALOHA 2)Reservation-based: use reservation list Disadvantage: Maintain reservation list Slotted ALOHA Slotted ALOHA Slotted ALOHA reserved reserved time Jang Ping Sheu

  13. Chapter 3 Outline • 3.1. 802.11 碰撞議題相關研究 • 3.2. 802.11MAC機制 • 3.3. 802.11 節能、省電議題相關研究 • 3.4. 802.15.4 MAC • 3.5. MAC protocols for WSN Jang Ping Sheu

  14. MAC • Medium Access Control(MAC) • 無線網路中主要的功能為 • 碰撞控制 • 存取控制 • 排程機制 • 醒睡省電機制 (Wireless STD) Jang Ping Sheu

  15. 802.11訊框結構(Frame Structure) 2-byte 2-byte 6+6+6-byte 2-byte 6-byte 0 ~ 2312-byte 4-byte Frame control Duration Address 1 ~ 3 Seq. Address 4 Data Checksum Version Type Subtype To DS From DS MF Retry Pwr. W O 1-bit 2-bit 2-bit 4-bit 1-bit 1-bit 1-bit 1-bit 1-bit 1-bit Jang Ping Sheu

  16. 802.11訊框結構(Frame Structure) Version Type Subtype To DS From DS MF Retry Pwr. W O Different type for each frame type (EX-in type control has subtype -CTS/RTS) Frame type (Data、Control、Management) Jang Ping Sheu

  17. 802.11訊框結構(Frame Structure) Version Type Subtype To DS From DS MF Retry Pwr. W O ESS BSS2 BSS1 STA STA STA STA STA IBSS STA AP1 AP2 Distribution System To DS =0 From DS =0 To DS =0 From DS =1 To DS =1 From DS =0 Portal To DS =1 From DS =1 802.X (EX:802.3、802.16) Jang Ping Sheu

  18. 802.11訊框結構(Frame Structure) Version Type Subtype To DS From DS MF Retry Pwr. W O More fragment? Retransmit ? Sleep ? Jang Ping Sheu

  19. 802.11訊框結構(Frame Structure) 2-byte 2-byte 6+6+6-byte 2-byte 6-byte 0 ~ 2312-byte 4-byte Frame control Duration Address 1 ~ 3 Seq. Address 4 Data Checksum Duration of frame Four address(by To DS/ From DS) Source Address(SA) Destination Address(DA) Transmitter Address(TA)–(now address) Receiver Address(RA)–(next address) Jang Ping Sheu

  20. Contention- Service (Asynchronous) Contention-Free Services (Real-time) Point Coordination Function (PCF) MAC Extent Distributed Coordination Function (DCF) MAC Architecture Jang Ping Sheu

  21. MAC Architecture • Distributed Coordination Function (DCF) • The fundamental access method for the 802.11 MAC, known as Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA). • Shall be implemented in ALL stations and APs. • Used within both ad hoc and infrastructure configurations. • Point Coordination Function (PCF) • An alternative access method • Shall be implemented on top of the DCF • A point coordinator (polling master) is used to determine which station currently has the right to transmit. • Shall be built up from the DCF through the use of an access priority mechanism. Jang Ping Sheu

  22. 802.11傳遞模式 Super frame Super frame PCF period DCF period AP time Beacon CF_END Beacon STA1 NAV STA2 PCF週期中沒拿到資料傳送權的STA ,會進入NAV休息狀態 PCF period ,根據排程好的傳送者進行傳送 DCF period ,節點與節點間傳送是互相競爭傳送權的 Jang Ping Sheu

  23. 802.11傳遞模式 - PCF週期 • DL-下傳封包 • ACK-回應封包 • Polling-詢問是否有資料上傳 • UL-上傳封包 • 沒傳完的資料怎辦? • 去DCF競爭 or 等待下一個PCF(DCF沒競爭到) PCF Beacon ACK DL Polling ACK DL Polling ACK Polling AP time STA1 ACK UL UL STA2 UL ACK Jang Ping Sheu

  24. 802.11傳遞模式 - PCF週期 Defer beacon The beginning of DCF CF_END Beacon AP STA1 Data time STA2 Data Data DIFS (DCF Inter-frame Space ), 一段固定的等待時間 Random backoff ,亂數等待時間 PIFS (PCF Interframe Space ) , 一段固定的等待時間 , (DIFS>PIFS) Jang Ping Sheu

  25. Piggyback機制 • Problem in Original PCF ? • 封包來回傳遞太多次,浪費資源。 • One frame in multi-message • Piggyback Beacon ACK+ DL2+ Polling2 ACK+ DL3+ Polling3 DL1+ Polling1 DL1+ Polling1 CF_END AP STA1 ACK+ UL1 ACK+ UL1 STA2 time ACK+ UL2 STA3沒回ACK (超過PIFS認定他不在) PIFS (PCF Interframe Space ) Jang Ping Sheu

  26. DCF Operation • MAC begins frame transmission • If both PHY and virtual carrier sense mechanisms indicate the medium is idle for an interval of DIFS (or EIFS if previously received frame contained errors). • If medium is busy during the DIFS interval, • Backoff interval is selected and increment retry counter • For each slot time, if medium is detected to be idle, decrement backoff interval; MAC begins to transmit if backoff interval is expired. • If the transmission is not successful (i.e. collision), CW is doubled and new backoff interval is selected and countdown is begun, again. When to stop? Jang Ping Sheu

  27. Example of Backoff Intervals (2) (3) Backoff=2 DIFS DIFS Backoff=9 DIFS Backoff=4 DIFS (5) busy Station 1 Backoff=5 Packet arrival at MAC busy Station 2 (1) busy Station 3 Backoff=7 Backoff=2 (4) busy Station 4 • After packet arrival at MAC, station 3 senses medium free for DIFS, so it starts transmission immediately (without backoff interval). • For station 1,2, and 4, their DIFS intervals are interrupted by station 3. Thus, backoff intervals for station 1,2, and 4, are generated randomly (i.e. 9,5, and 7, respectively). • After transmission of station 2, the remaining backoff interval of station 1 is (9-5)=4. • After transmission of station 2, the remaining backoff interval of station 4 is (7-5)=2. • After transmission of station 4, the remaining backoff interval of station 1 is (4-2)=2. Jang Ping Sheu

  28. Random backoff 機制 • Backoff Counter : • when network busy → B.C. freeze • network idle → B.C. decrease BC=3 BC=5 STA1 STA2 BC=3 STA3 BC=5 BC=2 STA4 DIFS Jang Ping Sheu

  29. CWmax 255 255 127 8 63 31 15 CWmin 7 第三次重送 初始值 第二次重送 第一次重送 DCF: the Random BackoffTime • Backoff time = CW* Random() * Slot time • CW = starts at CWmin and doubles after each failure until reaching CWmax and remains there in all remaining retries • e.g., CWmin = 7, CWmax = 255 • Random() = (0,1) • Slot Time = Transmitter turn-on delay + medium propagation delay + medium busy detect response time Jang Ping Sheu

  30. Priority Scheme • Goal:Let each frame has different priority • SIFS → PIFS → DIFS → EIFS • 802.11 DSSS– SIFS(10μs),PIFS(30μs),DIFS(50μs),EIFS(>50μs) DIFS PIFS SIFS time 1st Priority 2nd Priority 3rd Priority Jang Ping Sheu

  31. CSMA/CA with RTS/CTS • Hidden terminal problem → Collision • Exposed terminal problem → Waste bandwidth C A B D C can send data. But carrier the network is busy A B C D Jang Ping Sheu

  32. CSMA/CA with RTS/CTS • Solve hidden terminal problem • Highoverhead NAV(RTS) [LOCK] Sender Neighbor Data RTS Sender Sender Receiver Receiver ACK CTS NAV(CTS) [LOCK] Receiver Neighbor time Jang Ping Sheu

  33. Chapter 3 Outline • 3.1. 802.11MAC機制 • 3.2. 802.11 碰撞議題相關研究 • 3.3. 802.11 節能、省電議題相關研究 • 3.4. 802.15.4 MAC • 3.5. MAC protocols for WSN Jang Ping Sheu

  34. 802.11內建省電模式 • In 802.11 Power Saving mode • 802.11Infrastructure mode的省電模式 • Have AP • Ad-hocmode的802.11省電模式 • Only node Jang Ping Sheu

  35. 802.11Infrastructure mode的省電模式 • TIM(Traffic Indication Map) • TIM record data:Association ID、Buffered(0/1) • Mechanism • Listen Beacon • 1.TIM (if Buffered is 0) • Go to SLEEP STATE • 2. If Buffer is 1: • a.in PCF • waiting AP to transmit data • b. in DCF • 1. STA send PS-Poll to AP • 2. AP receives PS-Poll and transmits buffered data 0:no data 1:have data Jang Ping Sheu

  36. 802.11Ad-hocmode的省電模式 Beacon interval Beacon interval Data STA1 STA2 Beacon ACK STA3 time Beacon Sleep Active TBIT (Time Between Idle Time) window ATIM DATA /ACK ATIM_ACK ATIM(Announcement TIM) window Jang Ping Sheu

  37. References [1] Andrew S. Tanenbaum , “Computer Network 4/e” , PHPTR [2] 曾煜棋, 潘孟鉉, 林致宇 , “無線網域及個人網路-隨意及感測網路之技術與應用”, 知城 [3]N.Abramson, “The ALOHA system – another alternative for computer communications” , in proc. Fall Joint Computer Conference. [4] Jung-Hyon Jun, Young-June Choi, and Saewoong Bahk , “Affinity-Based Power Saving MAC Protocol in Ad Hoc Network” , in proc. IEEE PerCom2005 [5] V. Bharghavan, A. Demers, S. Shenker, and L. Zhang, “ MACAW: A media access protocol for wireless LAN's.” in proc. ACM SIGCOMM '94 [6] IEEE Std 802.11-1997 [7] IEEE Std 802.11a-1999 [8] IEEE Std 802.11b-1999 Jang Ping Sheu

  38. Chapter 3 Outline • 3.1. 802.11MAC機制 • 3.2. 802.11 碰撞議題相關研究 • 3.3. 802.11 節能、省電議題相關研究 • 3.4. 802.15.4 MAC • 3.5. MAC protocols for WSN Jang Ping Sheu

  39. IEEE 802.15.4 MAC • Architecture Applications ZigBee Network • Channel acquisition • Contention Window IEEE 802.15.4 MAC IEEE 802.15.4 PHY Jang Ping Sheu

  40. IEEE 802.15.4 MAC • Architecture Applications • Device join and leave • Frame routing • And so on ZigBee Network IEEE 802.15.4 MAC IEEE 802.15.4 PHY Jang Ping Sheu

  41. IEEE 802.15.4 MAC Network topology FFD vs. RFD • Full function device (FFD) • Any topology • Network coordinator capability • Talks to any other device • Reduced function device (RFD) • Limited to star topology • Cannot become a network coordinator • Talks only to a FFD • Very simple implementation Jang Ping Sheu

  42. IEEE 802.15.4 MAC - Star Topology FFD Communications flow RFD PAN Coordinator Master/Slave Jang Ping Sheu

  43. IEEE 802.15.4 MAC - Tree and Mesh Topologies FFD Communications flow RFD PAN Coordinators Cluster tree Point to point Jang Ping Sheu

  44. Transfer mode – Superframe Structure CAP CFP GTS Active portion Inactive portion Beacon interval Beacon frame CAP︰ Contention-Access Period CFP︰ Contention-Free Period GTS︰ Guaranteed Time Slot Beacon frame sent from coordinator Jang Ping Sheu

  45. Transfer mode – GTS Concepts • Beacon interval = aBaseSuperframeDuration × 2SO symbols • aBaseSuperframeDuration為IEEE 802.15.4預設參數。 • Active portion的長度為: aBaseSuperframeDuration × 2BO symbols (BO≦SO≦14) • 當SO =15時,代表不使用superframe的架構。 • A Guaranteed Time Slot (GTS) allows a device to operate on the channel within a portion of the superframe • A GTS shall only be allocated by the PAN coordinator • The PAN coordinator can allocated up to seven GTSs at the same time Jang Ping Sheu

  46. Transfer mode – GTS Allocation • If and only if PAN coordinator has enough capacity for the requested GTS • GTSs shall be allocated on a first-come-first-served basis by the PAN coordinator Coordinator MAC ACK Beacon(with GTS descriptor) Device MAC GTS request Jang Ping Sheu

  47. Transfer mode – GTS deallocation • PAN coordinator shall update the final CAP slot subfield of the superframe Coordinator MAC ACK Beacon(with GTS descriptor) Device MAC GTS release Jang Ping Sheu

  48. Transfer mode – GTS reallocation • The deallocation of a GTS may result in the superframe becoming fragmented. CAP CFP GTS1 GTS2 GTS3 8 10 13 Jang Ping Sheu

  49. Transfer mode – GTS reallocation CAP CFP GTS1 GTS3 11 13 Maximize CAP Jang Ping Sheu

  50. Data Transfer Model - Channel Access • Beacon-enable networks • With beacon frame • Slotted CSMA/CA channel access mechanism • Non Beacon-enable networks • No beacon frame • Unslotted CSMA/CA channel access mechanism Jang Ping Sheu

More Related