UDP Server and Client application with WiFi channels

135 views
Skip to first unread message

Ujjval Rathod

unread,
Oct 14, 2021, 7:08:55 AM10/14/21
to ns-3-users
Hi,

I have a simple schenario with a network which has one WiFi Access-point and Station.

A Station(Client) sends a UDP trafic to the Access-Point(Server). The following code is with two applications one of which is running on Client and another on the server. 

After I run the entire program I could see the packets are being transmittd but do not see them being received at Server. Anyone has an idea with WiFi based UDP configurations?

LogComponentEnable("UdpClient", LOG_LEVEL_INFO);
LogComponentEnable("UdpServer", LOG_LEVEL_INFO);

//Access Point app
  UdpServerHelper Server(9999);
  ApplicationContainer serverApps = Server.Install(wifiApNode.Get(0));
  serverApps.Start(Seconds(1.0));
  serverApps.Stop(Seconds(10.0));

//Station App
  UdpClientHelper Client (interfaces1.GetAddress(0), 9999);
  Client.SetAttribute("MaxPackets", UintegerValue(10));
  Client.SetAttribute("Interval", TimeValue(Seconds(1)));
  Client.SetAttribute("PacketSize", UintegerValue(1024));
  ApplicationContainer clientApps = Client.Install (wifiStaNode.Get(0));
  clientApps.Start(Seconds(2.0));
  clientApps.Stop(Seconds(10.0));

Ujjval Rathod

unread,
Oct 17, 2021, 12:53:04 AM10/17/21
to ns-3-users
Hi,

I am still looking for a solution if someone has got an idea please let me know.

Regards,

Adil Alsuhaim

unread,
Oct 20, 2021, 7:33:54 PM10/20/21
to ns-3-users
You didn't provide much details for me to pinpoint the problem, but my guess is that packets might be dropped because nodes do not have routing table, so maybe your code needs something like

Ipv4GlobalRoutingHelper::PopulateRoutingTables ();

So that routing tables are created.

Cheers,
Adil

Ujjval Rathod

unread,
Oct 21, 2021, 1:42:00 AM10/21/21
to ns-3-users

Hi,

Thanks for your reply. 

I can attach the code for you. I have created the routing tables but still, it does not seem to be working.

Moreover, as I have said there are Server and Client apps running on the different nodes. Please see the attached image.

Sincerely,
Ujjval
task.svg
udpsim.cc

Mahdi Hasnat Siyam

unread,
Feb 3, 2022, 2:17:19 PM2/3/22
to ns-3-users
Hello There,
I have modified your code a little bit and it seems to be working 

Ujjval Rathod

unread,
Feb 4, 2022, 4:59:14 AM2/4/22
to ns-3-...@googlegroups.com
Hi Mahdi,

Thanks for sharing. It was a while ago that I have written that code with ns3. I will look into it again. Use diff. from Linux to see the changes you have made!!

Regards,
Ujjval

--
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/dTpcdxoP70I/unsubscribe.
To unsubscribe from this group and all its topics, 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/22a2b0bf-56b5-4379-a30e-ccdd9aa5f8bbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages