why udpServer receive every packet twice

97 views
Skip to first unread message

丁磊

unread,
Nov 22, 2015, 7:50:49 AM11/22/15
to ns-3-users
hi~

I met such a problem that every packet the udpClinet send, it will be received twice at the udpServer. Here is the log info :

TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 7 Time: 1
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 0 Uid: 7 TXtime: +1000000000.0ns RXtime: +1007079060.0ns Delay: +7079060.0ns
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 0 Uid: 7 TXtime: +1000000000.0ns RXtime: +1007079060.0ns Delay: +7079060.0ns
TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 14 Time: 2
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 1 Uid: 14 TXtime: +2000000000.0ns RXtime: +2001476334.0ns Delay: +1476334.0ns
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 1 Uid: 14 TXtime: +2000000000.0ns RXtime: +2001476334.0ns Delay: +1476334.0ns
TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 19 Time: 3
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 2 Uid: 19 TXtime: +3000000000.0ns RXtime: +3001476667.0ns Delay: +1476667.0ns
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 2 Uid: 19 TXtime: +3000000000.0ns RXtime: +3001476667.0ns Delay: +1476667.0ns
TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 21 Time: 4
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 3 Uid: 21 TXtime: +4000000000.0ns RXtime: +4001477000.0ns Delay: +1477000.0ns
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 3 Uid: 21 TXtime: +4000000000.0ns RXtime: +4001477000.0ns Delay: +1477000.0ns
TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 26 Time: 5
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 4 Uid: 26 TXtime: +5000000000.0ns RXtime: +5003197334.0ns Delay: +3197334.0ns
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 4 Uid: 26 TXtime: +5000000000.0ns RXtime: +5003197334.0ns Delay: +3197334.0ns
TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 28 Time: 6
SendAssociationRequest 0 ReceiveAssocResponse 0.000544337
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 5 Uid: 28 TXtime: +6000000000.0ns RXtime: +6001477667.0ns Delay: +1477667.0ns
TraceDelay: RX 1012 bytes from 10.1.1.1 Sequence Number: 5 Uid: 28 TXtime: +6000000000.0ns RXtime: +6001477667.0ns Delay: +1477667.0ns
TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 34 Time: 7
TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 42 Time: 8
TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 46 Time: 9
TraceDelay TX 1024 bytes to 10.1.1.2 Uid: 53 Time: 10
0 600 SendAssociationRequest 6 ReceiveAssocResponse 6.00185


my simulation is like this:
I have several access point(AP), all these APs are connected with an csma switch. Each apNode has a wifiNetDevice and a csmaDevice. The two decices is connected with bridge.
The udpClient is on the mobile station and udpServer is on one of the ap.

I have upload my code.

Is there anyone that can give me some suggestion why this happen? 
thank you



dinglei-twoap-largescale.cc

Tommaso Pecorella

unread,
Nov 22, 2015, 9:44:54 AM11/22/15
to ns-3-users
I'd say that it's because you installed IP on both the WiFi interface and the bridged interfaces in the APs. In this way the Ip layer will get two packets.
I didn't try to comment the lines, but I'm quite confident that it's [one of] the problem(s).


T.

丁磊

unread,
Nov 22, 2015, 9:39:03 PM11/22/15
to ns-3-users
yeah~that's it~
thanks~

在 2015年11月22日星期日 UTC+8下午10:44:54,Tommaso Pecorella写道:

tangguo...@gmail.com

unread,
Nov 23, 2015, 2:39:11 AM11/23/15
to ns-3-users
你好,了解无线传感器网络Range-Free定位算法这一块不?谢谢~

在 2015年11月22日星期日 UTC+8下午8:50:49,丁磊写道:

丁磊

unread,
Dec 17, 2015, 12:50:19 AM12/17/15
to ns-3-users
hi~Tommsao,

I have a new problem. I have tried several days but I can solve it.I beg you can give me some advice.

I'm trying to optimize the mac layer handoff process in 802.11.
my scenario is like the example "wifi-wired-bridging.cc", 3 access points were put in a straight line:

ap1 -----(300m)------ ap2 ------(300m)------ ap3

sta1 --->                                             sta2

sta1 is moving toward ap3 with constant speed, sta2 stands under ap3.
sta1 is udpclient and sta2 is the server.

my problem is: there is an one second delay between the success of mac layer handoff ( sta1 to ap2 ) and the data packets can be transmitted and forwarded successful.
In this second the StaWifiMac do not send packets

I have traced this problem into "m_downTarget (packet, saddr, daddr, PROT_NUMBER, route); " in "UdpL4Protocol::Send (Ptr<Packet> packet, Ipv4Address saddr, Ipv4Address daddr, uint16_t sport, uint16_t dport,Ptr<Ipv4Route> route)"
But I do not know where should I check next?

Please give me some advice why this happen and how to remove this delay

Thank you.
 

在 2015年11月22日星期日 UTC+8下午10:44:54,Tommaso Pecorella写道:
I'd say that it's because you installed IP on both the WiFi interface and the bridged interfaces in the APs. In this way the Ip layer will get two packets.

Tommaso Pecorella

unread,
Dec 17, 2015, 6:29:32 AM12/17/15
to ns-3-users
Hi,

no idea, it could depend on the IP allocation, the gateway change and, most importantly, the ARP cache refresh / lookup.
Check if and how the node routing table is updated, probably you'll find some interesting insights.

T.
Reply all
Reply to author
Forward
0 new messages