Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Setting up wireless connection using iwd (HT/VHT enabled)

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
dlacx
Posts: 24
Joined: 2020-01-24 03:48
Has thanked: 7 times
Been thanked: 1 time

[Solved] Setting up wireless connection using iwd (HT/VHT enabled)

#1 Post by dlacx »

Hello,
I just tried to setup a local PC, using iwd (first time, just to learning purpose) as wireless connection manager (fix IP, Debian 12,
adapter driver from https://github.com/cilynx/rtl88x2bu).
Connection established successfully:

Code: Select all

root@testpc1:~# iwctl adapter list
                                    Adapters                                   
--------------------------------------------------------------------------------
  Name      Powered   Vendor                Model               
--------------------------------------------------------------------------------
  phy0      on        TP-Link               Archer T4U ver.3

root@testpc1:~# iwctl device list
                                    Devices                                    
--------------------------------------------------------------------------------
  Name                  Address               Powered     Adapter     Mode      
--------------------------------------------------------------------------------
  wlx2887ba1fd809       28:87:ba:1f:d8:09     on          phy0        station

root@testpc1:~# iw dev wlx2887ba1fd809 info
Interface wlx2887ba1fd809
	ifindex 3
	wdev 0x1
	addr 28:87:ba:1f:d8:09
	ssid TCRT-CLS5
	type managed
	wiphy 0
	channel 136 (5680 MHz), width: 20 MHz (no HT), center1: 5680 MHz
	txpower 26.00 dBm
	multicast TXQ:
		qsz-byt	qsz-pkt	flows	drops	marks	overlmt	hashcol	tx-bytes	tx-packets
		0	0	0	0	0	0	0	0		0
but with no HT/VHT capabilities utilized. It seems iwd knows VHT:

Code: Select all

root@testpc1:~# systemctl status iwd
...
Feb 24 07:34:29 testpc1 iwd[1442]:                 VHT Capabilities:
Feb 24 07:34:29 testpc1 iwd[1442]:                         Short GI for 80Mhz
Feb 24 07:34:29 testpc1 iwd[1442]:                         Max RX MCS: 0-9 for NSS: 2
Feb 24 07:34:29 testpc1 iwd[1442]:                         Max TX MCS: 0-9 for NSS: 2
Feb 24 07:34:29 testpc1 iwd[1442]:         Ciphers: BIP-CMAC-256 BIP-GMAC-256 BIP-GMAC-128 CCMP-256
Feb 24 07:34:29 testpc1 iwd[1442]:                  GCMP-256 GCMP-128 BIP-CMAC-128 CCMP-128
Feb 24 07:34:29 testpc1 iwd[1442]:                  TKIP
Feb 24 07:34:29 testpc1 iwd[1442]:         Supported iftypes: ad-hoc station ap
Feb 24 07:34:29 testpc1 iwd[1442]: Wiphy phy0 will only use the default interface
Feb 24 07:38:23 testpc1 iwd[1442]: hardware_rekey not supported
Adapter has capabilities (TL;DR) :

Code: Select all

root@testpc1:~# iw phy
Wiphy phy0
	wiphy index: 0
	max # scan SSIDs: 4
	max scan IEs length: 2243 bytes
	max # sched scan SSIDs: 0
	max # match sets: 0
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports T-DLS.
	Supported Ciphers:
		* WEP40 (00-0f-ac:1)
		* WEP104 (00-0f-ac:5)
		* TKIP (00-0f-ac:2)
		* CCMP-128 (00-0f-ac:4)
		* CCMP-256 (00-0f-ac:10)
		* GCMP-128 (00-0f-ac:8)
		* GCMP-256 (00-0f-ac:9)
		* CMAC (00-0f-ac:6)
		* CMAC-256 (00-0f-ac:13)
		* GMAC-128 (00-0f-ac:11)
		* GMAC-256 (00-0f-ac:12)
	Available Antennas: TX 0x3 RX 0x3
	Configured Antennas: TX 0x3 RX 0x3
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * mesh point
	Band 1:
		Capabilities: 0x196f
			RX LDPC
			HT20/HT40
			SM Power Save disabled
			RX HT20 SGI
			RX HT40 SGI
			RX STBC 1-stream
			Max AMSDU length: 7935 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 2 usec (0x04)
		HT Max RX data rate: 300 Mbps
		HT TX/RX MCS rate indexes supported: 0-15, 32
		Bitrates (non-HT):
			* 1.0 Mbps
			* 2.0 Mbps
			* 5.5 Mbps
			* 11.0 Mbps
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 2412 MHz [1] (20.0 dBm)
			* 2417 MHz [2] (20.0 dBm)
			* 2422 MHz [3] (20.0 dBm)
			* 2427 MHz [4] (20.0 dBm)
			* 2432 MHz [5] (20.0 dBm)
			* 2437 MHz [6] (20.0 dBm)
			* 2442 MHz [7] (20.0 dBm)
			* 2447 MHz [8] (20.0 dBm)
			* 2452 MHz [9] (20.0 dBm)
			* 2457 MHz [10] (20.0 dBm)
			* 2462 MHz [11] (20.0 dBm)
			* 2467 MHz [12] (20.0 dBm)
			* 2472 MHz [13] (20.0 dBm)
			* 2484 MHz [14] (disabled)
	Band 2:
		Capabilities: 0x196f
			RX LDPC
			HT20/HT40
			SM Power Save disabled
			RX HT20 SGI
			RX HT40 SGI
			RX STBC 1-stream
			Max AMSDU length: 7935 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 2 usec (0x04)
		HT Max RX data rate: 300 Mbps
		HT TX/RX MCS rate indexes supported: 0-15, 32
		VHT Capabilities (0x03d071b2):
			Max MPDU length: 11454
			Supported Channel Width: neither 160 nor 80+80
			RX LDPC
			short GI (80 MHz)
			TX STBC
			SU Beamformee
			MU Beamformee
			+HTC-VHT
		VHT RX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT RX highest supported: 780 Mbps
		VHT TX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT TX highest supported: 780 Mbps
		VHT extended NSS: not supported
		Bitrates (non-HT):
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 5180 MHz [36] (23.0 dBm)
			* 5200 MHz [40] (23.0 dBm)
			* 5220 MHz [44] (23.0 dBm)
			* 5240 MHz [48] (23.0 dBm)
			* 5260 MHz [52] (20.0 dBm) (radar detection)
			* 5280 MHz [56] (20.0 dBm) (radar detection)
			* 5300 MHz [60] (20.0 dBm) (radar detection)
			* 5320 MHz [64] (20.0 dBm) (radar detection)
			* 5500 MHz [100] (26.0 dBm) (radar detection)
			* 5520 MHz [104] (26.0 dBm) (radar detection)
			* 5540 MHz [108] (26.0 dBm) (radar detection)
			* 5560 MHz [112] (26.0 dBm) (radar detection)
			* 5580 MHz [116] (26.0 dBm) (radar detection)
			* 5600 MHz [120] (26.0 dBm) (radar detection)
			* 5620 MHz [124] (26.0 dBm) (radar detection)
			* 5640 MHz [128] (26.0 dBm) (radar detection)
			* 5660 MHz [132] (26.0 dBm) (radar detection)
			* 5680 MHz [136] (26.0 dBm) (radar detection)
			* 5700 MHz [140] (26.0 dBm) (radar detection)
			* 5720 MHz [144] (13.0 dBm) (radar detection)
			* 5745 MHz [149] (13.0 dBm)
			* 5765 MHz [153] (13.0 dBm)
			* 5785 MHz [157] (13.0 dBm)
			* 5805 MHz [161] (13.0 dBm)
			* 5825 MHz [165] (13.0 dBm)
	Supported commands:
		 * new_interface
		 * set_interface
		 * new_key
		 * start_ap
		 * new_station
		 * new_mpath
		 * set_mesh_config
		 * set_bss
		 * authenticate
		 * associate
		 * deauthenticate
		 * disassociate
		 * join_ibss
		 * join_mesh
		 * remain_on_channel
		 * set_tx_bitrate_mask
		 * frame
		 * frame_wait_cancel
		 * set_wiphy_netns
		 * set_channel
		 * tdls_mgmt
		 * tdls_oper
		 * probe_client
		 * set_noack_map
		 * register_beacons
		 * start_p2p_device
		 * set_mcast_rate
		 * connect
		 * disconnect
		 * set_qos_map
		 * set_multicast_to_unicast
		 * set_sar_specs
	software interface modes (can always be added):
		 * AP/VLAN
		 * monitor
	interface combinations are not supported
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	Device supports TX status socket option.
	Device supports HT-IBSS.
	Device supports SAE with AUTHENTICATE command
	Device supports scan flush.
	Device supports per-vif TX power setting
	Driver supports full state transitions for AP/GO clients
	Driver supports a userspace MPM
	Device supports configuring vdev MAC-addr on create.
	Device supports randomizing MAC-addr in scans.
	max # scan plans: 1
	max scan plan interval: -1
	max scan plan iterations: 0
	Supported TX frame types:
		 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
	Supported RX frame types:
		 * IBSS: 0x40 0xb0 0xc0 0xd0
		 * managed: 0x40 0xb0 0xd0
		 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * mesh point: 0xb0 0xc0 0xd0
		 * P2P-client: 0x40 0xd0
		 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * P2P-device: 0x40 0xd0
	Supported extended features:
		* [ RRM ]: RRM
		* [ SET_SCAN_DWELL ]: scan dwell setting
		* [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
		* [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
		* [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
		* [ SCAN_RANDOM_SN ]: use random sequence numbers in scans
		* [ CAN_REPLACE_PTK0 ]: can safely replace PTK 0 when rekeying
		* [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
		* [ DEL_IBSS_STA ]: deletion of IBSS station support
		* [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
		* [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
It seems wpa_supplicant (with Connman) perform configuration (switch ch and freq), and uses HT capabilities
(installed on same PC box):

Code: Select all

Feb 23 20:17:06 debian wpa_supplicant[1610]: wlx2887ba1fd809: CTRL-EVENT-DSCP-POLICY clear_all
Feb 23 20:17:06 debian wpa_supplicant[1610]: wlx2887ba1fd809: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Feb 23 20:18:26 debian wpa_supplicant[1610]: wlx2887ba1fd809: Trying to associate with 58:90:43:5b:1a:47 (SSID='DLJK-CLS5' freq=5680 MHz)
Feb 23 20:18:27 debian wpa_supplicant[1610]: wlx2887ba1fd809: CTRL-EVENT-STARTED-CHANNEL-SWITCH freq=5680 ht_enabled=1 ch_offset=-1 ch_width=40 MHz cf1=5670 cf2=0
Feb 23 20:18:27 debian wpa_supplicant[1610]: wlx2887ba1fd809: Associated with 58:90:43:5b:1a:47
Feb 23 20:18:27 debian wpa_supplicant[1610]: wlx2887ba1fd809: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Feb 23 20:18:27 debian wpa_supplicant[1610]: wlx2887ba1fd809: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=DE
Feb 23 20:18:27 debian wpa_supplicant[1610]: wlx2887ba1fd809: WPA: Key negotiation completed with 58:90:43:5b:1a:47 [PTK=CCMP GTK=CCMP]
Feb 23 20:18:27 debian wpa_supplicant[1610]: wlx2887ba1fd809: CTRL-EVENT-CONNECTED - Connection to 58:90:43:5b:1a:47 completed [id=0 id_str=]
So, my question is: Is it possible to configure (switch) connection using iwd (iwctl or iw), and Howto?
Sorry, I couldn't figure out it from iwd/iw docs. Or... forget iwd, and use old Connman+wpa_supplicant pair?
Thanks for any help,

Leslie
Last edited by dlacx on 2024-02-25 08:01, edited 1 time in total.

Aki
Global Moderator
Global Moderator
Posts: 2979
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 75 times
Been thanked: 407 times

Re: Setting up wireless connection using iwd (HT/VHT enabled)

#2 Post by Aki »

Hello,
dlacx wrote: 2024-02-24 08:56 I just tried to setup a local PC, using iwd (first time, just to learning purpose) as wireless connection manager (fix IP, Debian 12,
adapter driver from https://github.com/cilynx/rtl88x2bu).
Connection established successfully:
[..]
It seems wpa_supplicant (with Connman) perform configuration (switch ch and freq), and uses HT capabilities
[..]
So, my question is: Is it possible to configure (switch) connection using iwd (iwctl or iw), and Howto?
Sorry, I couldn't figure out it from iwd/iw docs. Or... forget iwd, and use old Connman+wpa_supplicant pair?
There are the involved WiFi protocols:
  • VHT corrisponds to IEEE 802.11ac-2013 (or or 802.11ac) [1]
  • HT corrisponds to IEEE 802.11n-2009 (or 802.11n) [2]
I've searched the iwd source code (Debian Bookworm version) for HT/VHT configurations, but haven't found any reference to user configurable parameters for HT/VHT. So my guess is that iwd automatically negotiates the best available connection based on the capabilities of your device and the access point (as it detects them).

If you wish, you can probably try forcing the wireless adapter kernel module to use VHT (if a capable access point is available). The following command shows the available kernel module parameters for 88x2bu.ko out-of-the-tree kernel module:

Code: Select all

$ /sbin/modinfo ./88x2bu.ko | grep -i ht
parm:           rtw_vht_enable:int
parm:           rtw_vht_rx_mcs_map:VHT RX MCS map (uint)
parm:           rtw_ht_enable:int
parm:           rtw_vht_2g4:Allow VHT rate on 2.4G channel.(0 for deny and 1 for allow) (int)
You are probably interested in the parameter rtw_vht_enable that, according to source code, can be used with these values (default = 1):

Code: Select all

os_dep/linux/os_intfs.c:int rtw_vht_enable = 1; /* 0:disable, 1:enable, 2:force auto enable */
Furthermore, as far as I know, the wpa_supplicant program negotiates the WiFi protocol through the underlying kernel module (rtl88x2bu in your case) used by the wireless adapter before negotiating the wpa connection. Therefore, wpa_supplicant.conf can be created and configured to force HT or VHT wifi protocols (details in /usr/share/doc/wpa_supplicant/) if it used.

if Connman+wpa_supplicant pair already works, it is perhaps your first choice.

Hope this helps. Please, let me know.

--
[1] Wikipedia - VHT - IEEE 802.11ac-2013 (or or 802.11ac)
[2] Wikipedia - HT - IEEE 802.11n-2009 (or 802.11n)
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

dlacx
Posts: 24
Joined: 2020-01-24 03:48
Has thanked: 7 times
Been thanked: 1 time

Re: Setting up wireless connection using iwd (HT/VHT enabled)

#3 Post by dlacx »

@Aki : Thank you for your quick answer. I received useful knowledge.
I was playing with iwd for a while. Gave up.
It would have been a smart solution if it worked. Connman+wpa_supplicant applied.
Btw. according to its changelog iwd has frequent updates. Maybe in future.
Thank you again.
L.

Aki
Global Moderator
Global Moderator
Posts: 2979
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 75 times
Been thanked: 407 times

Re: [Solved] Setting up wireless connection using iwd (HT/VHT enabled)

#4 Post by Aki »

Hello,

Glad to have helped

Happy Debian !
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Post Reply