Hi I have a question about yanserrorratemodel

368 views
Skip to first unread message

鄒明緯

unread,
Jan 29, 2015, 8:48:34 AM1/29/15
to ns-3-...@googlegroups.com
 Hi I am a beginner about linux and NS3. Here I want to give attribute to my YansErrorRateModel but I failed.
Following is my code:

...

YansWifiPhyHelper wifiPhy ;

 YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();

 wifiPhy.SetErrorRateModel("ns3::YansErrorRateModel",

     "WifiMode",EnumValue(WIFI_MOD_CLASS_ERP_OFDM),

     "snr",DoubleValue(10.0),

     "nbits",UintegerValue(8)

 );

...


The error message is "msg="Invalid attribute set (WifiMode) on ns3::YansErrorRateModel", file=../src/core/model/object-factory.cc, line=69

terminate called without an active exception"

I think I am giving wrong attribute of the class ns3::YansErrorRateModel::GetChunkSuccessRate but I don't know what is right definition attribute of (WifiMode mode, double snr, uint32_t nbits)

I am modifying the channel model in mesh.cc. How can I fix my code??

Thanks for helping !!!!

Konstantinos

unread,
Jan 29, 2015, 8:59:47 AM1/29/15
to ns-3-...@googlegroups.com
Hi,

Please study the NS-3 documentation one more time.
YansErrorRateModel class does not have any attribute. 
The GetChunkSuccessRate() is a method of that class, not a class. It will be called 'automatically' when calculating the error.
Message has been deleted

鄒明緯

unread,
Jan 29, 2015, 10:06:43 AM1/29/15
to ns-3-...@googlegroups.com
Hi, I read the NS-3 documentation again and Ihave a question about where can I change the parameter??

Parameters

mode the Wi-Fi mode the chunk is sent
snrthe SNR of the chunk
nbitsthe number of bits in this chunk



double snr =30;
uint32_t FrameSize = 1000;
Ptr<YansErrorRateModel> yans = CreateObject<YansErrorRateModel>();
yans->GetChunkSuccessRate(WifiMode("ErpOfdmRate54Mbps"),pow(10.0, snr / 10.0), FrameSize * 8);





like this kind of codes can modify the yanserrormodel?

Sorry for the beginner question. Thanks for your helping!!

鄒明緯於 2015年1月29日星期四 UTC+8下午9時48分34秒寫道:

Konstantinos

unread,
Jan 29, 2015, 10:23:31 AM1/29/15
to ns-3-...@googlegroups.com
Hi,

See the example code in examples/wireless/ofdm-validation.cc on how you can use it.
This example shows/validates that the ErrorModels (Yans/Nist) are working as expected.

Sebastien Deronne

unread,
Jan 29, 2015, 10:53:02 AM1/29/15
to ns-3-...@googlegroups.com
What do you really want to do?

There are indeed no attributes for YansErrorRateModel or NistErrorRateModel, because they provide PHY layer abstraction models, and do not need to be modified.

If you want another PHY abstraction model than Nist or Yans, you need to implement it by yourself.

鄒明緯

unread,
Jan 31, 2015, 3:38:26 AM1/31/15
to ns-3-...@googlegroups.com
hi, Here is what  Iwant to do. I want to set error rate model in example mesh.cc observe the relationship between snr and BER in mesh report.
Following is the channel code part that I modified l in mesh.cc

nodes.Create (m_ySize*m_xSize);

 // Configure YansWifiChannel

 Ptr <YansErrorRateModel> yans = CreateObject<YansErrorRateModel> ();

 double snr = -3;

 yans->GetChunkSuccessRate (WifiMode ("OfdmRate54Mbps"), std::pow (10.0,snr/10.0), m_packetSize*8);

 YansWifiPhyHelper wifiPhy ;

 YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();

 wifiPhy.SetChannel (wifiChannel.Create ());

 wifiPhy.SetErrorRateModel("ns3::YansErrorRateModel");


I also include the header file. I want to know that how can I observe the BER affects in mesh.cc and am I successfully changing the BER by changing the SNR ???

Thanks for helping!!!



鄒明緯於 2015年1月29日星期四 UTC+8下午9時48分34秒寫道:

Sebastien Deronne

unread,
Jan 31, 2015, 9:19:17 AM1/31/15
to ns-3-...@googlegroups.com
Please have a look at examples/wireless/ofdm-validation.cc and examples/wireless/ht-ofdm-validation.cc
Those are drawing the curves FER versus SNR for both Yans and Nist models.
Reply all
Reply to author
Forward
0 new messages