[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] Problem in UDP send
From: |
'ZENG Ming' |
Subject: |
RE: [lwip-users] Problem in UDP send |
Date: |
Tue, 8 Nov 2005 16:31:09 +0100 |
Hi,
Anybody my problem following? Thanks.
Is there any format requirement on the pbuf which will be sent by
UDP_Send() ?
As the netconn_send() works properly while the UDP_Send() not........
:-(
When using raw API,
after called UDP_Send, lwIP can send ARP to get the dest MAC
address successfully,
but then, there's no UDP packet actually sent out....
regards
Ming
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of 'ZENG
Ming'
Sent: Sunday, November 06, 2005 4:28 PM
To: address@hidden
Subject: [lwip-users] Problem in UDP send
Hi all,
I'm trying to test throughput with UDP protocol.
And got something wrong with RAW API, while the Sequence API
(netconn_*)worked fine.
I'm using current CVS version of lwIP, and the problem always existed no
matter enable ARP_QUEUEING or not.
With following function, I only got 2000 ARP requests ( with 2000 ARP
replies ), but no UDP packet was sent out.
//------------------------------------------
void udp_test_Raw(void)
{
struct ip_addr ipaddr;
struct udp_pcb *pcb;
struct pbuf *pb;
INT16U i;
char str[1400]="1234567890";
IP4_ADDR(&ipaddr, 192,168,11,120);
pcb = udp_new();
udp_connect(pcb, &ipaddr, 12024);
pb = pbuf_alloc(PBUF_TRANSPORT, 0, PBUF_REF);
pb->payload = str;
pb->len = pb->tot_len = 1400;
for (i=0;i<2000;i++) udp_send(pcb, pb);
pbuf_free(pb);
udp_remove(pcb);
}
//---------------------------------
I've also tried to use sequence API as following, and it worked
properly.
One ARP was sent first, and then 1999 UDP packets.
( If ARP_QUEUEING enabled, 2000 UDP packets were sent. )
//*********************************
void udp_test_Sequence(void)
{
struct ip_addr ipaddr;
struct netconn *conn;
struct netbuf *nb;
INT16U i;
char str[1400]="1234567890";
IP4_ADDR(&ipaddr, 192,168,11,120);
conn = netconn_new(NETCONN_UDP);
netconn_connect(conn, &ipaddr, 12024);
nb = netbuf_new();
netbuf_ref(nb,str,1400);
for (i=0;i<2000;i++) netconn_send(conn, nb);
netconn_close(conn);
netbuf_free(nb);
netbuf_delete(nb);
netconn_delete(conn);
}
//**********************************
Have I done anything wrong? Especially about how to use UDP raw API.....
--
************************************************************************
********
Zeng, Ming
NIKHEF, Kruislaan 409
1098 SJ Amsterdam - The Netherlands
email: address@hidden
Tel. 31 (0)20 592 2147
Mobile 31 (0)6 4351 5283
************************************************************************
********
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users