wifi interference question

798 views
Skip to first unread message

minkyung park

unread,
Mar 13, 2015, 1:37:06 AM3/13/15
to ns-3-...@googlegroups.com


 Hello, I have a question.

I built a building, and put all nodes inside the building.

This is my topology. (There are N APs, and all APs and a source device are connected with each other (CSMA))

    AP1         AP2      ...       APn (802.11n wifi)
     |               |                     |
     --------------------------------------(CSMA channel)
        |
    source device


Source sends packets to the broadcast address. As soon as AP receives the packets, they forward the packets to connected stations.
 -->I used " Config::Connect ("/NodeList/APnodes/DeviceList/*/$ns3::CsmaNetDevice/MacRx", MakeBoundCallback (&PacketUpdate, recvSinkAp)); " (in PacketUpdate function)

I measured the throughput (like packet loss, data rate).
I thought that if the number of APs are increase, then the throughput would decrease, but didn't (it was not that different).
(I measured 1 APs, 2APs, 4APs, 8APs scenario)


I think it's because ns-3 does't support inter-channel interference, right?
Or i did something wrong?


minkyung park

unread,
Mar 13, 2015, 4:42:17 AM3/13/15
to ns-3-...@googlegroups.com

 Sorry, and thanks for reply

I referenced "wifi-simple-interference.cc" example

I created UDP sockets in every node, and Source device(in topology) send packets to broadcast (AP1, ... APn receives it) using Simulator::Schedule. (every 1seconds interval )

a packet size is 2048, max packets size is 6MB.


these are part of my code


 81 static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
 82         uint32_t totalPacketBytes, Time pktInterval )
 83 {
 87         if(totalPacketBytes <= pktSize){
 88             pktSize = totalPacketBytes;
 89             socket->Send (Create<Packet>(pktSize-32));
 90             totalPacketBytes -= pktSize;
 92         }
 93         else{
 94             socket->Send (Create<Packet>(pktSize-32));
 95             totalPacketBytes -= pktSize;
 97             Simulator::Schedule (pktInterval, &GenerateTraffic,
 98                     socket, pktSize, totalPacketBytes, pktInterval);
 99         }
.~~~~~
int main(){
~~~~~~ 
230     WifiHelper wifi = WifiHelper::Default ();
231     if(is5GHz)
232         wifi.SetStandard (WIFI_PHY_STANDARD_80211n_5GHZ);
233     else
234         wifi.SetStandard (WIFI_PHY_STANDARD_80211n_2_4GHZ);
235 
236     YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
237     channel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
238 
239     YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
240     HtWifiMacHelper mac = HtWifiMacHelper::Default();
241 
245     Ptr<YansWifiChannel> channelNum[nAp];
246     Ssid ssid = Ssid ("wifi-ssid");
247     for(uint32_t i=0; i<nAp; i++){
248         channelNum[i] = channel.Create ();
249 
250         //set AP
251         phy.SetChannel (channelNum[i]);
252         mac.SetType ("ns3::ApWifiMac", "Ssid", SsidValue (ssid));
253         wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", DataRate,
254                 "ControlMode", DataRate);
255 
256         apDevices.Add(wifi.Install (phy, mac, wifiApNodes.Get(i)));
257     }
.
.
.~~~
373     Ptr<Socket> source = Socket::CreateSocket (sourceNodes.Get(0), tid);
374     source->SetAllowBroadcast (true);
375 
376     Ipv4Address broadcastAddr = Ipv4Address("10.1.1.1").GetSubnetDirectedBroadcast("/24");
377     InetSocketAddress remote = InetSocketAddress (broadcastAddr, 7778);
378     source->Connect (remote);

402     Simulator::Schedule (Seconds (0.0), &GenerateTraffic,
403             source, packetSize, totalPacketBytes, interPacketInterval);
404 









2015년 3월 13일 금요일 오후 4시 9분 52초 UTC+9, Tommaso Pecorella 님의 말:
Too few info to not say anything plainly obvious.

T.

Tommaso Pecorella

unread,
Mar 13, 2015, 5:52:39 AM3/13/15
to ns-3-...@googlegroups.com
Been there, done that, discussed this topic too many times.

You're using a different channel instance for each AP. No interference is possible with this configuration.

T.

Tommaso Pecorella

unread,
Mar 13, 2015, 3:09:52 AM3/13/15
to ns-3-...@googlegroups.com
Too few info to not say anything plainly obvious.

T.

On Friday, March 13, 2015 at 6:37:06 AM UTC+1, minkyung park wrote:

Hendro Jio

unread,
Nov 12, 2017, 6:05:21 PM11/12/17
to ns-3-users
so.. Did NS3 can modelling the interference between 2 AP or more in same (overlapping) channel?

Tommaso Pecorella

unread,
Nov 14, 2017, 6:54:56 AM11/14/17
to ns-3-users
Yes, with the SpectrumWifiPhy.

See examples//wireless/wifi-spectrum-per-example.cc


T.

Con con

unread,
Jan 2, 2018, 2:45:15 PM1/2/18
to ns-3-users
Hello Tommaso,
I have written a simulation which is one AP and 4 wifi devices, which is more or less similar to /wifi-spectrum-per-example.cc. I did not used SpectrumWifiPhy but I used MonitorSnifferTx and YansWifiPhyRxDrop and compare the total packets transmitted to packets received so I calculate the interference. Do I have to use SpectrumWifiPhy  for this reason ?
thanks.
best regards!

Con con

unread,
Jan 2, 2018, 2:53:25 PM1/2/18
to ns-3-users
The actual question here is : what is the difference between 
SpectrumWifiPhy and YansWifiPhy ?
thanks

Tommaso Pecorella

unread,
Jan 3, 2018, 6:42:54 PM1/3/18
to ns-3-users
Hi,

the actual differences are:
1) SpectrumWifiPhy is slower.
2) SpectrumWifiPhy allows to calculate the interference between Wi-Fi and other technologies using the same frequencies (e.g., LTE-LAA and 802.15.4).

If you only have Wi-Fi, then YansWifiPhy is a good choice.

T.

Con con

unread,
Jan 8, 2018, 4:49:52 PM1/8/18
to ns-3-users
Hello Tommaso,
I am interested in the second point 
2) SpectrumWifiPhy allows to calculate the interference between Wi-Fi and other technologies using the same frequencies (e.g., LTE-LAA and 802.15.4).

Is there any example, or how can I implement that ? I mean interference between 802.11 and 802.15.4. 
thanks!

Con con

unread,
Dec 20, 2018, 11:38:32 AM12/20/18
to ns-3-users
Hello Tomasso,
I have attached an example which is one AP and multiple wifi nodes. I tried to find out how to measure interference between nodes of this example but it is not clear for me. 
I tried also to create another AP a different one with different ip and clients connected to that in the same channel expecting to see that throughput is decreased due to interference but with no success. The question is how can I add another ap in the same channel, and another AP in different channel which also may cause interference. ?? I am trying to find out this problem long time ago with no success. 
Thanks for help.
wifi-generic.cc
Reply all
Reply to author
Forward
0 new messages