are the internal parameters that assigned in smac.h to be modified or reassigned or the interavtive parameters only assigned when a WSN that work with SMAC is simulated with NS2?
but when i apply smac with a duty cycle to my network which contains 3 nodes and one sink i find that only one node send to sink for all time. so what is the problem?
hello Jannat Hegazy, I'm not sure your problem already solve yet.
For your main question. Normally, you can reassign some parameter of modules from tcl file. I don't recommend to modify parameters directly at (.h,.cc) files.
For second question. I think your node or application configuration is incorrect. can you show me your tcl file?
This is tcl syntax for create a new variable.For an example above, we need to create a new variable name "b" in tcl environment with value [$node_(0) set mac_(0)]. In tcl language, variable not necessary to be int, float or double type. it can be object of something like a pointer. So, If you don't use variable "b" is not meaning in tcl script.
I think you should interested value of variable "b" because it's node configuration. it will have effect to node_(0).
# is it meaning that node 0 is the scheduler of the network or what ?
node_(0) is not a scheduler in the network because when you run tcl script. ns2 will create one scheduler for one simulation. All of node use communication time depend with it.
# i comment on the last three steps in my tcl script , is it wrong?
For the meaning of code is already explain in first answer. I guess you following from this slide (https://www.scribd.com/doc/44506647/Simulation-and-Analysis-of-S-MAC-Protocol-for-WSN). If yes, I think you can comment this codes and it isn't wrong. If not, I need more information.
# _ also is the start time in the tcl script is determined to fit the scheduling of the network.
I suggest you should add a few additional times.
# _ s-mac work with star topology?
If I remember correctly, yes, s-mac can work with star topology.