avatar
s*e
1
Several application processes run on the same machine. They communicate with
each other with UDP packets. Why some UDP packets are lost? The destination
address of the UDP packets is the machine's IP address, not 127.0.0.0.
Since the application processes are on the same machine, the UDP packets go
from application layer to network layer, then back to the application layer.
They will not reach link layer, right?
Thanks.
avatar
c*d
2
Buffer overflow..so packets are dropped..

with
destination
go
layer.

【在 s****e 的大作中提到】
: Several application processes run on the same machine. They communicate with
: each other with UDP packets. Why some UDP packets are lost? The destination
: address of the UDP packets is the machine's IP address, not 127.0.0.0.
: Since the application processes are on the same machine, the UDP packets go
: from application layer to network layer, then back to the application layer.
: They will not reach link layer, right?
: Thanks.

avatar
z*r
3
I agree

【在 c****d 的大作中提到】
: Buffer overflow..so packets are dropped..
:
: with
: destination
: go
: layer.

avatar
s*e
4
I checked my system. The default UDP buffer setting is about 250K. If I make
it larger, like 10M, is there any problem? Assume memory is enough. THX.

【在 z**r 的大作中提到】
: I agree
avatar
z*r
5
if you have a huge buffer, you will suffer the latency then. you can try
different combination to figure out the best buffer size for you.

make

【在 s****e 的大作中提到】
: I checked my system. The default UDP buffer setting is about 250K. If I make
: it larger, like 10M, is there any problem? Assume memory is enough. THX.

avatar
z*r
6
not sure your burst rate, but looks 250kB is not small

【在 z**r 的大作中提到】
: if you have a huge buffer, you will suffer the latency then. you can try
: different combination to figure out the best buffer size for you.
:
: make

avatar
s*e
7
Is buffer like FIFO?

【在 z**r 的大作中提到】
: if you have a huge buffer, you will suffer the latency then. you can try
: different combination to figure out the best buffer size for you.
:
: make

avatar
L*t
8
If some app is overrun, just a matter of time to overflow no matter how big
a buffer you got.
I would suggest you check out drop counters first to see where packet drop
happens.

make

【在 s****e 的大作中提到】
: I checked my system. The default UDP buffer setting is about 250K. If I make
: it larger, like 10M, is there any problem? Assume memory is enough. THX.

avatar
s*e
9
I wrote two small programs. One is server, one is client. Both the server
and client run on the same machine. Each time the client runs, it sends out
100000 UDP packets within 2 min. The size of each packet is 1KB. Maybe it is
too much, right?
I use setsockopt() to change the SO_RCVBUF. I found that even if I make the
buffer very larger, it does not help, on the contrary, more packets are
dropped. Even for the same buffer size, the result varies.
Do I need to adjust SO_SNDBUF? If SO_SNDBUF is to

【在 z**r 的大作中提到】
: if you have a huge buffer, you will suffer the latency then. you can try
: different combination to figure out the best buffer size for you.
:
: make

avatar
s*e
10

big
~~~~~~~~~~~~~~~~~~~~~~~
How to do it?

【在 L******t 的大作中提到】
: If some app is overrun, just a matter of time to overflow no matter how big
: a buffer you got.
: I would suggest you check out drop counters first to see where packet drop
: happens.
:
: make

avatar
s*e
11
Below is the code for server and client:
For server:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std ;
int main(int argc, char **argv) {
int SendSocket;
struct sockaddr_in SendAddr, ClentAddr;
int Port = 9999;
char SendBuf[1024];
int BufLen = 1024;
int RecvLen = 0;
int socketFd;
socketFd = socket(
avatar
c*d
12
你的最终目的是什么? 测试UDP? 还是有其它指标你要测试?
为什么你要确保no packet drop? 如果是这样, 你可以自己做
flow control 呀. 在做Emulation?

【在 s****e 的大作中提到】
: Below is the code for server and client:
: For server:
: #include
: #include
: #include
: #include
: #include
: #include
: #include
: #include

avatar
v*n
13
if on the same machine, why not using domain socket instead of UDP?
Anyway, you are still gonna run into message drop problem, if the receving
process can't keep up with the sending rate.....
In your case, the data is probably dropped even before reach the net stack.
i mean the syscall has rate upper limit.

with
destination
go
layer.

【在 s****e 的大作中提到】
: Several application processes run on the same machine. They communicate with
: each other with UDP packets. Why some UDP packets are lost? The destination
: address of the UDP packets is the machine's IP address, not 127.0.0.0.
: Since the application processes are on the same machine, the UDP packets go
: from application layer to network layer, then back to the application layer.
: They will not reach link layer, right?
: Thanks.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。