FreeRTOS+TCP Multi: One Interface with two different IP Addresses (Two or more endpoints)

The new version of FreeRTOS+TCP will allow the use of multiple interfaces, multiple IP-addresses and optionally IPv6.
Each interface will have one or more end-points.

An end-point is not only an IP-address, it also has properties like:

  • IP version (4 or 6)
  • Net mask
  • Gateway address
  • DNS server address
  • MAC-address
  • DHCP- or RA-client (RA = Router Advertisement)

Suppose you have one Network Interface. It can have several end-points, e.g.:

  1. 192.168.1.23 (assigned by DHCP), with gateway
  2. 2001:470:36:a6::1002 (obtained from RA)
  3. 172.16.0.15 (static IP-address)

It is allowed to have two end-points with the same netmask, e.g. 192.168.1.10 and 192.168.1.11 (with netmask 192.168.2.x). This design is not recommended, because the IP stack can not determine which end-point to use (x.10 or x.11). It will take the first matching end-point.

Is it possible to share a MAC-address among IP-addresses? Yes! That is no problem. This is also sometimes called IP-aliasing.

The opposite is not allowed: the same IP-address on different MAC-addresses. That is considered an IP-conflict.

We have one EMAC on STM32. So we will have one MAC address

Not necessarily. Every EMAC has a MAC-address filter. You can configure up to 4 MAC-addresses. Also it has an algorithmic approach which filters on the hash value of a MAC-address (often used for multicast addresses).

But yeah support two IP addresses on same MAC address or
different MAC address if supported in EMAC of STM32.

Both will be possible

Normally, a unique MAC address is obtained from a MAC-address chip. You can not just use a random number. So the more MAC-addresses you use, the higher the cost of the hardware.