Режим station wi fi

Manual:Wireless Station Modes

Wireless interface in any of station modes will search for acceptable access point (AP) and connect to it. The connection between station and AP will behave in slightly different way depending on type of station mode used, so correct mode must be chosen for given application and equipment. This article attempts to describe differences between available station modes.

Primary difference between station modes is in how L2 addresses are processed and forwarded across wireless link. This directly affects the ability of wireless link to be part of L2 bridged infrastructure.

If L2 bridging over wireless link is not necessary — as in case of routed or MPLS switched network, basic mode=station setup is suggested and will provide highest efficiency.

Availability of particular station mode depends on wireless-protocol that is used in wireless network. Please refer to applicability matrix for information on mode support in protocols. It is possible that connection between station and AP will be established even if particular mode is not supported for given protocol. Beware that such connection will not behave as expected with respect to L2 bridging.

802.11 limitations for L2 bridging

Historically 802.11 AP devices were supposed to be able to bridge frames between wired network segment and wireless, but station device was not supposed to do L2 bridging.

Consider the following network:

where X-to-AP and STA-to-Y are ethernet links, but AP-to-STA are connected wirelessly. According to 802.11, AP can transparently bridge traffic between X and STA, but it is not possible to bridge traffic between AP and Y, or X and Y.

802.11 standard specifies that frames between station and AP device must be transmitted in so called 3 address frame format, meaning that header of frame contains 3 MAC addresses. Frame transmitted from AP to station has the following addresses:

  • destination address — address of station device, also radio receiver address
  • radio transmitter address — address of AP
  • source address — address of originator of particular frame

Frame transmitted from station to AP has the following addresses:

  • radio receiver address — address of AP
  • source address — address of station device, also radio transmitter address
  • destination address

Considering that every frame must include radio transmitter and receiver address, it is clear that 3 address frame format is not suitable for transparent L2 bridging over station, because station can not send frame with source address different from its address — e.g. frame from Y, and at the same time AP can not format frame in a way that would include address of Y.

Читайте также:  Киа соул вай фай

802.11 includes additional frame format, so called 4 address frame format, intended for «wireless distribution system» (WDS) — a system to interconnect APs wirelessly. In this format additional address is added, producing header that contains the following addresses:

  • radio receiver address
  • radio transmitter address
  • destination address
  • source address

This frame format includes all necessary information for transparent L2 bridging over wireless link. Unluckily 802.11 does not specify how WDS connections should be established and managed, therefore any usage of 4 address frame format (and WDS) is implementation specific.

Different station modes attempt to solve shortcomings of standard station mode to provide support for L2 bridging.

Applicability Matrix

The following matrix specifies station modes available for each wireless-protocol. Note that there are 2 columns for 802.11 protocol: 802.11 specifies availability of mode in «pure» 802.11 network (when connecting to any vendor AP) and ROS 802.11 specifies availability of mode when connecting to RouterOS AP that implements necessary proprietary extensions for mode to work.

Table applies to RouterOS v5rc11 and above:

802.11 ROS 802.11 nstreme nv2
station V V V V
station-wds V V V
station-pseudobridge V V V
station-pseudobridge-clone V V V
station-bridge V V V

Mode station

This is standard mode that does not support L2 bridging on station — attempts to put wireless interface in bridge will not produce expected results. On the other hand this mode can be considered the most efficient and therefore should be used if L2 bridging on station is not necessary — as in case of routed or MPLS switched network. This mode is supported for all wireless protocols.

Mode station-wds

This mode works only with RouterOS APs. As a result of negotiating connection, separate WDS interface is created on AP for given station. This interface can be thought of point-to-point connection between AP and given station — whatever is sent out WDS interface is delivered to station (and only to particular station) and whatever station sends to AP is received from WDS interface (and not subject to forwarding between AP clients), preserving L2 addresses.

This mode is supported for all wireless protocols except when 802.11 protocol is used in connection to non-RouterOS device. Mode uses 4 address frame format when used with 802.11 protocol, for other protocols (such as nstreme or nv2), protocol internal means are used.

This mode is safe to use for L2 bridging and gives most administrative control on AP by means of separate WDS interface, for example use of bridge firewall, RSTP for loop detection and avoidance, etc.

With station-wds mode, it is not possible to connect to CAPsMAN controlled CAP.

Mode station-pseudobridge

From the wireless connection point of view, this mode is the same as standard station mode. It has limited support for L2 bridging by means of some services implemented in station:

  • MAC address translation for IPv4 packets — station maintains IPv4-to-MAC mapping table and replaces source MAC address with its own address when sending frame to AP (in order to be able to use 3 address frame format), and replaces destination MAC address with address from mapping table for frames received from AP. IPv4-to-MAC mappings are built also for VLAN encapsulated frames.
  • single MAC address translation for the rest of protocols — station learns source MAC address from first forwarded non-IPv4 frame and uses it as default for reverse translation — this MAC address is used to replace destination MAC address for frames received from AP if IPv4-to-MAC mapping can not be performed (e.g. — non-IPv4 frame or missing mapping).
Читайте также:  Wifi direct windows 10 пароль

This mode is limited to complete L2 bridging of data to single device connected to station (by means of single MAC address translation) and some support for IPv4 frame bridging — bridging of non-IP protocols to more than one device will not work. Also MAC address translation limits access to station device from AP side to IPv4 based access — the rest of protocols will be translated by single MAC address translation and will not be received by station itself.

This mode is available for all protocols except nv2 and should be avoided when possible. The usage of this mode can only be justified if AP does not support better mode for L2 bridging (e.g. when non-RouterOS AP is used) or if only one end-user device must be connected to network by means of station device.

Mode station-pseudobridge-clone

This mode is the same as station-pseudobridge mode, except that it connects to AP using «cloned» MAC address — that is either address configured in station-bridge-clone-mac parameter (if configured) or source address of first forwarded frame. This essentially appears on AP as if end-user device connected to station connected to AP.

Mode station-bridge

This mode works only with RouterOS APs and provides support for transparent protocol-independent L2 bridging on the station device. RouterOS AP accepts clients in station-bridge mode when enabled using bridge-mode parameter. In this mode, the AP maintains a forwarding table with information on which MAC addresses are reachable over which station device.

This mode is MikroTik proprietary and cannot be used to connect to other brands of devices.

This mode is safe to use for L2 bridging and is the preferred mode unless there are specific reasons to use station-wds mode. With station-bridge mode, it is not possible to connect to CAPsMAN controlled CAP.

Читайте также:  Плохой wifi от мгтс

Источник

ESP8266 Урок 14. Wi-Fi. Режим STA (Станция)

Ну вот, наконец-то, дошли мы до той темы, к которой стремились и ради чего начинался цикл уроков по контроллерам ESP8266 — это приём и передача данных при помощи возможностей ESP8266 по беспроводной сети Wi-Fi.

Я думаю, что все знают, что это за тип сети и для чего она применяется.

Напомню лишь, что Wi-Fi — это протокол передачи данных, осуществляемой без применения проводов, физического уровня.

Как именно передаются данные по сети и как они подготавливаются, как заворачиваются в протоколы различного уровня, мы также очень хорошо знаем. Кто не помнит, напомню — смотрите уроки 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52 по программированию контроллеров AVR, а также аналогичные уроки по контроллерам STM32. В данных уроках мы очень подробно рассмотрели многие протоколы всех уровней модели OSI. Те же самые протоколы будут использоваться и здесь, причём нам особо не придётся их программировать вручную, но знать, как они устроены, для чего нужны, мы обязаны, чтобы избежать ошибок при передаче данных, а также, если они и возникнут, то оперативно их устранить. И рассмотренных нами протоколов нам не потребуется протокол физического уровня Ethernet, его заменит протокол Wi-Fi.

Мы пока подробно не будем изучать протокол Wi-Fi, так как с ним работает наш контроллер аппаратно, но режимы работы мы должны знать. И знакомится с их разновидностями мы будем постепенно.

А пока мы должны знать, что наш контроллер ESP8266 поддерживает три основных режима работы — станция (Station mode или кратко STA), программная точка доступа (SoftAP), а также смешанный — Station + SoftAP.

Самым простым из этих режимов является первый — режим станции.

Режим станции (STA) — это такой режим, в котором контроллер не создает собственную сеть, а подключается к любой существующей сети Wi-Fi, например, к существующей локальной сети или к другому устройству, работающему в режиме точки доступа (AP).

На данном уроке мы настроим режим станции и попробуем подключиться к существующей точке доступа, например к роутеру, который раздаёт Wi-Fi по дому. Роутер от просто точки доступа отличается тем, что трафик, идущий от станций, подключенных к нему, он транслирует во внешнюю сеть и наоборот.

Пока воспользуемся возможностями SDK, то есть не будем лезть глубоко в дебри аппаратной части. Всему своё время.

Схема у нас будет простейшая — отладочная плата, подключенная к USB компьютера

Весь процесс соединения с точкой доступа и вхождение в различные стадии соединения мы будем отслеживать с помощью терминальной программы с помощью UART.

Проект наш выполнен из проекта прошлого урока с именем OS_TIMER и назван WIFI_STA.

Откроем наш проект в Eclipse и в файле main.c подключим библиотеку для работы с UART

Источник

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