USNavalResearchLaboratory / mgen

Multi-Generator (MGEN) traffic generation tool
https://www.nrl.navy.mil/itd/ncs/products/mgen
Other
83 stars 25 forks source link

Questions of using mgen with EMANE #19

Closed szl0144 closed 4 years ago

szl0144 commented 4 years ago

Hi,

I am use mgen to create traffic flow for three EMANE nodes, when I use the default configuration, I find all of three nodes receive data from mgen, can you please tell me how I can just let one node receive data from mgen and the other two doesn't?

Best, Shaoyi

weston-nrl commented 4 years ago

Use unicast instead of multicast? Change the topology?

szl0144 commented 4 years ago

Use unicast instead of multicast? Change the topology?

Thank you for your reply. I notice EMANE node receives traffic flow from mgen from upper layer directly, but I plan to get data transmitted from other two nodes without any data from mgen, can I use unicast to achieve it?

Best, Shaoyi

weston-nrl commented 4 years ago

I'm not really sure what you mean/what you're trying to do. Also, this really has nothing to do with EMANE as far as I can tell. Wireless RF is typically a broadcast medium (in real life or in EMANE), particularly for typical omnidirectional antennas -- so the fact that packets can be seen by any in-range nodes (e.g. via promiscuous sniffing with tcpdump/pcap) is just the way that type of network works. It has no bearing on whether MGEN receives the packet or not -- packets are only forwarded up the stack to MGEN if 1) MGEN is LISTENing on that port, and 2) either they are destined for that node via unicast, or the node has JOINed the multicast address.

szl0144 commented 4 years ago

Hi,

Thank you very much! I got your points, do you mean MGEN can get packet information no matter whether the packets are received by receiver if the scenario satisfies the two conditions? Can you please tell me in a scenario where a packet is transmitted by node1, then forwarded by node2 and received by node3, how does the packet is processed by node2? Will it be transmitted to node2's MGEN and be resent to node2's EMANE or be forwarded to node 3 directly by node2's EMANE? I am sorry I am not sure about whether the problem is related to EMANE or MGEN. I apologize if I ask the questions in wrong place.

My plan is to block the packets flow from node2's and node3's MGEN and just leave the packet form node1's MGEN in the scenario where a packet is transmitted by node1, then forwarded by node2 and transmitted to node3. I don't know if I can block the traffic flow from node2 and node3 and send packets from node1 to node3.

Best, Shaoyi

weston-nrl commented 4 years ago

Thank you very much! I got your points, do you mean MGEN can get packet information no matter whether the packets are received by receiver if the scenario satisfies the two conditions?

Yes.

Can you please tell me in a scenario where a packet is transmitted by node1, then forwarded by node2 and received by node3, how does the packet is processed by node2? Will it be transmitted to node2's MGEN and be resent to node2's EMANE or be forwarded to node 3 directly by node2's EMANE? I am sorry I am not sure about whether the problem is related to EMANE or MGEN.

None of the above, forwarding packets is not the responsibility of EMANE or MGEN. MGEN sends and receives packets, it does not forward. EMANE sets up a virtual version of a physical topology, it does not forward packets. Forwarding packets (or "routing" if you want something to Google) is done via the exact same methods that it would be if you were to construct the scenario physically -- that is, standard OS/kernel forwarding methods and/or routing protocols, depending on your setup, packet type, etc. It is up to you to set that up, and the fact that you are using MGEN and EMANE is absolutely irrelevant, the methods are the same for any packet type and a physical network instead of EMANE (that's much of the point of emulation).

szl0144 commented 4 years ago

Hi,

Thank you for your reply, I have followed your advice to configure the routing table to do a packets forwarding. Another question I have in MGEN usage is when I set a uniformly random message sizes in traffic using MGEN command [ ], such as POISSON [1 824:1224], the command doesn't work. All of the message are in the size of 824, which is the minimum size. Can you please tell me where the problem is? My MGEN version is 5.02b, I use MGEN with EMANE v1.2.4.

Best, Shaoyi

bebopagogo commented 4 years ago

That feature is version 5.1 and greater I think (the random size option).  I.e., the latest “git clone” from GitHub should give you that capability.

From: Shaoyi Li notifications@github.com Reply-To: USNavalResearchLaboratory/mgen reply@reply.github.com Date: Sunday, August 16, 2020 at 3:52 PM To: USNavalResearchLaboratory/mgen mgen@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [USNavalResearchLaboratory/mgen] Questions of using mgen with EMANE (#19)

Hi,

Thank you for your reply, I have followed your advice to configure the routing table to do a packets forwarding. Another question I have in MGEN usage is when I set a uniformly random message sizes in traffic using MGEN command [ sizeMin:sizeMax], such as POISSON [1 824:1224], the command doesn't work. All of the message are in the size of 824, which is the minimum size. Can you please tell me where the problem is? My MGEN version is 5.02b, I use MGEN with EMANE v1.2.4.

Best, Shaoyi

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

szl0144 commented 4 years ago

Thank you for your reply, I have download MGEN and install as you mentioned,

git clone https://github.com/USNavalResearchLaboratory/mgen.git cd mgen git clone https://github.com/USNavalResearchLaboratory/protolib.git cd makefiles make -f Makefile.linux

But when I run it in EMANE, the MGEN log file shows nohup: failed to run command 'mgen': No such file or directory. Can you please tell me how to solve this error? I have found the command in EMANE, the command is as following.

nohup mgen \ input $mgeninput \ output $mgenoutput \ $startoption \ txlog &> $logfile &

Thank you very much!

weston-nrl commented 4 years ago

Nohup is a linux commandline utility that fires off a disconnected linux commandline with the given command. The error is a standard 'no such file or directory' error with the standard meaning for that -- the 'mgen' executable is not in your PATH, so you cannot run it as just 'mgen'. You can run it explicilty usign its full path ('/path/to/mgen', whatever path that may be to the complied 'mgen' executable), or you can add it to your PATH explicilty or by copying/symlinking the 'mgen' executable into some directory that's already in your PATH(e.g. /usr/local/bin)

szl0144 commented 4 years ago

Thank you for your swift reply, I change the path to the mgen input file in emane-tutorial/8, I run the mgen as:

sudo nohup /home/shaoyi/emane3.0/emane-tutorial/8/mgen \ input $mgeninput \ output $mgenoutput \ $startoption \ txlog &> $logfile &

When I check the mgen.log file, the file shows:

/home/shaoyi/emane3.0/emane-tutorial/8/mgen: 1: /home/shaoyi/emane3.0/emane-tutorial/8/mgen: TTL: not found /home/shaoyi/emane3.0/emane-tutorial/8/mgen: 3: /home/shaoyi/emane3.0/emane-tutorial/8/mgen: 0.0: not found /home/shaoyi/emane3.0/emane-tutorial/8/mgen: 5: /home/shaoyi/emane3.0/emane-tutorial/8/mgen: 0.0: not found /home/shaoyi/emane3.0/emane-tutorial/8/mgen: 7: /home/shaoyi/emane3.0/emane-tutorial/8/mgen: 90.0: not found

Can you please tell me where is the error?

szl0144 commented 4 years ago

I found where the problem is, I didn't link the command path to the correct mgen executable file's folder, the correct file locates in mgen/src/makefiles, it doesn't exist in emane folder. I can get the random uniform packet size right now.

Thank you very much!