hi, Florin Coras I may not have described clearly im use vpp version 2101
1.sendto function problem i use LDP for c socket program with udp then i find if only use sendto function is error , this is client code int main () { int sockfd = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); struct sockdaddr_in server = {0}; server.sin_addr.s_addr = inet_addr (192.168.1.1); server.sin_port = htons (8888); server.sin_family = AF_INET; char msg[] = "hello"; /* this is not same */ sendto (sockfd, msg, sizeof (msg), 0, (struct sockaddr *) &server , sizeof (server)); close (sockfd); return 0; } this code vpp will report remote ip cannot connect error but if use connect function,like this int main () { int sockfd = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); struct sockdaddr_in server = {0}; server.sin_addr.s_addr = inet_addr (192.168.1.1); server.sin_port = htons (8888); server.sin_family = AF_INET; char msg[] = "hello"; /* this is not same */ connect (sockfd, (struct sockaddr*)&server, sizeof (server)); sendto (sockfd, msg, sizeof (msg), 0, (struct sockaddr *)NULL, sizeof (server)); close (sockfd); return 0; } ldp will work fine 2.i find vpp udp proto LDP also use mss, the code has set mss = 1500 - 20 - 8 i think udp packet if biger than MTU , will cause ip fragment rather than like tcp user mss (this is a good design) but now i need send a 4K udp packet use ip fragment not use mss, because if udp into mss size i also need reassemble(i need data), if use ip fragment and reassemble, i can get data easily 3."it cannot stop" is that client send "hello" once, if i use command "show int", the packet will increase 1 and stop, but i set startup.conf udp mtu biger than 1500, i still send "hello" and cannot stop, the count always increase and server also can receive it if mtu less than 1500 ,it is ok by the way, my nic that vpp manage mtu is 9000, startup.conf udp { mtu 9000 } will cause this question best Florin Coras <fcoras.li...@gmail.com> 于2022年5月22日周日 06:57写道: > Hi, > > > > > On May 20, 2022, at 2:31 AM, NUAA无痕 <nuaawan...@gmail.com> wrote: > > > > hi,vpp expert > > now im use vpp hoststack for udp, i meet some problems > > > > 1.udp socket must use connect function, if user sendto will cause ip > address not connect error > > What version of vpp are you using? Although we prefer connected udp for > performance reasons, sendto should work. If socket was not connected/bound, > vcl should connect it. What’s the exact error you’re getting and what are > you trying to do? > > > > > 2.if i use udp socket send packet biger than 1500, udp will split many > packet, is some method let it dont split > > What exactly are you trying to achieve? Session layer chops datagrams into > mss sized packets. If you’re trying to send large datagrams, up to nic mtu > size, then as you did lower, increase udp mtu. > > > > > 3.startup.conf set udp { mtu 9000 }, then use hoststack send one packet, > it will always send packet and cannot stop, the mtu must less than 1500 > > Not sure I understand what you mean by “it cannot stop”? If by chance > you’re trying to force ip fragmentation, that’s not supported with udp > sessions. > > Regards, > Florin > > > > > can u give some suggestions? than u > > > > > > > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#21454): https://lists.fd.io/g/vpp-dev/message/21454 Mute This Topic: https://lists.fd.io/mt/91227351/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-