lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] UDP bind error due to address and port reuse


From: Noam Weissman
Subject: Re: [lwip-users] UDP bind error due to address and port reuse
Date: Wed, 7 Dec 2016 09:45:48 +0000

Hi,

I do not understand the logic in your design. If you send data to one IP why 
use 5 different ports ?
Either send some header that differentiate the 5 messages and in one receive 
function filter them
to different recipient ?

As for your question:
First of all you listen on one single port, meaning you bind IP+port to one PCB.

Secondly when you send data you use udp_sendto (RAW API) or similar if you use 
Netconn or Socket API

The udp_sendto  function accepts IP and port:
      err_t udp_sendto(struct udp_pcb *pcb, struct pbuf *p,  ip_addr_t *dst_ip, 
u16_t dst_port)

As for reply UDP packets from remote you better add some data in the reply that 
will give you 
the correlation with the data sent.


Hope that helped.

BR,
Noam.


-----Original Message-----
From: Surya Chaitanya [mailto:address@hidden 
Sent: Wednesday, December 07, 2016 10:53 AM
To: Mailing list for lwIP users
Cc: Noam Weissman; address@hidden; address@hidden
Subject: Re: [lwip-users] UDP bind error due to address and port reuse

Hi Noam,

Our situation is something like this:

We have a Xilinx FPGA board. From one source port on the board, we would like 
to send 5 UDP request packets to 5 different destination port numbers on a PC. 
And, we would also like to receive 5 response packets, one from each of the 5 
ports on the PC to the single port on the FPGA board. Please let us know how to 
achieve this using the lwIP stack. Thank You.

Regards,
Surya




On Sat, 3 Dec 2016 12:56:52 +0000, Noam Weissman wrote
> Hi,
> 
> If I understand you correctly you are trying to bind IP:port several 
> times on the same machine
> 
> without closing the previous bind ?
> 
> This is not an option. You can bind UDP and TCP separately with two 
> different pcb's one for
> 
> TCP and one for UDP.
> 
> You cannot bind an IP:Port more then one time. This is the meaning of binding.
> 
> Its like a marriage between IP and a Port. Until you do not divorce 
> you cannot marry again [UTF-8?][😊]
> 
> BR,
> 
> Noam.
> 
> ________________________________
> From: lwip-users <address@hidden> on 
> behalf of Surya Chaitanya <address@hidden>
 Sent: Saturday, December 3, 2016 10:44 AM
 
> To: address@hidden
 Subject: [lwip-users] UDP bind error due to address 
> and port reuse
> 
> Hi,
> 
> I've been trying to use lwip to transfer UDP packets. In my situation, 
> in the client
 application, I would like to create 5 UDP PCBs having the same IP 
> address and port
 number. Inspite of setting the SO_REUSE flag to 1, and 
> setting the SOF_REUSEADDR flag
 to 1 for all the PCBs, the UDP bind error 
> still persists. Could somebody pls. help me
 out? Thank You.
> 
> Disclaimer:
> ----------
> 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 are not the
 intended recipient you are notified that disclosing, 
> copying, distributing or taking
 any
 action in reliance on the contents of 
> this information is strictly prohibited. The
 sender does not accept liability 
> for any errors or omissions in the contents of this
 message, which arise as a 
> result of e-mail transmission.
> 
> --
> Open WebMail Project (http://openwebmail.org) Open WebMail 
> Project<http://openwebmail.org/> openwebmail.org INTRODUCTION. Open 
> WebMail is a webmail system based on the Neomail version
> 1.14 from Ernie Miller. Open WebMail is designed to manage very large 
> mail folder ...
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users
> lwip-users -- Mailing list for lwIP users -  
> lists.nongnu.org<https://lists.nongnu.org/mailman/listinfo/lwip-users>
 
> lists.nongnu.org
 Welcome to the lwip-users mailing list. Use it to ask 
> questions, share your experience and discuss new ideas. To see the 
> collection of prior postings to the list ...


Disclaimer:
----------
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 are not the intended recipient you are notified that disclosing, copying, 
distributing or taking any action in reliance on the contents of this 
information is strictly prohibited. The sender does not accept liability for 
any errors or omissions in the contents of this message, which arise as a 
result of e-mail transmission.

--
Open WebMail Project (http://openwebmail.org)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]