How to understand/use NS-3 documentations?

97 views
Skip to first unread message

weilin zhong

unread,
Aug 7, 2018, 8:43:09 AM8/7/18
to ns-3-users
Hi all. I'm totally new to ns-3. Can somebody give me some guides to understand/use the ns-3 documentation? I'm really confused about it because there are many explanations in principle but little examples.
For example, I want to calculate the transmission delay between client and server, and I've found the documentation about it: http://www.nsnam.org/doxygen/classns3_1_1_propagation_delay_model.html. However, I don't know how to code it in my script. Do you know how to express a and b actually in c++ or Python? Thank you very much.

pdbarnes

unread,
Aug 8, 2018, 11:43:09 AM8/8/18
to ns-3-users
I agree there is a big gap between the low-level API docs, such as you cited, the component manual chapters, and high level concepts such as “what’s the transmission delay between two nodes”. The best advice we can give is

0. As a new user, you really need to work through the tutorials. In there you’ll find out what a Ptr<> is, what a MobilityModel is, and how to get a Ptr<MobilityModel> from a Node. If you understood those then the function you quoted would make a lot more sense. You would still need to work out how to get the Propagation Model from the Channel connecting the Nodes, but that’s only one step harder.

1. Search the users’ list for similar discussions.

2. Find an example that does something close to what you need.

3. Search the code for uses of a particular API to see how it’s used in practice. The API docs can be helpful since it shows where a function is called. (But it doesn’t catch *all* uses, so explicitly searching the code is still necessary.)

In this particular case, I’ll throw in two more comments:

First, “transmission delay” could be open to several interpretations. Do you want to include queuing delays? retransmissions? channel contention? other network overheads such as ARP, route discovery, etc? Or do you want just the actual propagation delay on the channel?

Second, even the propagation delay might not have a singular value. It will be different for wired (copper or fiber?) wireless, or acoustic channels.

HTH,
Peter

Abida Perveen

unread,
Aug 9, 2018, 5:01:10 AM8/9/18
to ns-3-...@googlegroups.com
My apologies for posting here peter can you comment on my post i am a new user too. i did post few times but didnot got any reply maybe that been missed by experts. i am posting again after this email i have problem in multi echo servers and client. with one server and multiple clients packet are been send and receive by all clients to server. but when i increase server for example 2 or 3 server and 2 or 3 clients (1 client attach to one server) then just last server just receive the packets and send the echo packet back but first 1 or 2 server dont receive packet from the clients. like this

Flow 1 (7.0.0.2 -> 1.0.0.2)
  Tx Packets: 1
  Tx Bytes:   1052
---------------------------------------------------------------------------
  Flow 2 (7.0.0.3 -> 1.0.0.4)
  Tx Packets: 1
  Tx Bytes:   1052
---------------------------------------------------------------------------
  Flow 3 (1.0.0.4 -> 7.0.0.3)
  Tx Packets: 1
  Tx Bytes:   1052

again apologies please


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

weilin zhong

unread,
Aug 16, 2018, 4:45:05 PM8/16/18
to ns-3-...@googlegroups.com
Hi Peter,

Many thanks for your guides. I've followed your guide and finally using the flow monitor to collect the whole end to end delay. But I still have another question.

1. Why are the simulation results always the same? I've checked the Random Variables document and tried sample-random-variable.cc. The result did change when I change the seed, but it was the same again after I changing the seed and run a second time. How can I make it run much similar to the real world? I mean, the propagation delay, packet loss, jitter, etc can't be the same in every time. If I want to make a co-simulation of ns-3 and other software, it's meaningless the simulation results in ns-3 are always the same. Because I want to get the information (mainly the delay and packet-drop) every time step in ns3, and it should be dynamic. Could you please help me to solve this question?

2. Are there any more examples in python? I found many examples in c++ but less in python. It's a little bit hard to get started for I'm using python. 

Thank you very much.

Best wishes,
Weilin
 

--
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/w7cQkDK-QnM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

pdbarnes

unread,
Aug 16, 2018, 4:54:47 PM8/16/18
to ns-3-users
Please don't cross post.  That makes it very hard to follow a single thread of discussion, or to search the list and find relevant threads.

pdbarnes

unread,
Aug 16, 2018, 5:37:59 PM8/16/18
to ns-3-users


On Thursday, August 16, 2018 at 1:45:05 PM UTC-7, weilin zhong wrote:
Hi Peter,

1. Why are the simulation results always the same?

By design ns-3 is reproducible; you want that for debugging.  For statistical purpose you should change the Run number, not the seed. Each Run number will give you different results.

Peter

weilin zhong

unread,
Aug 16, 2018, 5:43:51 PM8/16/18
to ns-3-users
I'm really sorry about this. But I've searched the list and can't find the answer. Can you help me, please? Thank you very much and sorry again.
Reply all
Reply to author
Forward
0 new messages