TDMA MAC protocol in ns-3

4,927 views
Skip to first unread message

Hemanth

unread,
Jul 10, 2011, 11:58:11 PM7/10/11
to ns-3-users
Hi all,

We have implemented a TDMA MAC protocol in ns-3. It has a centralized
TDMA controller scheduling slots as per the slot assignment. Slot
assignment can be done either from the simulation script, through an
external file or by default each node will be allotted a slot. Please
let me know if anyone is willing to test it before I release it for
code review. Also, this TDMA is built upon a simle-wireless channel
model where the only parameter that the model requires is transmission
range of the node. So, all nodes within the specified transmission
range will receive the packet. This could be beneficial in testing
only the upper layer protocols without bothering about the effects of
the lower layers.

Thanks,
Hemanth,
Graduate Student
ITTC, The University of Kansas.

Jaume Barcelo

unread,
Jul 11, 2011, 7:10:23 AM7/11/11
to ns-3-...@googlegroups.com
Thanks for the offering, Hemanth. Is this simple wireless channel something that has been developed by your team?

Cheers,
Jaume

Hemanth

unread,
Jul 11, 2011, 4:30:01 PM7/11/11
to ns-3-users
No. It was developed by folks from The University of Washington. Tom
Henderson has provided us with this model when we requested for a
simple wireless model with just transmission range as its parameter.

Thanks,
Hemanth
Graduate Student
ITTC, The University of Kansas.

Tom Henderson

unread,
Jul 11, 2011, 7:06:25 PM7/11/11
to ns-3-users


On Jul 11, 1:30 pm, Hemanth <hemanthnarra...@gmail.com> wrote:
> No. It was developed by folks from The University of Washington. Tom
> Henderson has provided us with this model when we requested for a
> simple wireless model with just transmission range as its parameter.

See: http://code.nsnam.org/tomh/ns-3-simple-wireless/

Jaume Barcelo

unread,
Jul 12, 2011, 4:25:23 AM7/12/11
to ns-3-...@googlegroups.com
Thanks for the clarification. I may need this in the future, so it is a good thing to know that it exists :)

Cheers,
Jaume
Message has been deleted

Alok Bansal

unread,
Apr 14, 2013, 8:13:30 AM4/14/13
to ns-3-...@googlegroups.com
 Hi Hemanth,
Thanks for developing it. Can you please provide the code. I am new to this and learning CR and I think it will help me a lot in understanding CR.

Thanks
Alok

Ravikiran Bhonagiri

unread,
May 21, 2013, 6:21:15 AM5/21/13
to ns-3-...@googlegroups.com
Hi Hemanth,

ca you please send me the code TDMA MAC, it gonna help me a lot .

Thanks & Regards
Ravikiran Bhonagiri
IIT Kanpur,
India.

Harilaos Kanatsoulis

unread,
May 28, 2013, 1:40:21 PM5/28/13
to ns-3-...@googlegroups.com
Hi Hemanth,

thnx a lot for your work. it would be really helpful for me, i you could provide me the code.

thanking you in advance
Best,
Harilaos

Amir Reda

unread,
May 28, 2013, 2:04:47 PM5/28/13
to ns-3-...@googlegroups.com
here is the code that you need



--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Warmest regards and best wishes for a good health,urs sincerely
mero
simple-wireless-tdma.zip

Harilaos Kanatsoulis

unread,
May 28, 2013, 2:39:56 PM5/28/13
to ns-3-...@googlegroups.com
thnx a lot. I have a problem building it. do u know how to fix this??


--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/9ZD8VVXQP5s/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Amir Reda

unread,
May 28, 2013, 2:41:24 PM5/28/13
to ns-3-...@googlegroups.com
actually i have the same problem i'm trying to fix it but not yet

Harilaos Kanatsoulis

unread,
May 28, 2013, 3:47:58 PM5/28/13
to ns-3-...@googlegroups.com
i'm trying to fix it too. if you find the solution let me know. so do I

Harilaos Kanatsoulis

unread,
May 28, 2013, 4:02:27 PM5/28/13
to ns-3-...@googlegroups.com
i fixed it. what problem did you have?

Amir Reda

unread,
May 29, 2013, 5:29:00 AM5/29/13
to ns-3-...@googlegroups.com
dear all
i got this problem while compiling TDMA amiralex@amir-pc:~/ns-allinone-3.15/ns-3.15$ ./waf
Waf: Entering directory `/home/amiralex/ns-allinone-3.15/ns-3.15/build'
[ 854/1841] cxx: src/simple-wireless-tdma/model/tdma-mac-low.cc -> build/src/simple-wireless-tdma/model/tdma-mac-low.cc.1.o
../src/simple-wireless-tdma/model/tdma-mac-low.cc:34:34: fatal error: ns3/wifi-mac-trailer.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/home/amiralex/ns-allinone-3.15/ns-3.15/build'
Build failed
 -> task in 'ns3-simple-wireless-tdma' failed (exit status 1): 
{task 161833292: cxx tdma-mac-low.cc -> tdma-mac-low.cc.1.o}
['/usr/bin/g++', '-O3', '-g', '-Wall', '-Werror', '-march=native', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-Ibuild', '-I.', '-DHAVE_PACKET_H=1', '-DHAVE_DL=1', '-DHAVE_IF_TUN_H=1', '../src/simple-wireless-tdma/model/tdma-mac-low.cc', '-c', '-o', 'src/simple-wireless-tdma/model/tdma-mac-low.cc.1.o']

even though this file is exist in WIFI folder what should i do

Konstantinos

unread,
May 29, 2013, 5:34:20 AM5/29/13
to ns-3-...@googlegroups.com, amir...@msn.com
Check the wscript file of that model. If it is not included there, then ns-3 can't see it.

Konstantinos

unread,
May 29, 2013, 5:42:04 AM5/29/13
to ns-3-...@googlegroups.com, amir...@msn.com
Found the problem, it is in the wscript file of wifi module. You have to add as I said in the previous post, the 'model/wifi-mac-trailer.h', in the list of headers.

Mallesh Yadhav

unread,
Nov 12, 2013, 8:21:00 AM11/12/13
to ns-3-...@googlegroups.com, amir...@msn.com
Hi,

I am not able to find the header file in ns3 : simple-wireless-tdma-module.h

as in the above code : tdma-example.cc incluedes the above header file. I am not able to execute the code.


This header file should be there in the ns3 or the above code should contain the header file.

thanks!

Mallesh Yadhav

unread,
Nov 12, 2013, 8:23:13 AM11/12/13
to ns-3-...@googlegroups.com, amir...@msn.com


On Tuesday, 12 November 2013 18:51:00 UTC+5:30, Mallesh Yadhav wrote:
Hi,

I am not able to find the header file in ns3 : simple-wireless-tdma-module.h

as in the above code : tdma-example.cc incluedes the above header file. I am not able to execute the code.


This header file should be there in the ns3 or the above code should contain the header file???.

Amir Reda

unread,
Nov 13, 2013, 3:27:49 AM11/13/13
to ns-3-...@googlegroups.com

For more options, visit https://groups.google.com/groups/opt_out.
simple-wireless-channel.cc
tdma-mac-low.cc~
tdma-mac-low.h
tdma-mac-low.h~
tdma-mac-net-device.cc
tdma-mac-net-device.cc~
tdma-mac-net-device.h
tdma-mac-queue.cc
tdma-mac-queue.h
simple-wireless-channel.h
tdma-central-mac.cc
tdma-central-mac.h
tdma-controller.cc
tdma-controller.h
tdma-mac.cc
tdma-mac.h
tdma-mac-low.cc

Mallesh Yadhav

unread,
Nov 13, 2013, 5:08:34 AM11/13/13
to ns-3-...@googlegroups.com, amir...@msn.com
Hi,

Can you please tell how to use them in ns3.
I am new to ns3

Thanks!

Amir Reda

unread,
Dec 26, 2013, 6:35:45 AM12/26/13
to ns-3-...@googlegroups.com
just put the codes in the src folder and use ./waf

msis...@ualberta.ca

unread,
Feb 1, 2014, 6:38:58 PM2/1/14
to ns-3-...@googlegroups.com, amir...@msn.com
I put the simple-wireless-tdma folder in src folder and ran ./waf but it gives me error

mohammad@mohammad-laptop:~/repos/ns-3-allinone/ns-3-dev$ ./waf
Waf: Entering directory `/home/mohammad/repos/ns-3-allinone/ns-3-dev/build'
Traceback (most recent call last):
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Scripting.py", line 97, in waf_entry_point
    run_commands()
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Scripting.py", line 153, in run_commands
    ctx=run_command(cmd_name)
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Scripting.py", line 146, in run_command
    ctx.execute()
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Scripting.py", line 351, in execute
    return execute_method(self)
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Build.py", line 106, in execute
    self.execute_build()
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Build.py", line 109, in execute_build
    self.recurse([self.run_dir])
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Context.py", line 128, in recurse
    user_function(self)
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/wscript", line 716, in build
    bld.recurse('src')
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Context.py", line 128, in recurse
    user_function(self)
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/src/wscript", line 316, in build
    bld.recurse(list(all_modules))
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/.waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Context.py", line 128, in recurse
    user_function(self)
  File "/home/mohammad/repos/ns-3-allinone/ns-3-dev/src/simple-wireless-tdma/wscript", line 29, in build
    headers = bld.new_task_gen(features=['ns3header'])
AttributeError: 'BuildContext' object has no attribute 'new_task_gen

Please let me now how to build and run this code.

Thanks
Mohammad

ns3...@gmail.com

unread,
Feb 1, 2014, 7:31:22 PM2/1/14
to ns-3-...@googlegroups.com, amir...@msn.com
Hi,
To use these files I used the following steps;
1)- Go to the src folder and then created the module using command;
./create-module.py simple-wireless-tdma

details of module creation are available on the website:

2)-download the files from:

3)-place the files in the relevant folders.(e.g. model file to model and so on)

4)-replace the wscript file in that simple-wireless-tdma folder with a file having following information;

# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

# def options(opt):
#     pass

# def configure(conf):
#     conf.check_nonfatal(header_name='stdint.h', define_name='HAVE_STDINT_H')

def build(bld):
    module = bld.create_ns3_module('simple-wireless-tdma', ['network', 'propagation', 'core','internet', 'wifi', 'mesh', 'applications'])
    module.source = [
        'model/simple-wireless-channel.cc',
        'model/tdma-mac.cc',
        'model/tdma-central-mac.cc',
        'model/tdma-mac-net-device.cc',
        'model/tdma-mac-low.cc',
        'model/tdma-controller.cc',
        'model/tdma-mac-queue.cc',
        'helper/tdma-slot-assignment-parser.cc',
        'helper/tdma-controller-helper.cc',
        'helper/tdma-helper.cc',
        ]

    module_test = bld.create_ns3_module_test_library('simple-wireless-tdma')
    module_test.source = [
        'test/tdma-test.cc',
        ]

    headers = bld(features='ns3header')
    headers.module = 'simple-wireless-tdma'
    headers.source = [
        'model/simple-wireless-channel.h',
        'model/tdma-mac.h',
        'model/tdma-central-mac.h',
        'model/tdma-mac-net-device.h',
        'model/tdma-mac-low.h',
        'model/tdma-controller.h',
        'model/tdma-mac-queue.h',
        'helper/tdma-slot-assignment-parser.h',
        'helper/tdma-controller-helper.h',
        'helper/tdma-helper.h',  
        ]

    if bld.env.ENABLE_EXAMPLES:
        bld.recurse('examples')

    # bld.ns3_python_bindings()


5)-create a new simple-wireless-tdma-module.h file in build/ns3 folder having following information.

//simple-wireless-tdma-module.h
// Module headers:
#include "simple-wireless-channel.h"
#include "tdma-central-mac.h"
#include "tdma-controller-helper.h"
#include "tdma-controller.h"
#include "tdma-helper.h"
#include "tdma-mac-low.h"
#include "tdma-mac-net-device.h"
#include "tdma-mac-queue.h"
#include "tdma-mac.h"
#include "tdma-slot-assignment-parser.h"
#endif


6)-configure ns3 again using command;
./waf configure

7)-build ns3 using command;
./waf build

then run example.I hope it will be helpful.

best regards,

Tommaso Pecorella

unread,
Feb 2, 2014, 3:52:17 AM2/2/14
to ns-3-...@googlegroups.com, amir...@msn.com
All correct, but point 5 can be skipped safely.

Everything in the build directory is going to be overwritten when you do ./waf, so there's no point in manually adding something that will be built automatically.

Cheers,

T.

msis...@ualberta.ca

unread,
Feb 2, 2014, 3:12:45 PM2/2/14
to ns-3-...@googlegroups.com, amir...@msn.com
Sorry for the lame question. I have downloaded the tar archive and it contains tow folder named a and b. Which one should I use. Or should I download them individually?

Thanks

msis...@ualberta.ca

unread,
Feb 2, 2014, 3:24:40 PM2/2/14
to ns-3-...@googlegroups.com, amir...@msn.com
Hello,

I copied everything from folder b into simple-wireless-tdma as you have said. Doc, Examples, Helper, Module but when I try to build them it says

s3module.cc.7.o
../src/simple-wireless-tdma/model/tdma-central-mac.cc: In member function ‘virtual void ns3::TdmaCentralMac::DoStart()’:
../src/simple-wireless-tdma/model/tdma-central-mac.cc:398: error: ‘DoStart’ is not a member of ‘ns3::TdmaMac’
../src/simple-wireless-tdma/model/tdma-mac-net-device.cc: In member function ‘virtual void ns3::TdmaNetDevice::DoStart()’:
../src/simple-wireless-tdma/model/tdma-mac-net-device.cc:101: error: ‘class ns3::TdmaMac’ has no member named ‘Start’
../src/simple-wireless-tdma/model/tdma-mac-net-device.cc:102: error: ‘DoStart’ is not a member of ‘ns3::NetDevice’
Waf: Leaving directory `/home/mohammad/repos/ns-3-allinone/ns-3-dev/build'

Build failed
 -> task in 'ns3-simple-wireless-tdma' failed (exit status 1):
    {task 169733804: cxx tdma-central-mac.cc -> tdma-central-mac.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-I.', '-I..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_IF_TUN_H=1', '../src/simple-wireless-tdma/model/tdma-central-mac.cc', '-c', '-o', 'src/simple-wireless-tdma/model/tdma-central-mac.cc.1.o']

 -> task in 'ns3-simple-wireless-tdma' failed (exit status 1):
    {task 169733868: cxx tdma-mac-net-device.cc -> tdma-mac-net-device.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-I.', '-I..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_IF_TUN_H=1', '../src/simple-wireless-tdma/model/tdma-mac-net-device.cc', '-c', '-o', 'src/simple-wireless-tdma/model/tdma-mac-net-device.cc.1.o']

ns3 geek

unread,
Feb 2, 2014, 4:01:10 PM2/2/14
to ns-3-...@googlegroups.com
According to best of my knowledge in ns3.19 they have replaced the start() object function with initialize() and dostart with doinitialize(). i.e. you need to do following modification;

in tdma-mac-net-device.cc file:

  m_mac->start ();
  NetDevice::DoStart ();
with
  m_mac->Initialize ();
  NetDevice::DoInitialize ();

in tdma-central-mac.cc file:

  TdmaMac::DoStart ();
with
  TdmaMac::DoInitialize ();

in tdma-mac-net-device.cc file:

comment the line as realFrom is not used and ns3 treat all warnings as errors ;
  Mac48Address realFrom = Mac48Address::ConvertFrom (GetAddress ());


Note: this information is extracted from the modifications made by Tommaso Pecorella in the thread (special thanks to Tommaso Pecorella for all his help and time in modifying the code.)


I hope it will be helpful.
best regards,

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.

Amir Reda

unread,
Feb 3, 2014, 2:20:00 AM2/3/14
to ns-3-...@googlegroups.com
dear all
i have attached the folder of TDMA it is working with no errors with me hope this is helful
simple-wireless-tdma.tar.gz

Mohammad Islam

unread,
Feb 4, 2014, 10:40:21 PM2/4/14
to ns-3-...@googlegroups.com, amir...@msn.com
Thanks all. I have successfully built and ran the example. Though I had to modify some lines in the example because they were running old ns3 codes.

Mohammad

Mohammad Islam

unread,
Feb 4, 2014, 11:07:36 PM2/4/14
to ns-3-...@googlegroups.com, amir...@msn.com
Hi,

If I run the example script, the csv file shows that number of packet received is 0. I am running with default values.

Thanks
Mohammad


Message has been deleted

rajeev kumar

unread,
Nov 19, 2014, 9:27:12 AM11/19/14
to ns-3-...@googlegroups.com, hemanth...@gmail.com
Hi All,

I am trying to use this model to simulate my scenario. in my scenario, I want to provide link capacity and slot-time individually as all the link has different Shanon-capacity and to satisfy certain constraint it activity time is also different. I am adding devices by:
 
TdmaHelper tdma = TdmaHelper (allNodes.GetN (),allNodes.GetN ()); 
  //In this case selected, numSlots = nodes
  TdmaControllerHelper controller;
  controller.Set ("SlotTime", TimeValue (MicroSeconds (1000)));
  controller.Set ("GaurdTime", TimeValue (MicroSeconds (0)));
  controller.Set ("InterFrameTime", TimeValue (MicroSeconds (0)));
  NetDeviceContainer staDevices;
  for(uint16_t i=0 ; i < allNodes.GetN() ; i++)
  {
    std::ostringstream oss;
    oss << cap[i] << "Mbps";
    controller.Set ("DataRate", DataRateValue (oss.str()));
    tdma.SetTdmaControllerHelper (controller);
    NetDeviceContainer dev = tdma.Install (allNodes.Get(i));
    staDevices.Add(dev);
  }

But something is going wrong and its not giving me out put. When I am doing back-trace its showing:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff2768070 in typeinfo for ns3::AccessorHelper<ns3::SimpleWirelessChannel, ns3::DoubleValue> ()
   from /home/rajeevpnj/ns-allinone-3.21/ns-3.21/build/libns3.21-wifi-debug.so
(gdb) bt
#0  0x00007ffff2768070 in typeinfo for ns3::AccessorHelper<ns3::SimpleWirelessChannel, ns3::DoubleValue> ()
   from /home/rajeevpnj/ns-allinone-3.21/ns-3.21/build/libns3.21-wifi-debug.so
#1  0x00007ffff2393194 in ns3::TdmaController::ScheduleTdmaSession (this=0x708db0, slotNum=0) at ../src/wifi/model/tdma-controller.cc:273
#2  0x00007ffff239184d in ns3::TdmaController::StartTdmaSessions (this=0x708db0) at ../src/wifi/model/tdma-controller.cc:133
#3  0x00007ffff2394645 in ns3::EventImpl* ns3::MakeEvent<void (ns3::TdmaController::*)(), ns3::TdmaController*>(void (ns3::TdmaController::*)(), ns3::TdmaController*)::EventMemberImpl0::Notify() (this=0x705a00) at ./ns3/make-event.h:94
#4  0x00007fffeff955ed in ns3::EventImpl::Invoke (this=0x705a00) at ../src/core/model/event-impl.cc:45
#5  0x00007fffeff99eb6 in ns3::DefaultSimulatorImpl::ProcessOneEvent (this=0x705c80) at ../src/core/model/default-simulator-impl.cc:140
#6  0x00007fffeff9a230 in ns3::DefaultSimulatorImpl::Run (this=0x705c80) at ../src/core/model/default-simulator-impl.cc:193
#7  0x00007fffeff962c8 in ns3::Simulator::Run () at ../src/core/model/simulator.cc:161
#8  0x000000000041372a in main (argc=2, argv=0x7fffffffdde8) at ../scratch/test1.cc:325

I am unable to resolve it. I want to know what I am doing wrong and how to resolve this. I am attaching my script. i need your help, please help me.

Thanks a lot!!
Rajeev
  

On Monday, 11 July 2011 09:28:11 UTC+5:30, Hemanth wrote:
Hi all,

We have implemented a TDMA MAC protocol in ns-3. It has a centralized
TDMA controller scheduling slots as per the slot assignment. Slot
assignment can be done either from the simulation script, through an
external file or by default each node will be allotted a slot. Please
let me know if anyone is willing to test it before I release it for
code review. Also, this TDMA is built upon a simle-wireless channel
model where the only parameter that the model requires is transmission
range of the node. So, all nodes within the specified transmission
range will receive the packet. This could be beneficial in testing
only the upper layer protocols without bothering about the effects of
the lower layers.

Thanks,
Hemanth,
Graduate Student
ITTC, The University of Kansas.
third.cc

Tommaso Pecorella

unread,
Nov 19, 2014, 12:07:42 PM11/19/14
to ns-3-...@googlegroups.com, hemanth...@gmail.com
Hi,

let me understand. You have a TDMA link and you want to have a different datarate for each terminal. Are you sure that this is supported by the model ? I'm not THAT sure that this is possible.
About your error, I'd strongly suggest to read the code. C++ is unforgiving, but thanks G. it is also very clear.

void
TdmaHelper::SetTdmaControllerHelper (const TdmaControllerHelper &controllerHelper)
{
  NS_LOG_FUNCTION
(this);
 
delete m_controllerHelper;
  m_controllerHelper
= controllerHelper.Copy ();
  m_controller
= m_controllerHelper->Create ();
  m_controller
->SetTotalSlotsAllowed (m_numCols - 1);
}


This function should be used ONCE, or the controller will be destroyed and re-created. The effect may be... funny.

Cheers,

T.

PS: do *not* start a thread and switch to another one later on. Chances are that you won't get any "nice" answer.

rajeev kumar

unread,
Nov 20, 2014, 10:53:05 AM11/20/14
to ns-3-...@googlegroups.com, hemanth...@gmail.com
hi all,

   In simple-wireless-tdma model we can not change capacity at individual terminal, but if we want to set capacity at individual terminal what should be follow?
I have another doubt regarding IP-Queue in tdma scenario, if we want to change queue at IP layer what should be do?

Thanks and regards
rajeev Kumar

Nat P

unread,
Nov 20, 2014, 11:03:28 AM11/20/14
to ns-3-...@googlegroups.com, hemanth...@gmail.com


I have another doubt regarding IP-Queue in tdma scenario, if we want to change queue at IP layer what should be do?

Actually IP layer has not the concept of queue. I have some proof-of-concept code, but first resolv this issue, because I do not have anything "copy-and-use"  yet.

rajeev kumar

unread,
Nov 25, 2014, 2:26:52 PM11/25/14
to ns-3-...@googlegroups.com, hemanth...@gmail.com
Hi all,

Is there a way for this model to generate Pcap file. In my topology some nodes are dropping so many packets, I want to find out reason for that. 
Could you please tell me how I can generate Pcap file? 

Tommaso Pecorella

unread,
Nov 25, 2014, 4:26:12 PM11/25/14
to ns-3-...@googlegroups.com, hemanth...@gmail.com
Hi,

as far as I know, this module does not support writing PCAPs. You can use the ASCII traces instead.

T.

rajeev kumar

unread,
Nov 25, 2014, 8:07:18 PM11/25/14
to ns-3-...@googlegroups.com, hemanth...@gmail.com
Hi,

Sorry for asking so many questions. In this model there is concept of queues at MAC layer. Mac layer Queue mean that if mac is busy doing processing on the packet the other packet ll be in queue. But I wanted to know if there is concept of queue on upper layer? I mean that if some other node got time slot to transmit and other node is having arrival then what would happen to that packet? As I am seeing through the trace file packets are getting drop even before it is scheduled for transmission? 

t 0.357719 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 203 protocol 17 offset (bytes) 0 flags [none] length: 463 10.1.1.2 > 10.1.1.1) ns3::UdpHeader (length: 443 49153 > 3333) Payload (size=435)
r 0.357719 /NodeList/14/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 203 protocol 17 offset (bytes) 0 flags [none] length: 463 10.1.1.2 > 10.1.1.1) ns3::UdpHeader (length: 443 49153 > 3333) Payload (size=435)
d 0.357726 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTxDrop ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1020 protocol 17 offset (bytes) 0 flags [none] length: 550 10.1.1.3 > 10.1.1.1) ns3::UdpHeader (length: 530 49153 > 3333) Payload (size=522)
t 0.357772 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 479 protocol 17 offset (bytes) 0 flags [none] length: 550 10.1.1.3 > 10.1.1.1) ns3::UdpHeader (length: 530 49153 > 3333) Payload (size=522)

What to do in such scenario? where (on which layer)  to add the queue to stop these unusual drops? Could you please also help me with how to add queues at each terminal in the network? As I am new to ns-3, I have not much experience? 

Thanks and Regards,
Rajeev

朱赟

unread,
Dec 10, 2014, 6:56:00 PM12/10/14
to ns-3-...@googlegroups.com, amir...@msn.com
Dear Amir,

I have downloaded this file and built successfully with ns3. However, I found that the "tdma-example" do not has bin file after building and thus I can not run it. Do you have some idea on what is wrong?

Many thanks for your attention and help.

Best Regards,
Yun Zhu

jin ro

unread,
Mar 1, 2015, 5:33:25 AM3/1/15
to ns-3-...@googlegroups.com, amir...@msn.com
Hi,

Can you please share the modified tdma-example.cc file?

Jin

AhlEM AhlAM

unread,
Mar 2, 2015, 12:57:57 PM3/2/15
to ns-3-...@googlegroups.com

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

AhlEM AhlAM

unread,
Mar 2, 2015, 12:58:24 PM3/2/15
to ns-3-...@googlegroups.com
2015-03-01 11:33 GMT+01:00 jin ro <jinw...@gmail.com>:

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tdma-example-3.19.cc
Message has been deleted

Tommaso Pecorella

unread,
Mar 3, 2015, 12:36:58 AM3/3/15
to ns-3-...@googlegroups.com, amir...@msn.com
The error you're facing is not related to the posted example.
Indeed, it's raising an error on "src/network/utils/ipv6-address.cc"

This issue has been discussed in the past: your compiler is too new, ns-3.15 is too old.
Use ns-3.22.

T.

On Tuesday, March 3, 2015 at 2:47:50 AM UTC+1, Tann Lybear wrote:
Hi ,I have use your attachments ,but it have some error like this:

admins@admins-virtual-machine:~/ns/ns-allinone-3.15/ns-3.15$ sudo ./waf --run scratch/tdma-test --command-template="gdb %s"
Waf: Entering directory `/home/admins/ns/ns-allinone-3.15/ns-3.15/build'
[ 773/1392] cxx: src/simple-wireless-tdma/helper/tdma-slot-assignment-parser.cc -> build/src/simple-wireless-tdma/helper/tdma-slot-assignment-parser.cc.1.o
[ 774/1392] cxx: src/simple-wireless-tdma/model/tdma-central-mac.cc -> build/src/simple-wireless-tdma/model/tdma-central-mac.cc.1.o
[ 793/1392] cxx: src/network/utils/ipv6-address.cc -> build/src/network/utils/ipv6-address.cc.1.o
../src/network/utils/ipv6-address.cc: In function ‘uint32_t ns3::lookuphash(unsigned char*, uint32_t, uint32_t)’:
../src/network/utils/ipv6-address.cc:63:26: error: typedef ‘ub1’ locally defined but not used [-Werror=unused-local-typedefs]
   typedef unsigned  char ub1;   /* unsigned 1-byte quantities */
                          ^
cc1plus: all warnings being treated as errors
Waf: Leaving directory `/home/admins/ns/ns-allinone-3.15/ns-3.15/build'
Build failed
 -> task in 'ns3-network' failed (exit status 1): 
{task 3067306060L: cxx ipv6-address.cc -> ipv6-address.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-Ibuild', '-I.', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_PACKET_H=1', '-DHAVE_DL=1', '-DSQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DENABLE_GSL', '../src/network/utils/ipv6-address.cc', '-c', '-o', 'src/network/utils/ipv6-address.cc.1.o']


Please help me to solve it.

Thanks 
best regards,
Message has been deleted

Nitya Kulkarni

unread,
May 20, 2015, 12:00:55 AM5/20/15
to ns-3-...@googlegroups.com, hemanth...@gmail.com

Hey!!
  I want to use the TDMA for channel allocation. I ran this code and it works perfectly well in ns3.22 with some modifications ofcourse. Now I want to instantiate multiple tdma controllers as my channel allocation algorithm is based on clusters. So I want to assign tdma controller with different data rates for different clusters. I tried to do it but I get SIGSEGV error. I even tried to use a single controller with different data rates assigned to it for different nodes. Still the SIGSEGV error. I dont know what I am missing out. Please Help!!!!

Thanks
Message has been deleted

Nurullah Shahin

unread,
May 26, 2015, 1:28:16 AM5/26/15
to ns-3-...@googlegroups.com, hemanth...@gmail.com, to...@tomh.org
Dear Hemanth,

I compiled successfully the TDMA MAC protocol from http://code.nsnam.org/tomh/ns-3-simple-wireless/
In this model, Tdma schedules every node in round robin manner, but I want there should not be any priority among nodes.
That means, each node must use its own slot even it generates before getting its own slot.
Example, node 1 should use 1-th slot
               node 3 should use 1-th slot
                :
                :
              node 50 should use 50-th slot
Here, if all nodes generates data traffic at the same time, then we get the proper slot sequence as our need.
But, when each node generates data at random time, this model apply round robin manner.
Could you please help me to implement TDMA MAC protocol without round robin manner.

Thanks,

Nurullah Shahin
Message has been deleted

na...@daffodilvarsity.edu.bd

unread,
May 27, 2015, 6:52:48 AM5/27/15
to ns-3-...@googlegroups.com, to...@tomh.org, hemanth...@gmail.com
i have downloaded all codes, but getting errors like follows:

root@Administrator:/home/administrator/repos/ns-3-allinone/ns-3-dev# ./waf configure

Traceback (most recent call last):
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 97, in waf_entry_point
    run_commands()
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 149, in run_commands
    parse_options()
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 127, in parse_options
    Context.create_context('options').execute()
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Options.py", line 134, in execute
    super(OptionsContext,self).execute()
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 84, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 125, in recurse
    user_function(self)
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/wscript", line 213, in options
    opt.recurse('src')
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 119, in recurse
    wscript_module=load_module(node.abspath())
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 278, in load_module
    exec(compile(code,path,'exec'),module.__dict__)
  File "/home/administrator/repos/ns-3-allinone/ns-3-dev/src/wscript", line 1
    Index: src/wscript
         ^
SyntaxError: invalid syntax


please help me in this regard.

Nurullah Shahin

unread,
May 27, 2015, 7:46:00 AM5/27/15
to ns-3-...@googlegroups.com
Dear narin,

You should follow the every step in this link-
https://www.nsnam.org/docs/release/3.23/tutorial/singlehtml/index.html

Best regards,

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pedi pedro

unread,
Jun 26, 2015, 5:40:21 PM6/26/15
to ns-3-...@googlegroups.com, hemanth...@gmail.com
Hi guys,

I have a question regarding to simple-wirless-tdma project.
I downloaded the code, modified and installed it but I can not run the example file.
could you please tell me how can I run it or just tell me where is the location of executed file?

many thanks

Konstantinos

unread,
Jun 26, 2015, 5:59:12 PM6/26/15
to ns-3-...@googlegroups.com, pedir...@gmail.com, hemanth...@gmail.com
Hi Pedi,

What have you modified/how have you installed?
Have you ported the TDMA in the latest NS-3 or are you using the ns-3.10.
In any case, there is no 'executable' file as such. It is the same as any other NS-3 simulation.
The "simple-wireless-tdma" folder attached in this discussion, has an example of TDMA simulation in the example folder called "tdma-example.cc".

Regards,
K.

pedi pedro

unread,
Jun 26, 2015, 6:23:34 PM6/26/15
to ns-3-...@googlegroups.com
Hi kostantinos
I just followed the instruction that Amir mentioned in the group.
Downloaded the simple-wireless-tdma zip file, just modified the doStart() function (change to initilized()) and compiled it.
It is notable that I'm using of ns-3.23.
After internet searching, I found that if yo wanna generate the executable file from example files, you should enable "--enable-example" flags in ./waf configure.
I configured it again, all example files have build and executable files generated in build/examples except the simple-wireless-tdma.
Do you have any idea that how can I generate executable file from wireless-simple-tdma ?

--

Konstantinos

unread,
Jun 26, 2015, 7:27:38 PM6/26/15
to ns-3-...@googlegroups.com, pedir...@gmail.com
The executable will not be in the /build/examples but in build/src/simple-wireless-tdma/examples
However if you just do "./waf --run tdma-example" it should run.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Nurullah Shahin

unread,
Jun 27, 2015, 12:56:59 AM6/27/15
to ns-3-...@googlegroups.com
Hello Kostantinos,
 
By using the following function we can get sender IP address, It is possible to get receiver IP address?

void
TdmaExample::ReceivePacket (Ptr<Socket> socket)
{
    NS_LOG_FUNCTION (this << socket);
    Ptr<Packet> packet;
    Address from;
    while ((packet = socket->RecvFrom (from)))
    {
        if (packet->GetSize () > 0)
        {
            SeqTsHeader seqTs;
            packet->RemoveHeader (seqTs);
            uint32_t currentSequenceNumber = seqTs.GetSeq ();
            if (InetSocketAddress::IsMatchingType (from))
            {
                Time tempTime = (Simulator::Now()-seqTs.GetTs());
                delaySafety = delaySafety +  tempTime.ns3::Time::GetNanoSeconds();

                NS_LOG_INFO ("TraceDelay: RX " << packet->GetSize () <<
                    " bytes from "<< InetSocketAddress::ConvertFrom (from).GetIpv4 () <<
                    " Seq Num: " << currentSequenceNumber <<
                    " Uid: " << packet->GetUid () <<
                    " TXtime: " << seqTs.GetTs () <<
                    " RXtime: " << Simulator::Now () <<
                    " Delay: " << Simulator::Now () - seqTs.GetTs ());
                /*
                std::cout<<"TraceDelay: RX " << packet->GetSize () <<
                " bytes from "<< InetSocketAddress::ConvertFrom (from).GetIpv4 () <<
                " Sequence Number: " << currentSequenceNumber <<
                " Uid: " << packet->GetUid () <<
                " TXtime: " << seqTs.GetTs () <<
                " RXtime: " << Simulator::Now () <<
                " Delay: " << Simulator::Now () - seqTs.GetTs ()<<std::endl;
                */
                outfile1<<"TraceDelay: RX " << packet->GetSize () <<
                    " bytes from "<< InetSocketAddress::ConvertFrom (from).GetIpv4 () <<
                    " Seq Num: " << currentSequenceNumber <<
                    " Uid: " << packet->GetUid () <<
                    " GenTime: " << seqTs.GetTs () <<
                    " RecvTime: " << Simulator::Now () <<
                    " End-to-endDelay: " << Simulator::Now () - seqTs.GetTs ()<<" "<<(Simulator::Now () - seqTs.GetTs ())/1000000<<" ms"<<std::endl;

            }
            //m_lossCounter.NotifyReceived (currentSequenceNumber);

            receiveBytesTotal1 += packet->GetSize ();
            receiveBytesTotal2 += packet->GetSize ();
            receivedSafety1++;
            receivedSafety2++;
        }
    }
}

Thanks.

Nurullah Shahin

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/9ZD8VVXQP5s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Nurullah Shahin

unread,
Jun 27, 2015, 1:03:20 AM6/27/15
to ns-3-...@googlegroups.com
Hello Kostantinos,
 
By using the following function we can get sender IP address, It is possible to get receiver IP address?
The packet type is the broadcasting packets.
On Sat, Jun 27, 2015 at 8:27 AM, Konstantinos <dinos.k...@gmail.com> wrote:
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/9ZD8VVXQP5s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

pedi pedro

unread,
Jun 27, 2015, 5:24:50 AM6/27/15
to ns-3-...@googlegroups.com
Hello Konstantinos,

actually when I want to run the example but show me this error : I guess there is on library is miss
please see the screenshot

many thanks

error ns3.jpg

pedi pedro

unread,
Jun 27, 2015, 6:23:36 AM6/27/15
to ns-3-...@googlegroups.com
Hello Konstantinos,

I change the mobility and application and I compiled. Please see again the screenshot.

Thanks again for your kindly helping.

Pedi
build ns3.jpg

pedi pedro

unread,
Jul 10, 2015, 9:41:29 AM7/10/15
to ns-3-...@googlegroups.com
Dear Kostantinos and Dear all,

first of all I am very thnakful for helping . Please let me asking some question about assining TDMA (time slot to nodes that are moving)

I wanna assign the TDAM to all of nodes that are moving in Highway scenario..In this case nodes are moving so should be need it like distributed TDMA or having TDMA dynamically.

For more explaining please imagine that one node for exp( A). at first this node A detects its neighbours node in two hop of its range and after that I wanna assigned TDMA to getting time slot to these nodes that are existing in this range of node A.

I want to put or assogn time slot inside to frame on TDMA to nodes in every two hop of node A or another node that I am looking for.

Could you please tell me how I can have TDMA dynamically, or how I can move the TDMA to cover all of nodes??

Please see the picture.

Many many thanks for giving you idea.

node A.jpg
Message has been deleted

Enakshi Jana

unread,
Aug 3, 2015, 10:40:49 AM8/3/15
to ns-3-users, hemanth...@gmail.com
Hi all,

     I have successfully run the example tdma-example.cc with default configuration but .csv file shows 0 packet received.I try to change different parameter used in this example but no packet received after any modification. But when used wifi mac it works fine and packet received also.Please help me how to set parameter for TDMA mac for receiving packet.
Thanks in advance for your help!

Thanks,
Enakshi

Shenlei Shen

unread,
Oct 8, 2015, 9:19:23 PM10/8/15
to ns-3-users, hemanth...@gmail.com
Hi ,everyone.This is my tdma MAC result  , but I am confused with this result.
Firstly ,the tx or rx time changd from 0.00487913 to 15.0085 
suddenly, I am wrong or it's right?
I have read your doc file and the SetDefaultSlots function in Tdma-helper.cc ,but I couldn't understand what that algorithm's function .For example ,the Default slot array is below, I kown the first column respents the four nodes .What does other elements mean?  have tried to analyse the tr file but I can't find out how  time slot is assigned. Please help me ,thank you very much.
0,1,0,0,0,
1,0,1,0,0,
2,0,0,1,0,
3,0,0,0,1


t 0.00123492 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.2 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 1 SequenceNumber: 2)
r 0.00123514 /NodeList/3/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.2 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 1 SequenceNumber: 2)
r 0.00123518 /NodeList/2/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.2 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 1 SequenceNumber: 2)
r 0.00123524 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.2 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 1 SequenceNumber: 2)
t 0.00243492 /NodeList/2/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.3 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 1 SequenceNumber: 2)
r 0.00243496 /NodeList/3/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.3 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 1 SequenceNumber: 2)
r 0.00243518 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.3 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 1 SequenceNumber: 2)
r 0.0024355 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.3 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 1 SequenceNumber: 2)
t 0.00247855 /NodeList/2/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.3 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
r 0.00247859 /NodeList/3/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.3 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
r 0.00247882 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.3 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
r 0.00247913 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.3 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
t 0.00363492 /NodeList/3/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 2)
r 0.00363496 /NodeList/2/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 2)
r 0.00363514 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 2)
r 0.00363546 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 2)
t 0.00367856 /NodeList/3/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
r 0.00367859 /NodeList/2/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
r 0.00367878 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
r 0.00367909 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
t 0.00483492 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.1 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 1 SequenceNumber: 2)
r 0.00483524 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.1 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 1 SequenceNumber: 2)
r 0.00483546 /NodeList/3/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.1 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 1 SequenceNumber: 2)
r 0.0048355 /NodeList/2/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 0 protocol 17 offset (bytes) 0 flags [none] length: 40 10.1.1.1 > 10.1.1.255) ns3::UdpHeader (length: 20 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 1 SequenceNumber: 2)
t 0.00487855 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.1 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
r 0.00487887 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.1 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
r 0.00487909 /NodeList/3/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.1 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
r 0.00487913 /NodeList/2/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 1 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.1 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2)
t 15.0085 /NodeList/3/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 2 protocol 17 offset (bytes) 0 flags [none] length: 76 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 56 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 4) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 2 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 2 SequenceNumber: 2)
r 15.0085 /NodeList/2/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 2 protocol 17 offset (bytes) 0 flags [none] length: 76 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 56 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 4) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 2 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 2 SequenceNumber: 2)
r 15.0085 /NodeList/1/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 2 protocol 17 offset (bytes) 0 flags [none] length: 76 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 56 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 4) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 2 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 2 SequenceNumber: 2)
r 15.0085 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacRx ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 2 protocol 17 offset (bytes) 0 flags [none] length: 76 10.1.1.4 > 10.1.1.255) ns3::UdpHeader (length: 56 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 1 SequenceNumber: 4) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.3 Hopcount: 2 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.2 Hopcount: 2 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 2 SequenceNumber: 2)
t 15.0096 /NodeList/0/DeviceList/0/$ns3::TdmaNetDevice/Mac/MacTx ns3::LlcSnapHeader (type 0x800) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 1 id 2 protocol 17 offset (bytes) 0 flags [none] length: 52 10.1.1.1 > 10.1.1.255) ns3::UdpHeader (length: 32 269 > 269) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.1 Hopcount: 1 SequenceNumber: 2) ns3::dsdv::DsdvHeader (DestinationIpv4: 10.1.1.4 Hopcount: 2 SequenceNumber: 4)

Hemanth於 2011年7月11日星期一 UTC+8上午11時58分11秒寫道:

Shenlei Shen

unread,
Oct 9, 2015, 9:47:28 PM10/9/15
to ns-3-users, hemanth...@gmail.com
Hi,I am studying TDMA too,I have the same problem with you,can you give me your e-mail ,so we can talk about it ,thank you very much.

在 2015年8月3日星期一 UTC+8下午10:40:49,Enakshi Jana写道:

jiangnan yang

unread,
Apr 7, 2016, 5:49:11 AM4/7/16
to ns-3-users
Hello pedi, i use the recent version of ns3.25, i also have the probleme like yours, can you tell me how to fixe it? where is the problem?

Thanks a lot.

pedi pedro

unread,
Apr 20, 2016, 10:08:54 AM4/20/16
to ns-3-...@googlegroups.com
Hi Guys,
actually for my case exactly all of hints that ( Konstantinos) told me I did.
Annyway I posted the code. Hope is useful.

RG,
Pedi

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/9ZD8VVXQP5s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
pedi (new with trace source).cc
tdma-controller.cc

Prem Kumar

unread,
Nov 2, 2016, 10:43:26 AM11/2/16
to ns-3-users, hemanth...@gmail.com
Hey!
I know this is a bit too late but. It would be great if u could let me know how u solved the issue.

Thanks.
Prem

Sai Gutta

unread,
Dec 9, 2016, 7:55:42 AM12/9/16
to ns-3-users, hemanth...@gmail.com
Hello Prem,

Were you able to get this running with ns-3.25, i am getting a segmentation fault error ?

Robert Ammon

unread,
Dec 10, 2016, 11:46:44 AM12/10/16
to ns-3-users, hemanth...@gmail.com
Attached is a copy that I have been using with NS 3.26.  I think this should downgrade to NS 3.25 ok.
tdma.tar.gz

donald ngugi

unread,
Jan 18, 2017, 7:22:03 AM1/18/17
to ns-3-users, hemanth...@gmail.com
Hi am getting an error

Build failed
 -> task in 'pybindgen(ns3 module tdma)' failed (exit status 1):
    {task 3065196812L: command_task ns3modulegen-modular.py,modulegen__gcc_ILP32.py -> ns3module.cc,ns3module.h,ns3modulegen.log}

donald ngugi

unread,
Jan 22, 2017, 7:48:22 PM1/22/17
to ns-3-users
anyone know why the code has terminates with SIGFPE error after building successfully ?

Andrew Wan Ju Kang

unread,
Jul 10, 2017, 12:16:07 AM7/10/17
to ns-3-users, hemanth...@gmail.com
Hi, everyone

Thank you so much for the TDMA module development. I'm new to ns-3, and I am trying to tweak it a little bit for my research.

I've downloaded the module on ns-3.26, and have successfully built it.

I've noticed that usingWifi=1 correctly sends and receives packets among the nodes.

However, running the example with default parameters (usingWifi=0) gives me zero packet received count on the .csv file.

I see that a couple of people have encountered the same problem before, and I'm curious how you guys have solved the problem.

I'd really appreciate it if you could share how you got to solve the zero-received packet problem.

Best,

srikanth thandu

unread,
Nov 4, 2017, 1:26:56 PM11/4/17
to ns-3-users
hello sir,
can you please send me the code ,which allows TDMA?

Rukaiya

unread,
Mar 14, 2019, 3:03:19 AM3/14/19
to ns-3-users
Hi,

I am having this error while running ./waf build command please tell me where i am wrong. I have followed all the steps but having following error


/ns-allinone-3.27/ns-3.27/src/simple-wireless-tdma/model/simple-wireless-channel.h has no mapping in ['.pc.in', '.o', '.obj', '.py', '.c', '.cpp', '.cc', '.cxx', '.C', '.c++'] (have you forgotten to load a waf tool?)

Ruk

unread,
Mar 15, 2019, 3:54:41 AM3/15/19
to ns-3-users

Hi,

I am having following error while compiling tdma-example.cc. Please anyone guide me on this

/ns-allinone-3.27/ns-3.27/build/../scratch/tdma-example.cc:390: undefined reference to `ns3::TdmaHelper::TdmaHelper(unsigned int, unsigned int)'
Message has been deleted

Score882

unread,
Mar 16, 2019, 5:34:31 AM3/16/19
to ns-3-users

Hi

I am having following erorr while compiling the program. it seems to be related with floating point exception but it is not happening in the code. kindly help

Trace file generated is DsdvManet_4Nodes_ tdma_400txDistance_ 100SimTime .tr
Creating 4 nodes.
/ns-3.27/build/scratch/tdma-example'] terminated with signal SIGFPE. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

Tom Henderson

unread,
Mar 16, 2019, 11:20:42 AM3/16/19
to ns-3-...@googlegroups.com, Score882
On 3/16/19 2:34 AM, Score882 wrote:
>
> Hi
>
> I am having following erorr while compiling the program. it seems to be
> related with floating point exception but it is not happening in the
> code. kindly help
>
> Trace file generated is DsdvManet_4Nodes_ tdma_400txDistance_ 100SimTime .tr
> Creating 4 nodes.
> /ns-3.27/build/scratch/tdma-example'] terminated with signal SIGFPE. Run
> it under a debugger to get more information (./waf --run <program>
> --command-template="gdb --args %s <args>").

This HOWTO may help:

https://www.nsnam.org/wiki/HOWTO_use_gdb_to_debug_program_errors

- Tom

DCo

unread,
Aug 3, 2019, 10:47:22 AM8/3/19
to ns-3-users
What was your solution to zero packets received?

hina gul

unread,
Aug 5, 2019, 2:03:04 AM8/5/19
to ns-3-users
Hi Hemanth,
                     i want to test your TDMA MAC protocoal code...can u please share it with me...thanks
Message has been deleted

Jay Vivarekar

unread,
Nov 8, 2019, 12:20:25 AM11/8/19
to ns-3-users
Hi,
I am facing an issue while compiling tdma-example.cc. Any help on this issue would be appreciated. I am using ns-3.26. I have copied the source files to the 'src' directory and run the following command:


./waf --run src/tdma/examples/tdma-example --command-template="gdb --args %s <args>"

Capture.PNG


Tom Henderson

unread,
Nov 8, 2019, 9:12:26 AM11/8/19
to ns-3-...@googlegroups.com
Your image shows that you are perfectly positioned to figure out the
cause of this fault, if you are able to become familiar with using gdb.

At the gdb prompt, you want to keep stepping 'up' until you find the
pointer that is null or has an invalid memory address associated with
it.  Once you find this, you will then need to think about the model's
code and how this could arise.  Stepping 'up' further back into the
execution path will often give you a clue.

Some more info and helpful links are here:
https://www.nsnam.org/wiki/HOWTO_use_gdb_to_debug_program_errors

Since this is using a TDMA module that is not part of the main release,
I am not familiar with this model or example code.

- Tom


Jay Vivarekar

unread,
Nov 11, 2019, 6:41:48 AM11/11/19
to ns-3-users
Hi Tom. I have gone through the model code and everything seems ok there. The code is breaking when an "AttributeAccessor" object is constructed when one of the functions in the model is invoked. I consulted the documentation regarding this but haven't been able to figure it out. So if could direct me towards some resources or explain it (regarding the Attribute access part) in brief, that would help a lot.

Khurshid Alam

unread,
Nov 11, 2019, 10:26:57 AM11/11/19
to ns-3-...@googlegroups.com
Hi, I am not sure what is causing the problem in AttributeAccessor, can you try to run it from scratch folder, as it is pointed out here by knud that some configuration setting is missing ...

By the way, it works fine for me under ns-3.27  

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/9ZD8VVXQP5s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Tom Henderson

unread,
Nov 11, 2019, 4:38:26 PM11/11/19
to ns-3-...@googlegroups.com

Jay, what source code are you using?  I tried a variant of the below referenced code, but it throws a different exception (SIGFPE).

https://groups.google.com/forum/#!topic/ns-3-users/pvNbVWqm6pA

Here is some documentation on the attribute accessor (there is not much documentation around it):

https://www.nsnam.org/docs/manual/html/attributes.html#adding-attributes

https://www.nsnam.org/docs/manual/html/attributes.html#new-attributevalue-type

- Tom



--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Jay Vivarekar

unread,
Nov 13, 2019, 1:28:53 AM11/13/19
to ns-3-users
Hi Khurshid. Thanks a lot. I switched my version to ns-3.27 and it works.
To unsubscribe from this group and all its topics, send an email to ns-3-...@googlegroups.com.
Message has been deleted

Jay Vivarekar

unread,
Nov 13, 2019, 1:32:10 AM11/13/19
to ns-3-users
Tom, I was using the source code provided by Robert Ammom. OP's code from GitHub was not compiling on my version. I switched to ns-3.27 following Khurshid Alam's suggestion and got the code to work. I will go ahead with this one then.
Thanks a lot for your help.

Khurshid Alam

unread,
Nov 13, 2019, 4:44:41 AM11/13/19
to ns-3-users
Glad to help.

Tom Henderson

unread,
Nov 13, 2019, 11:28:00 AM11/13/19
to ns-3-...@googlegroups.com
I was able to port this to the latest ns-3 code (patch attached).

When I run this example from the contrib directory, the reason that it
fails for me is that the code does not find the text file containing the
slot assignments.  If I add in the relative path into the filename, I
can get it to load, and then I can get to the SIGSEGV that you observed.

#0  0x00007fffeebdc438 in typeinfo for ns3::AttributeAccessor ()

If I step up one level with gdb, I see:

(gdb) up

#1  0x00007ffff0bad21a in ns3::TdmaController::ScheduleTdmaSession (
    this=0x55555580a030, slotNum=0)
    at ../contrib/tdma/model/tdma-controller.cc:273
273      it->second->StartTransmission (transmissionSlot.GetMicroSeconds
());

Checking the value of

(gdb) p it->second
$10 = {m_ptr = 0x555555825cb0}

This is not one of the pointers inserted into the map earlier in
AddTdmaSlot().

(gdb) p m_slotPtrs
$13 = std::map with 4 elements = {[1] = {m_ptr = 0x55555580ada0}, [2] = {
    m_ptr = 0x55555580a910}, [3] = {m_ptr = 0x55555580a490}, [4] = {
    m_ptr = 0x555555841500}}


(gdb) p slotNum
$14 = 0

(gdb) p it == m_slotPtrs.end ()
$15 = true

So the error in this program is that ScheduleTdmaSession() is called
with an argument of 0, and this does not correspond to a key in the map,
and although there is a check earlier in the method to see if the key
was not found, it only prints out a log warning.

- Tom


tdma.patch

Jay Vivarekar

unread,
Nov 13, 2019, 11:24:46 PM11/13/19
to ns-3-users
Thanks Tom. I am new to ns-3 and I really liked the way you described your debug flow. This will definitely help me in the future. I will go ahead with your patch on the latest version of ns-3.30.

Jay Vivarekar

unread,
Dec 3, 2019, 7:16:55 AM12/3/19
to ns-3-users
Hi, I am trying to use NetAnim module alonwith your code. I added the following lines in tdma-example.cc before Simulator::Run() :
std::string animFile = m_trname + ".xml";
AnimationInterface anim (animFile);
anim.EnablePacketMetadata (); // Optional
anim.EnableIpv4RouteTracking ("routingtable-wireless.xml", Seconds (0), Seconds (5), Seconds (0.25)); //Optional
 Simulator::Run ();

The code executes but the .xml file created contains no packets. It does contains the node positions though. Any suggestions would help a lot.

Jay Vivarekar

unread,
Jan 18, 2020, 7:59:20 AM1/18/20
to ns-3-users
I figured it out so I thought of posting the solution here in case somebody faces the same issue in future. The NetAnim module uses trace sources in various ns-3 modules to generate the output XML file. Since this is a custom protocol, the NetAnim interface(defined in animation-interface.cc) was not setup to connect to the trace sources fired by TDMA module. Wiring up the trace sources to appropriate methods in animation-interface.cc solved the issue. Hope this helps.

hao zhang

unread,
Oct 24, 2020, 11:49:48 PM10/24/20
to ns-3-users
I also face this problem. So how can I fix the error? Please tell me this problem. Thank you.
It is loading more messages.
0 new messages