Уровень mac wi fi

Русские Блоги

Примечание 2: эта статья является личным пониманием, пожалуйста, простите меня и исправьте все ошибки.

1. Формат кадра MAC

Соответствующая структура данных выглядит следующим образом:

1.1 Формат адреса

Addr1: адрес получения (все пакеты включают его)

Addr2: адрес передачи (все остальные пакеты, кроме ACK и CTS, включают его)

Addr3: используется только для пакетов управления и пакетов данных.

Addr4: Используется, когда и FROM DS, и TO DS установлены в режиме беспроводной распределенной системы.

На следующем рисунке в элементе управления кадром, занимающем два байта, параметры To DS и From Ds определяют использование этих четырех адресов.

Адрес, соответствующий элементу управления Frame, следующий: (Little ENDIAN)

Таблица соответствия адресов выглядит следующим образом:

DS это Аббревиатура от «распределенная система» используется для различения методов разрешения адресов в разных типах фреймов.

To DS = 0, From DS = 0: указывает на связь, подобную AD Hoc, между станциями или обнаружение контроля и управления.

К DS = 0, От DS = 1: обнаружение, полученное станцией.

К DS = 1, От DS = 0: обнаружение, отправленное станцией.

К DS = 1, От DS = 1: Обнаружение данных на беспроводном мосте.

Толкование каждого адреса:

SRC: Исходный адрес (SA), как и в Ethernet, является исходным адресом кадра.Когда формат кадра конвертируется между Ethernet и Wi-Fi, они могут быть скопированы напрямую.

DST: адрес назначения (DA), как и в Ethernet, это адрес, по которому фрейм данных окончательно получен.Когда формат фрейма конвертируется между Ethernet и Wi-Fi, их можно скопировать напрямую.

TX: Transmiter (TA), который представляет адрес человека, который фактически отправил кадр в настоящее время в беспроводной сети (может быть человек, который первоначально отправил кадр, или маршрут, когда он был переадресован).

RX: Receiver (RA), который представляет адрес человека, который фактически получает кадр в беспроводной сети (может быть конечным получателем или AP, который получает кадр для пересылки получателю).

Примечание: в беспроводной сети Station Для общения необходимо пройти AP Продолжать “ Вперед ” . на самом деле, Tx с Rx Отправка и получение в беспроводной сети, то есть Radio ;а также Src с Dst Настоящий отправитель и получатель

2 Тип рамы

Тип кадра определяется двумя битами типа управления кадром. В настоящее время существует три типа кадров:

00, рамка управления . IEEE80211_TYPE_MGMT используется для выполнения операций управления, таких как ассоциация, аутентификация, сканирование и т. Д.

01, рамка управления . IEEE80211_TYPE_CTL обычно относится к пакетам данных. Например, пакет PS-poll используется для извлечения пакетов данных из буфера AP; другой пример, если STA хочет передать данные, она сначала отправит пакет данных управления RTS. Если носитель свободен, целевой клиент отправит обратно пакет с именем allow Отправить (CTS) пакет управляющих данных.

Читайте также:  Цифровой микроскоп tashe professional wifi

10. Фрейм данных . Пакет необработанных данных IEEE80211_TYPE_DATA. Примечание. Пустой пакет данных — это специальный фрейм данных, используемый для управления питанием.

2.1 SubType

2.1.1 Тип кадра управления 00

В следующей таблице показан тип, соответствующий подтипу кадра управления (то есть, когда тип равен 00, значение подтипа)

Type SubType FrameType
00 0000 Запрос ассоциации (запрос на подключение)
00 0001 Ответ ассоциации (ответ соединения)
00 0010 Запрос на повторное подключение (запрос на повторное подключение)
00 0011 Ответ на повторное подключение (ответ на повторное подключение)
00 0100 Запрос на зонд
00 0101 Ответ зонда
00 1000 Beacon (маяк, отправленный AP во время пассивного сканирования, уведомить)
00 1001 ATIM (сообщение индикации передачи уведомления)
00 1010 Дезассоциация (отключение, уведомление)
00 1011 Аутентификация
00 1100 Деаутентификация (деаутентификация, уведомление)
00 1101~1111 Зарезервировано (зарезервировано, не используется)

2.1.1.1 (кадр маяка (маяка)) подтип 1000

Результат отображения захвата пакета:

Поскольку маяк — это широковещательный пакет, DA — это FF: FF: FF: FF: FF: FF.

Функция: транслировать наличие AP в STA. Это причина, по которой мы обычно можем искать AP, который содержит информацию, связанную с AP.

2.1.1.2 (Кадр запроса зонда) subtype 0100

Функция: STA осуществляет широковещательную рассылку и устанавливает необходимые шаги для установления связи с AP, которые будут подробно объяснены позже.

2.1.1.3 (кадр ответа зонда) subtype 0101

Функция: после того, как STA запросит тестовый кадр, соответствующий ответный кадр AP.

Источник

Wi-Fi MAC Layer

[URL Check] The following URLs in this article are outdated. Please update.

IEEE 802.11 MAC sub-layer is responsible for coordinating access to the shared physical air interface so that the Access Point ( AP ) and Wi-Fi stations in range can communicate effectively. MAC takes data from a higher sub-layer called LLC , adds header and tail bytes, and sends them to lower physical layer for transmission. The reverse happens when receiving data from the physical layer. If a frame is received in error, MAC can retransmit it.

Multiple access is based on carrier sensing, channel contention and random backoff. Due to contention, a Wi-Fi network with a large number of active stations can suffer from low throughput and high latency. IEEE 802.11e and its subset Wi-Fi Multimedia attempt to alleviate this problem.

Discussion

  • What’s the purpose of MAC layer in 802.11? MAC deals with MSDUs and MPDUs. Source: Vergès 2015.MAC stands for «Medium Access Control», which implies that it’s main function is to control access to a shared medium. The air interface is a shared medium through which all multiple Wi-Fi stations and access point ( AP ) attempt to transfer data. MAC implements the control mechanisms that allow multiple devices to reliably communicate by sharing the medium as specified in the standard. Formally, MAC functions include scanning, authentication, association, power saving and fragmentation. When it comes to the actual handling of data, MAC sits as a sub-layer within Data Link Layer. It takes a packet of data called MAC Service Data Unit ( MSDU ) from Logical Link Control ( LLC ) sub-layer. MAC adds necessary header and tail bytes to form MAC Protocol Data Unit ( MPDU ). MPDU is then sent to the physical layer for transmission. The reverse flow happens when MAC receives a packet from physical layer.
  • How does a Wi-Fi station discover and associate with an AP ? There are two modes of discovery and the station is at liberty to use either or both:
    • Passive scanning: The station looks for beacon frames that are regularly sent by an AP . These frames contain essential information about the network. If there are multiple AP s within range, it selects the strongest one. Station then attempts to connect to the AP . Communication happens on the channel in which the AP is operating.
    • Active scanning: The station sends a probe request either to a specific AP or to any AP within range. Either way, it expects a probe response from one or more AP s, selects the strongest and attempts to connect to that AP . Since no prior beacon is decoded, station will send its probe on all channels.
  • What multiple access scheme is used in 802.11? MAC uses what’s called Point Coordination Function ( PCF ) or Distributed Coordination Function ( DCF ). The latter is more prevalent in industry and employs Carrier Sense Multiple Access with Collision Avoidance ( CSMA/CA ). There are two parts to CSMA/CA as suggested by the name:
    • Carrier Sensing: Wi-Fi stations must first sense the air interface. Only if the channel is idle for a specified amount of time (of duration DIFS ), they can transmit. DIFS stands for DCF InterFrame Spacing.
    • Collision Avoidance: If channel is sensed busy, the station waits till it’s free for DIFS duration, then waits for a random interval before transmitting. This randomness reduces the chances that two waiting stations end up transmitting at the same time. «Collisions» can still occur and they are inferred when no acknowledgement is received by the sender. If ACK is not received, station backs off for a random duration and repeats the process again.
  • What’s the structure of 802.11 MAC frames? MAC data and ACK frames, along with details of Frame Control Field. Source: Adapted from National Instruments 2017, figs. 6-8.There are three types of MAC frames: data, control and management. Only data frames contain higher layer data. Control frames include ACK, RTS, CTS, Power Save Poll, etc. Management frames help stations discover and connect to AP . All frames start with a 2-byte Frame Control that specifies the frame type and further details. All frames end with a 4-byte Frame Check Sequence ( FCS ) that’s used to detect errors. Frame Control is part of what’s called the MAC header, which can vary in length. For data frames, MAC header and FCS are added by MAC layer around the MSDU received from LLC . MSDU is often called MAC payload or frame body. Further details on MAC frame are available online.
  • Are there techniques in MAC to improve the reliability of communication? When (B) hears the CTS meant for (A) it defers itMAC uses many techniques and here we describe the important ones:
    • Error Detection: Every MAC frame contains 4-byte FCS that’s used to detect errors.
    • Retransmission: For a corrupted frame, receiver will not send an acknowledgment frame. Sender will therefore retransmit the frame.
    • Fragmentation & Reassembly: When frames are larger, there’s a higher chance of collision. MAC can therefore fragment data/management frames and transmit them as individual MAC frames. Any errors, only fragments need to be retransmitted.
    • RTS/CTS: Request-to-Send and Clear-to-Send are used to solve the hidden-node problem. When stations are widely spread around an AP , some may be hidden from others on the wireless channel. RTS/CTS handshaking alleviates this problem and reduces collision. This is an optional feature.
  • What are the MAC enhancements due to High Throughput ( HT )? Showing 802.11n frame aggregations A-MSDU and A-MPDU. Source: Hoffmann 2010, slide 19.IEEE 802.11n introduced changes to MAC that are part of High Throughput ( HT ). The idea was to reduce MAC overhead and increase overall throughput. This is done using Frame Aggregation. Two types are possible:
    • Aggregate MAC Service Data Unit ( A-MSDU ): Multiple MSDU s are packed into a single MPDU that in turn maps to a single transmission frame. In this case, all MSDU s share the same MAC header.
    • Aggregate MAC Protocol Data Unit ( A-MPDU ): Multiple MPDU s are carried within a single transmission frame. Obviously, each MPDU has its own MAC header.

    These two are not mutually exclusive: a single transmission can have a combination of A-MSDU s and A-MPDU s, sometimes called two level frame aggregation. In fact, research has shown that a combination of the two gives best performance on both 802.11n and 802.11ac devices.

    MAC frame is extended: new header field called HT Control plus larger payload size. Block Acknowledgments (BACK) is introduced.

    Источник

Оцените статью
Adblock
detector