[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] VRF with LwIP
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] VRF with LwIP |
Date: |
Wed, 26 Apr 2017 15:28:54 +0200 |
Antoine Zen-Ruffinen wrote:
> I am worried about the case when both interface get the same private IP
> address (like 192.168.1.xxx) but in physically separated networks (I think
> that could happened).
In the past, we said lwIP does not support this. However, IPv6 should already
support it and even ARP supports it because of AutoIP (where this can happen by
design).
Being like that, what is missing would be something like SO_BINDTODEVICE. That
shouldn't be too hard to implement simply skip the routing phase and use the
bound netif for output). It even seems a preliminary for VRF:
"Processes can be "VRF aware" by binding a socket to the VRF device."
However, for lwIP, something like VRF is overkill: we don't have a traditional
routing table (unless you use the hooks to add one yourself), we only have one
"gateway" per netif.
That gateway is handled in ARP output (overridable via LWIP_HOOK_ETHARP_GET_GW).
> It will also need to have two routing and ARP table I think.
As stated above, no need for that with lwIP.
> Also, I think a possible solution would be to have TWO stack running in
> parallel (I know, it would consume twice the RAM). Has anybody ever done this
> ? Does the code allow this, or is the TCP/IP stack "singleton" ?
That would be what linux does with network namespaces. As you can easily see
from the sources, lwIP can't do that as it makes heavy use of global variables.
Simon