Featured post
network programming - What causes udp reception delay? -
i have noticed when sending packets @ intervals udp socket, first packet sent seems delayed. example, if sending packets every 100 ms, find delay between receiving packets distributed mean 100ms , average standard deviation of 4, on network. however, gap between receive time first , second packets around 10 40 ms - can see, that's statistically significant difference, , question is, what's causing it?
i'm using sendto function c on linux. suggested delay might caused arp resolution preventing packet being sent until destination ip has been converted mac address - likely? if restart sending program first packet again takes long though, , delay inconsistent - 10 40 ms pretty big range.
i need find out why first packet taking long, , how work around it.
edit: further analysis pcap indicates sending program sending packets @ right interval. problem must receiver, using select() wait readable socket, calling recvfrom , printing packet. there sort of buffering going on there might not know about?
you have asked workarounds. 1 possible workaround, if reception time of packet important know, set so_timestamp
socket option. allow obtain time each packet received destination kernel - can use time in subsequent processing rather "current time".
alternatively, have sender include high resolution timestamp in packet sends, , use those.
- Get link
- X
- Other Apps
Comments
Post a Comment