Can I Implement Routing or Bridging with This Architecture?

Hi everyone,

I’m working on a project where I have two devices running FreeRTOS+TCP as shown in the diagram below. Each device is connected to a separate PC over Ethernet.

  • PC1 has an IP address of 192.168.1.2/24 and is connected to a FreeRTOS+TCP device with an IP address of 192.168.1.199/24 on the Ethernet interface and 10.0.0.2/8 on the wireless interface.
  • PC2 has an IP address of 172.140.0.2/16 and is connected to another FreeRTOS+TCP device with an IP address of 172.140.0.199/16 on Ethernet and 10.0.0.199/8 on the wireless interface.

The wireless interfaces on both FreeRTOS+TCP devices are connected, and the goal is to allow PC1 to access a web server running on PC2 as if both PCs were connected via a switch. Essentially, PC1 should be able to reach PC2 without any issues, ideally through the FreeRTOS+TCP devices.

Would it be possible to implement routing or bridging in this architecture to make this happen? If so, what would be the best approach for FreeRTOS+TCP? Any advice on configuring the routing table or bridging mode would be greatly appreciated.

Thanks in advance!

arch

I am not sure if this is natively supported in FreeRTOS+TCP. One possible way could be to this forwarding at the application. Is there a reason to not have all these devices on the same network?

Hi @capthestone ,

One way to achieve this would be to implement the bridging in FreeRTOS+TCP stack.
Only Bridging would be fine, routing is not needed.
Once the bridging is implemented then a few changes will happen in the above setup which will enable a Webserver running on PC2 to be accessed by PC1. The changes are as below:

  1. All the devices in the network will be in the same net mask.
  2. Let’s say PC1 has the same IP as currently (192.168.1.2).
  3. Device 1 :
  • The ETH interface between the PC1 and Device and Wireless(AP) access point interface will both be under the common bridge interface (let’s call it BR1)
  • BR1 only will have the ip-address in the system. Let’s say the ip-address is 192.168.1.199
  1. Device 2 :
  • The ETH interface (between the PC2 and Device) and Wireless(STA) station interface will both be under a common bridge interface (let’s call it BR2)
  • BR2 only will have the ip-address in the system. Let’s say the ip-address is 192.168.1.200
  1. PC2 will have an ip address in the same subnet mask. Let’s say the ip assigned is 192.168.1.3

With these a ping from PC1(192.168.1.2) and PC2(192.168.1.3) would be successful and so would PC1 be able to access an webserver running on PC2.

Thanks,
Shub

Thank you for your response!

The main limitation in my current setup is that I can only control the network configuration between PC1 and Device 1, as well as the wireless network between the two FreeRTOS devices. I could place both PC1 and Device 1 on the same network (e.g., 192.168.1.x) and ensure the wireless connection between Device 1 and Device 2 is on a similar or identical subnet.

However, the challenge is that I cannot guarantee that PC2 will always be on a specific network that I control. In my system, PC2 might need to integrate into the architecture dynamically, which is why I am considering configuring the Ethernet interface on Device 2 to ensure it can bridge or route traffic between the networks as needed.

Do you have any further suggestions on how to implement this within these constraints?

Thanks again!

Hi Shub,

Thank you for your detailed explanation!

As I mentioned to @aggarg, I don’t have control over the network configuration of PC2, which is why I was originally looking for a more dynamic solution that would allow me to route between networks. My goal is to ensure that PC1 can access a web server on PC2, even when PC2 is on a network that I cannot predefine.

Given this, I’m wondering if FreeRTOS+TCP supports such dynamic routing between the interfaces or if I should consider other alternatives to achieve this.

Thanks again for your help!

do not confuse bridging and routing. Bridging happnes on layer 2 and involves MAC addresses, routing is a layer 3 issue and works on IP addresses. There is no way you can use FreeRTOS for bridging, but as has been stated before, routing may be supported automatically.

1 Like

Hi @capthestone
I am assuming that you will be implementing bridging in both the FreeRTOS devices.
If bridging implemented in Device 2, the network configuration that I am talking about will be taken care of.

Thanks,
Shub