Packet loss in ad-hoc networks

184 views
Skip to first unread message

Ola Ashour

unread,
Feb 16, 2021, 3:54:23 PM2/16/21
to ns-3-users
I want to introduce packet losses in ad-hoc network to test the performance of using different routing metrics what is the best way to do that? I tried using matrix propagation loss model, but it does not work. it only allow the link between two nodes either to exist or have total loss.

jay...@gmail.com

unread,
Feb 18, 2021, 12:10:47 AM2/18/21
to ns-3-users
Hi.
You can use a RandomPropagationLoss model to get a random loss between nodes. You can then control the amount of packets dropped by changing the receiver sensitivity. This is provided if you don't want deterministic packet losses.

Hope this helps.
Jay

Tom Henderson

unread,
Feb 18, 2021, 12:22:55 AM2/18/21
to ns-3-...@googlegroups.com, jay...@gmail.com
There is also the possibility of adding an error model into the devices.
This conceptually operates above the physical layer; i.e. even if the
propagation loss model doesn't cause a drop, the packet is then passed
to the device error model to see if there is a drop:

https://www.nsnam.org/docs/release/3.33/models/html/error-model.html

This would behave similarly to what Jay recommended below (but please
note that you have to provide an actual random variable to the
RandomPropagationLossModel to get it to operate randomly-- the default
is to use a constant).

Both of the above approaches will introduce errors that are independent
of the actual distance between the nodes.

- 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
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ns-3-users/a675305c-3335-4e81-b668-6115228b652cn%40googlegroups.com
> <https://groups.google.com/d/msgid/ns-3-users/a675305c-3335-4e81-b668-6115228b652cn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Ola Ashour

unread,
Feb 18, 2021, 12:35:04 AM2/18/21
to ns-3-users
Thank you Jay and Tom for your reply,

Actually what I want to do is to introduce a loss to a specific link. For example if I want to send data from node 1 to node 4 and I have two paths to reach node 4. I want to introduce losses on one path while keep the other path with no losses to see which path the routing protocol will choose. I need something to specify the error rate similar to the rate error model that Tom suggested. However, the rate error model that Tom suggested does not work in wireless. I found something called DSSSErrorRateModel which should work in wireless, but I do not know how to use it and also it is applied to the physical layer not to a specific node. Any suggestion ?

Tom Henderson

unread,
Feb 18, 2021, 12:51:29 AM2/18/21
to ns-3-...@googlegroups.com, Ola Ashour
On 2/17/21 9:35 PM, Ola Ashour wrote:
Thank you Jay and Tom for your reply,

Actually what I want to do is to introduce a loss to a specific link. For example if I want to send data from node 1 to node 4 and I have two paths to reach node 4. I want to introduce losses on one path while keep the other path with no losses to see which path the routing protocol will choose. I need something to specify the error rate similar to the rate error model that Tom suggested. However, the rate error model that Tom suggested does not work in wireless. I found something called DSSSErrorRateModel which should work in wireless, but I do not know how to use it and also it is applied to the physical layer not to a specific node. Any suggestion ?


The rate error model does work on wireless; it is called the PostReceptionErrorModel in WifiPhy:

    .AddAttribute ("PostReceptionErrorModel",
                   "An optional packet error model can be added to the receive "
                   "packet process after any propagation-based (SNR-based) error "
                   "models have been applied. Typically this is used to force "
                   "specific packet drops, for testing purposes.",
                   PointerValue (),
                   MakePointerAccessor (&WifiPhy::m_postReceptionErrorModel),
                   MakePointerChecker<ErrorModel> ())

However, in general, it does not discriminate based on sender.  I suppose you could modify the code in WifiPhy where this model is applied and filter based on sender at that point.

- Tom


To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/36c3e44a-db48-4ed2-9963-95bdcb4d9376n%40googlegroups.com.


Ola Ashour

unread,
Feb 19, 2021, 3:43:57 PM2/19/21
to Tom Henderson, ns-3-...@googlegroups.com
Thank you so much Tom 
Reply all
Reply to author
Forward
0 new messages