--
You received this message because you are subscribed to the Google Groups "mininet-wifi-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mininet-wifi-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mininet-wifi-discuss/1b50ecc0-efa7-4c78-a636-3d8a1cb5fb75n%40googlegroups.com.
Problem: checking max bitrate of a link using sta1 iw dev sta1-wlan0 link gives a one of the following for every position of stations which are moving in hte network. {1,6,x}
x here is dependent on the MCS. It is varying for each time i restart my VM. As long as it doesn't restart, i get a constant x. example: for MCS 15, 130Mbps
Things I have tried:
1: set a random seed in addition to setting seeds for mobility in my topology file, node.py, mobility.py files.
2: setTxParam:mcs_values = [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5] # Example MCS indices for ap, mcs in zip(aps, mcs_values): ap.setTxParam('mcs', mcs)
Error: AttributeError: 'OVSAP' object has no attribute 'setTxParam'
3: iw command with vht-mcs-5:
mcs_to_bitrate = {
0: '6.5', 1: '13', 2: '19.5', 3: '26',
4: '39', 5: '52', 6: '58.5', 7: '65',
8: '78', 9: '104', 10: '117', 11: '130',
12: '156', 13: '208', 14: '234', 15: '260'
}
mcs_value = 15 # MCS index 15 for 130 Mbps
for ap in APs:
bitrate = mcs_to_bitrate[mcs_value]
cmd = f"iw dev {ap.name}-wlan0 set bitrates vht-mcs-5 {mcs_value}"
ap.cmd(cmd)
Didn't work.
4: iw After Starting the Network
didn't work
5: setting mcs when adding APs, realized there may be a problem with the interface used with iw dev, so included both wlan0 and wlan1 interfaces. made the following changes:
# Add APs with specific channel, mode, and range
APLengths = [5, 9, 14, 21]
for i in range(4):
sta = net.addStation(f"sta{i+1}", ip=f"10.0.0.{i+1}", min_x=-50, max_x=150, min_y=-50, max_y=150, min_v=0.60, max_v=0.65,
freq_list='2.412,5.2', mode='g,ax5', staLength=STALengths[j], apLength=APLengths[ap_index], range=58)
stas.append(sta)
for i in range(APLengths[ap_index]):
if i == 0:
AP = net.addAccessPoint(f"ap{i+1}", cls=OVSKernelAP, ssid=f'ap{i+1}-ssid',
channel=1, mode='g', position=positions[i], range=150)
else:
AP = net.addAccessPoint(f"ap{i+1}", cls=OVSKernelAP, ssid=f'ap{i+1}-ssid',
channel=APChannelList[i-1], ht_capab='[HE20][SHORT-GI-20]', mode='ax5', position=positions[i], range=60)
APs.append(AP)
iw command after starting the network:
net.build()
c1.start()
for i in range(1, len(APs)): # Starts from AP2 to AP14 (index 1 to 13)
ap = APs[i]
ap.start([c1])
for iface in ['wlan0', 'wlan1']:
response = ap.cmd(f"iw dev {ap.name}-{iface} link")
if 'Not connected.' not in response:
# Set the desired MCS index value. Here using HE MCS index 11 for 130 Mbps.
mcs_value = 11
ap.cmd(f"iw dev {ap.name}-{iface} set bitrates he-mcs-5g {mcs_value}")
info(f"Set MCS {mcs_value} on {ap.name}-{iface} for ~130 Mbps\n")
break
Didnt work.
6: to check for possible wireless Interface consistency, changed the iw command to iterate over all wireless interfaces (wintfs) of the access points and check the name.
Command for Setting MCS: Used he-mcs-5 directly without mentioning specific interfaces like wlan0 or wlan1 based on interfaces present on access points.
used hasattr to check if iface has the attribute name before trying to access it.
for i in range(1, len(APs)): # Starts from AP2 to AP14 (index 1 to 13)
ap = APs[i]
ap.start([c1])
info(f"Interfaces for {ap.name}: {ap.wintfs}\n")
# Correctly access each interface of AP
for iface in ap.wintfs:
info(f"Interface: {iface}, type: {type(iface)}, name: {iface.name if hasattr(iface, 'name') else 'N/A'}\n")
if hasattr(iface, 'name') and 'wlan' in iface.name:
mcs_value = 11 # Desired MCS index value for ~130 Mbps in 802.11ax
ap.cmd(f"iw dev {iface.name} set bitrates he-mcs-5 {mcs_value}")
info(f"Set MCS {mcs_value} on {iface.name} for ~130 Mbps\n")
No use. MCS not being fixed.
7: Given that the MCS value isn't being applied as expected, wanted to verify if an issue with either the specific commands or the timing and context in which they are applied. steps:
Ensure the iw commands are run after the APs are fully initialized.
Check the output of each iw command execution to verify if there are any errors.
using sleep to ensure commands are applied after initialization.
info("*** Starting network\n")
net.build()
c1.start()
# Ensure APs are initialized and started
for ap in APs:
ap.start([c1])
# Adding a sleep to ensure everything is initialized
time.sleep(5)
for i in range(1, len(APs)): # Starts from AP2 to AP14 (index 1 to 13)
ap = APs[i]
# Ensuring we directly access the wlan interface if available
if hasattr(ap, 'wintfs'):
for iface in ap.wintfs.values():
iface_name = iface.name if hasattr(iface, 'name') else 'null'
info(f"Setting MCS for {iface_name}")
if 'wlan' in iface_name:
mcs_value = 11 # Desired MCS index value for ~130 Mbps in 802.11ax
cmd_result = ap.cmd(f"iw dev {iface_name} set bitrates he-mcs-5 {mcs_value}")
info(f"Set MCS {mcs_value} on {iface_name} for ~130 Mbps\n")
info(f"Command result: {cmd_result}")
# Verify set bitrates
verify_result = ap.cmd(f"iw dev {iface_name} link")
info(f"Verification result for {iface_name}:\n{verify_result}")
info("*** Running CLI\n")
CLI(net)\
info("*** Stopping network\n")
Output of the debugging:
Setting MCS for ap2-wlan1Set MCS 11 on ap2-wlan1 for ~130 Mbps
Command result: command failed: Invalid argument (-22)
Verification result for ap2-wlan1:
Not connected.
Notes: my output suggests mobility.py and node.py files are being run before going to the part of the code where MCS is being set.
Moreover, my output suggests mobility.py and node.py files are being run before going to the part of the code where MCS is being set.
8:
cmd_result = ap.cmd(f"iw dev {iface_name} set bitrates he-mcs-5 {mcs_value}")iw dev command is returning an "Invalid argument" error, indicating that the parameters or the command itself might not be compatible with current setup.
Using iw list to check the detailed capabilities of interfaces. Ensuring any adjustments comply with the listed capabilities.
code:for iface in ap.wintfs.values():
iface_name = iface.name if hasattr(iface, 'name') else 'null'
if 'wlan' in iface_name:
info(f"Capabilities for {iface_name}")
capabilities_dump = ap.cmd(f"iw dev {iface_name} info")
info(f"Capabilities for {iface_name}:\n{capabilities_dump}")
# Attempt to set bitrates (trying with different MCS)
mcs_value = 11
cmd_result = ap.cmd(f"iw dev {iface_name} set bitrates he-mcs-5 {mcs_value}")
info(f"Set MCS {mcs_value} on {iface_name} for ~130 Mbps\n")
info(f"Command result: {cmd_result}")
# Verify set bitrates
verify_result = ap.cmd(f"iw dev {iface_name} link")
info(f"Verification result for {iface_name}:\n{verify_result}")
Output:
Capabilities for ap2-wlan1Capabilities for ap2-wlan1:
Interface ap2-wlan1
ifindex 537
wdev 0xa700000001
addr 02:00:00:00:05:00
ssid ap2-ssid
type AP
wiphy 167
channel 36 (5180 MHz), width: 20 MHz, center1: 5180 MHz
txpower 2.00 dBm
Set MCS 11 on ap2-wlan1 for ~130 Mbps
Command result: command failed: Invalid argument (-22)
Verification result for ap2-wlan1:
Not connected.
9: changed the schemes to ht-mcs, vht-mcs, and he-mcs and corresponding modes of APs.
No change.
10: changed to legacy bitrate 54Mbps, iw dev {iface_name} set bitrates legacy-5 {legacy_rate}. Used ht_capab='[SHORT-GI-20]', mode='a' in addAccessPoint for the 5GHZ APs.
No change
I wasn't sure why it didn't work. I was checking for step 4 using the iw dev sta1-wlan0 command. . I have noticed that the simulation is pretty asynchronous through the output in my command window. Mobility.py is being called before the print statements from the for loop with iw dev {ap.name}-wlan0 set bitrates vht-mcs-5 {mcs_value} were shown. Apart from this, to figure out the cause of why it was not working, I have done the other subsequent steps.
Problem: checking max bitrate of a link using sta1 iw dev sta1-wlan0 link gives a one of the following for every position of stations which are moving in hte network. {1,6,x}
x here is dependent on the MCS. It is varying for each time i restart my VM. As long as it doesn't restart, i get a constant x. example: for MCS 15, 130Mbps
Things I have tried:
1: set a random seed in addition to setting seeds for mobility in my topology file, node.py, mobility.py files.
2: setTxParam:mcs_values = [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5] # Example MCS indices for ap, mcs in zip(aps, mcs_values): ap.setTxParam('mcs', mcs)
Error: AttributeError: 'OVSAP' object has no attribute 'setTxParam'
3: iw command with vht-mcs-5:
mcs_to_bitrate = {
0: '6.5', 1: '13', 2: '19.5', 3: '26',
4: '39', 5: '52', 6: '58.5', 7: '65',
8: '78', 9: '104', 10: '117', 11: '130',
12: '156', 13: '208', 14: '234', 15: '260'
}
mcs_value = 15 # MCS index 15 for 130 Mbps
for ap in APs:
bitrate = mcs_to_bitrate[mcs_value]
cmd = f"iw dev {ap.name}-wlan0 set bitrates vht-mcs-5 {mcs_value}"
ap.cmd(cmd)
Didn't work.
4: iw After Starting the Network
didn't work
5: setting mcs when adding APs, realized there may be a problem with the interface used with iw dev, so included both wlan0 and wlan1 interfaces. made the following changes:
# Add APs with specific channel, mode, and range
APLengths = [5, 9, 14, 21]
for i in range(4):
sta = net.addStation(f"sta{i+1}", ip=f"10.0.0.{i+1}", min_x=-50, max_x=150, min_y=-50, max_y=150, min_v=0.60, max_v=0.65,
freq_list='2.412,5.2', mode='g,ax5', staLength=STALengths[j], apLength=APLengths[ap_index], range=58)
stas.append(sta)
for i in range(APLengths[ap_index]):
if i == 0:
Here are the detailed steps for step4 with the code
initialize 4 stations with following specifications:
APLengths = [5, 9, 14, 21]
APChannelList = [36, 40, 44, 48, 149, 153, 157, 161, 36, 165, 36, 40, 44, 48, 149, 153, 157, 161, 165, 36, 40]
sta = net.addStation(f"sta{i+1}", ip = f"10.0.0.{i+1}", min_x=-50, max_x=150, min_y=-50, max_y=150, min_v=0.60, max_v=0.65, freq_list='2.412,5.2', mode='g,ax5', staLength = 4, apLength=14, range=58)Initialize 14 APs, with ap1 operating in 2.4GHz mode g, range 150 and remaining APs operating 5GHz mode ax5 range 60:
for i in range(14):
if i == 0:
AP = net.addAccessPoint(f"ap{i+1}", cls=OVSKernelAP, ssid=f'ap{i+1}-ssid',
channel=1, mode='g', position=positions[i], range=150)
else:
AP = net.addAccessPoint(f"ap{i+1}", cls=OVSKernelAP, ssid=f'ap{i+1}-ssid',
channel=APChannelList[i-1], ht_capab='[HE20][SHORT-GI-20]', mode='ax5', position=positions[i], range=60)
APs.append(AP)
add controllerconfigure wifi nodescreate links
info("*** Creating links\n")
for i in range(APLengths[ap_index]-1):
net.addLink(APs[i], APs[i+1])plot graphset mobility modelif '-s' not in args:
net.setMobilityModel(time=0, model='RandomDirection', min_x=-50, min_y=-50, max_x=150, max_y=150, seed=6)start network and use iw to set mcs:
info("*** Starting network\n")
net.build()
c1.start()
for ap in APs:
ap.start([c1])
for iface in ['wlan0', 'wlan1']:
response = ap.cmd(f"iw dev {ap.name}-{iface} link")
if 'Not connected.' not in response:
info("*** Running CLI\n")
CLI(net)
info("*** Stopping network\n")
net.stop()if __name__ == '__main__':
setLogLevel('info')
netTopo.topology(sys.argv)