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.