Problem in UDP send

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem in UDP send

ming-2
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: [hidden email]
Tel.   31 (0)20 592 2147
Mobile 31 (0)6 4351 5283
************************************************************************
********



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem in UDP send

Christiaan Simons
lwip-users-bounces+christiaan.simons=[hidden email] wrote on 06-11-2005
16:28:09:


>
> Have I done anything wrong? Especially about how to use UDP raw API.....
>

I think you've missed the udp_bind().

Also I've just updated the doc/rawapi.txt.
It should be a fairly complete explanation of the raw API.

Christiaan Simons

Hardware / Software Engineer
Axon Digital Design

+31 (0)13 511 66 66
+31 (0)13 511 41 51

http://www.axon.tv

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named.  If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

RE: Problem in UDP send

ming-2
In reply to this post by ming-2
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: lwip-users-bounces+ming=[hidden email]
[mailto:lwip-users-bounces+ming=[hidden email]] On Behalf Of 'ZENG
Ming'
Sent: Sunday, November 06, 2005 4:28 PM
To: [hidden email]
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: [hidden email]
Tel.   31 (0)20 592 2147
Mobile 31 (0)6 4351 5283
************************************************************************
********



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

RE: Problem in UDP send

Christiaan Simons

lwip-users-bounces+christiaan.simons=[hidden email] wrote on 08-11-2005
16:31:09:

> Anybody my problem following? Thanks.

As I said before, I think you forgot to call udp_bind().
Bye,

Christiaan Simons

Hardware / Software Engineer
Axon Digital Design

+31 (0)13 511 66 66
+31 (0)13 511 41 51

http://www.axon.tv


This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named.  If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

RE: Problem in UDP send

Kieran Mansley
In reply to this post by ming-2
On Tue, 2005-11-08 at 16:31 +0100, 'ZENG Ming' wrote:

> 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....

A complete stab in the dark - I've not had much to do with the ARP code
- but are you calling the timers correctly?  Someone else may be able to
define what "correctly" means for ARP.

Kieran



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

RE: Problem in UDP send

ming-2
In reply to this post by Christiaan Simons
Hi  Christiaan.  

Yes, you are right. That's it..


I haven't seen your previous reply,
seems it's lost on the way from mailing list to my email..... so
strange. :-(

So sorry about that,  and thanks a lot !  


regards,  Ming


-----Original Message-----
From: lwip-users-bounces+ming=[hidden email]
[mailto:lwip-users-bounces+ming=[hidden email]] On Behalf Of
Christiaan Simons
Sent: Tuesday, November 08, 2005 4:57 PM
To: Mailing list for lwIP users
Subject: RE: [lwip-users] Problem in UDP send



lwip-users-bounces+christiaan.simons=[hidden email] wrote on
lwip-users-bounces+08-11-2005
16:31:09:

> Anybody my problem following? Thanks.

As I said before, I think you forgot to call udp_bind().
Bye,

Christiaan Simons

Hardware / Software Engineer
Axon Digital Design

+31 (0)13 511 66 66
+31 (0)13 511 41 51

http://www.axon.tv


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this email in error please notify the
system manager. This message contains confidential information and is
intended only for the individual named.  If you are not the named
addressee you should not disseminate, distribute or copy this e-mail.



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users