Unexpected wifi packet delay

127 views
Skip to first unread message

Issa S. Mlimbila

unread,
Feb 20, 2025, 4:46:11 AMFeb 20
to ns-3-users
Hi all,
Am experiencing unexpected delay in for wifi transmission, i have tried to reduce csma delay attribute but am still getting a delay of 1 second gap btn reception logging. Please help. Attached is code snippet and log timings.  
QUESTION3.c
Screenshot from 2025-02-20 14-39-10.png

Tommaso Pecorella

unread,
Feb 21, 2025, 5:45:04 PMFeb 21
to ns-3-users
A couple of considerations...

1) It looks like an assignment. Academic integrity forbids us to give you too much help on that.
2) Without a complete script and a description of what you're supposed to do we couldn't help, even if we wanted.

Issa S. Mlimbila

unread,
Mar 7, 2025, 1:01:23 PMMar 7
to ns-3-users
Thanks for reply and sorry for long delay

Of course it is an assignment, however i have extended it to practise and get myself understand the material.
That question is almost expired, now i have new related one. I have pointtopoint in which one node, p2pnode(1) act as access point to wifi stations. Now i want to send packets from external interface using tapbridge to this p2p node, i have used csma gateway node to connect with this p2pnode because p2p by itself didn't manage tap bridge. I have configured tap device and gateway node in difference subnet and make packets injection from hping3 and scapy but packets don't reach the target node while tcp dump is capturing (attachment). To make things simple, i have combined hping3, scapy, tcpdump and ping on  the same file together with command to run the ns3 program as well to allow possible sleep for fixing timings mismatch, but all cmd open in separate terminal. Any ideas why packets are not reaching the target IP 10.1.1.2. I have attached files for reference.

Thanks in advance
packet_flood.sh
Screenshot from 2025-03-07 22-40-33.png
Screenshot from 2025-03-05 12-24-19.png
Screenshot from 2025-03-07 22-40-03.png
Screenshot from 2025-03-07 22-54-51.png
Screenshot from 2025-03-07 22-42-51.png
ns3 program.cc
Screenshot from 2025-03-07 22-53-01.png

Tommaso Pecorella

unread,
Mar 7, 2025, 3:59:17 PMMar 7
to ns-3-users
I'd strongly suggest to avoid to reply on ChatGPT to build ns-3 code, and instead to study the examples.

About your problem, the answer is: routing. You didn't set it right, just check carefully the nodes routing tables.

Issa S. Mlimbila

unread,
Mar 7, 2025, 11:31:41 PMMar 7
to ns-3-users
This is my routing table, what is wrong with it.? you can just help me directly: am very young in ns3
Thanks Mr. Tom
Screenshot from 2025-03-08 09-48-46.png

Tommaso Pecorella

unread,
Mar 8, 2025, 1:57:19 PMMar 8
to ns-3-users
Where's the default route?
Right. It's not there.

What about the other nodes?
Not there either.

Issa S. Mlimbila

unread,
Mar 8, 2025, 11:58:54 PMMar 8
to ns-3-users
Sir 
Attached is the topology, 10.1.1.2 is the target point where i need to send packets from tapdevice via gateway node. It is connected to three networks including wifi. I shared a routing configuration that will allow 10.1.3.3 tapdevice ---->10.1.3.2(gatewaynode)---->10.1.1.2(target p2pnode) and then p2pnode (10.1.1.2) should reply back to tapdevice(10.1.3.3) via gateway (10.1.3.2). For testing i have assigned MAC address as shown in the tapbridge configuration attached. Please help

Thanks  

Screenshot 2025-03-09 093743.png
Screenshot 2025-03-09 101833.png

Tommaso Pecorella

unread,
Mar 9, 2025, 4:49:27 AMMar 9
to ns-3-users
It's an assignment, so we can't do it for you. The best we can do is to give hints and suggestions.

First and foremost, a warning is needed: I didn't run your code because I don't have the right setup at hand. Hence, I'm just giving "best guesses".

My best guess is that you have a routing issue.

How to find if I'm right and how to debug it.
1) Inspect all the routing tables (ALL of them, including the "real" nodes).
2) Check if the packets are being sent, and where they're dropped.

To do the 2nd point, use Wireshark.
On the "real" network, just use it as normal.
On the ns-3 part, enable the pcap logging on the links and open the trace with Wireshark.

At one point you'll find where packets are dropped, and you'll have your way to fix the simulation.

This is your assignment. The goal of an assignment is not to do it, it's to LEARN by doing. Fixing the issues is an extremely important part of the learning process.
Hence, you have to debug it yourself.

Issa S. Mlimbila

unread,
Mar 9, 2025, 7:23:43 AMMar 9
to ns-3-users
Thanks for insights, let me debug and i will let you know
(the main program I shared on the first post)

Message has been deleted

Issa S. Mlimbila

unread,
Mar 10, 2025, 2:31:32 PMMar 10
to ns-3-users
Hello Sir

I have tried inspecting and reconfiguring routing tables with no success run, insteady i switched to use Fednetdevice which i hope has less routing configurations than tapbridge. Now i have new problem in this new approach. I tried fd-emu-send.cc example customised to use my real interface enp0s3, packets are being sent but are malformed. I tried to format packet type, headers but still am not getting  packet sent and received, wireshark shows corrupted packets. Please help. (Attached is the customized example and ouputs)

Thanks
Screenshot 2025-03-10 232501.png
fd-emu-send.cc

Tommaso Pecorella

unread,
Mar 10, 2025, 5:19:41 PMMar 10
to ns-3-users
I'm not an expert of FdNetDevice, but it looks like you're adding an extra Ethernet header.

Suggestion: do NOT use ChatGPT to write code. We're not here to fix ChatGPT mistakes.

Reply all
Reply to author
Forward
0 new messages