Re: [lwip-users] ARP forwarding

2022-12-13 Thread Eric Koldeweij via lwip-users

Hello,

You would need to implement a switch/bridge. LWIP is an IP stack which 
is something quite different.
Implementing a L2 bridge is not difficult but you do need to know the 
theory and I suggest a lot of reading. I have implemented bridges on 
Xilinx FPGA's many times, with or without LWIP. If you need to 
receive/send IP packets LWIP can be placed on top of your switch code.


I can recommend "The Switch Book" by Rich Seifert, ISBN 0-471-34586-5. 
Everything you need to know about Ethernet switching and much much more.


Regards,
Eric.

On 13-12-2022 17:50, Александр via lwip-users wrote:

Hello!
I am trying to implement dual ethernet interface device on Xilinx 
baremetal logic. I’v already implement receiving data from both of two 
interfaces but now I want to realize forwarding from one interface to 
another. I’v connected to 1st interface and try to ping the second 
one. On wireshark I see arp requests that have no responses.

May be problem is in forwarding of broadcast messages?
#if IP_FORWARD
    /* non-broadcast packet? */
    if (!ip4_addr_isbroadcast(ip4_current_dest_addr(), inp)) {
      /* try to forward IP packet on (other) interfaces */
      ip4_forward(p, (struct ip_hdr *)p->payload, inp);
    } else
#endif /* IP_FORWARD */
I can not understand this part. Why do we forward only unicast messages?
Sorry, i am niewbe in this stuff

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


Re: [lwip-users] ARP forwarding

2022-12-13 Thread Eric Koldeweij via lwip-users

Um. Yes, you are right.

Regards,
Eric.

On 13-12-2022 20:19, Александр via lwip-users wrote:
Thank you all very much. I’v got some experience of routing frames on 
FPGA, but didn’t use lwip for this purposes. Yes you are right — I 
need bridge. Forwarding data is not the main function of this device 
but sometimes I need to connect to the computer on the other side of 
my device. So I need to forward broadcast arps by programming 
logic(for example), as far as I understand. And there is no option to 
use lwip in bridge mode. Am I right?


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users




___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users