I was trying to find any information (in tutorial and in the ns-3-users group) about manual association of StaWifiMac (wifi station) with a target ApWifiMac (wifi AP) if more than one within the range, but couldn't.
There is some information here (
https://groups.google.com/forum/#!topic/ns-3-users/mpD1DNfXYmE), although this question was asked ~4 years ago.
According to the discussion in this link "AP and STA with the same ns-3 channel and the same WiFi channel (if you're using Yans) will be considered as already associated", what if 2 AP are within the range of the STA? What will be the choice logic? The best SNR?
The StaWifiMac (
https://www.nsnam.org/docs/release/3.28/doxygen/classns3_1_1_sta_wifi_mac.html#a1253ad1bd7821a1aedab2a7c847993b9) class has methods related to association such as SendAssocitationRequest(), for example, but they are all private. Here (
https://groups.google.com/forum/#!topic/ns-3-users/aw01JC6qBLY) there is some code:
void StaWifiMac::SetNewAssociation (Mac48Address Addr)
{
m_linkDown ();
SetState (WAIT_ASSOC_RESP);
SetBssid(Addr);
SendAssociationRequest ();
if (!m_linkUp.IsNull ())
{
m_linkUp ();
}
}
which makes it possible to use for association with a target AP by a mac address. Is there an already existing method to associate STA with the target AP statically (in the code) or the choice of the AP is completely automatic currently? Or it can be done only by choosing different channels - then STA would have the only choice for connection?