packet counter

51 views
Skip to first unread message

dbaez...@gmail.com

unread,
Apr 17, 2016, 11:27:23 PM4/17/16
to ns-3-users
Hello everyone. someone tells me the type of class or method that would help to make the packet counter broadcast. please, thank you

Konstantinos

unread,
Apr 18, 2016, 3:42:01 AM4/18/16
to ns-3-users
Hi,

Could you please explain a bit more in detail what do you need? 
Because I do not think that your question is just what type of counter you should use (that's generally any type of numeric variable - integers (preferred) , double, floats, it's up to you).

K

dbaez...@gmail.com

unread,
Apr 18, 2016, 12:00:06 PM4/18/16
to ns-3-users

Hello Konstantinos. rather I need to implement the following scheme.
Counter-based scheme

When a host tries to rebroadcast a message, the rebroadcast

message may be blocked by a busy medium, the backoff pro-

cedure, and other queued messages. There is a chance for the

host to hear the same message again and again from other re-

broadcasting hosts before the host actually starts transmitting

the message.

In section 2.2.1 we have shown that EAC(k), the expected

additional coverage after hearing the message k times, is ex-

pected to decrease quickly as k increases. We can prevent a

host from rebroadcasting when the expected additional cov-

erage of the host’s rebroadcast becomes too low. This is

what the counter-based scheme is based on. Specifically,

a counter c is used to keep track of the number of times the

broadcast message is received. A counter threshold C is cho-

sen. Whenever c # C, the rebroadcast is inhibited. The

scheme is formally derived below.

S1. Initialize counter c = 1 when a broadcast message msg

is heard for the first time. In S2, if msg is heard again,

interrupt the waiting and perform S4.

S2. Wait for a random number of slots. Then submit msg

for transmission and wait until the transmission actually

starts.

S3. The message is on the air. The procedure exits.

S4. Increase c by one. If c < C, resume the interrupted wait-

ing in S2. Otherwise c = C, proceed to S5.

S5. Cancel the transmission of msg if it was submitted in S2.

The host is prohibited from rebroadcasting the same mes-

sage in the future. Then the procedure exits.

If you give me some idea, thank you.

Konstantinos

unread,
Apr 18, 2016, 12:10:37 PM4/18/16
to ns-3-users
This description is taken from a paper that presents a specific algorithm.
I would advise you to work on understanding the algorithm first. 
The implementation will come later and the counter is a simple integer that you increment in specific conditions.

As with any other user who has asked similar questions (i.e. I want to implement this or that), you need first to understand your system, what it does, where each functionality lives and operates. Then you need to study the code in NS-3 to identify what points you need to change and what classes are available for your operations (if something is missing, you create it). 

K.

Tommaso Pecorella

unread,
Apr 18, 2016, 12:49:19 PM4/18/16
to ns-3-users
It's the third time you ask the very same thing.

I could start to be nervous, should I ?
Yes, I'm allowed to be nervous.

There are TWO papers describing in details this procedure. Not one, TWO:

The procedure is clear as a glass of pure water. How to implement it it's up to you, for sure the authors didn't mention a LOT of details, e.g.:
1) "msg is heard for the first time." - Sure, how do you decide that it's the fist time you hear a packet ?
2) "The host is prohibited from rebroadcasting msg." - Sure, like... forever ? How much memory should a node have ? Shall it remember all packets it did hear in its life ?
and other small details like this.

As I said in the previous answer I gave you (and you ignored), the algorithm is not going to work as it is.
The problem is: it's not our task to implement it for you and/or to find and fix all the details that the authors didn't mention. Feel free to ask if you have doubts, but the implementation decisions are yours.

T.
Reply all
Reply to author
Forward
0 new messages