Two ethernet ports to bridge two different networks

I have an arduino ethernet and an arduino ethernet shield. I am setting up a system where I need to bridge two local networks using the arduino. I am very space constrained. I can't figure out how to write the software to setup the shield as a separate server port (or client) from the main arduino board.

Thanks for the help.

I am setting up a system where I need to bridge two local networks using the arduino.

What does that mean? Why not use a router? The Uno doesn't have nearly the horsepower to use as a network bridge, and I don't think the w5100 has the capablility.

I am size, weight and power constrained so I can't install a router. All the arduino has to do is take some messages in and relay them on to the private network. The private network is just a network of arduinos and the traffic is very light.

The network structure is as follows.

My Server ----- > Arduino Ethernet -> Ethernet Shield ------ > Other Arduino Ethernet

I have a very low powered network switch that I can power off the 5V pin of the arduino ethernet but I would rather not do that as it takes up more space then I would like.

I'm not sure the Uno-type processors have the SRAM to hold a Network Address Translation (NAT) table required to do that. And the w5100 may not work well as a gateway.

But that is just an educated guess.

You might be able to do that if you are bridging the two network for only one particular device on each network, but that is all I would expect.

edit: Compared to my old, slow, pig-like cheap routers, the Arduino would be the "king of pigs".
Router processor speed = 175 MHz
Router RAM = 32 MB
Uno processor speed = 16 MHz
Uno SRAM = 2KB

Pseudo code:

Packet = incoming packet;

if( packet == XXX)
{
Do this;
}else{
Send packet to IPx;
}

I have 4 different types of messages sending on about a 1Hz update rate. The secondary network is only responsible for these packets and is completely isolated from all other networks. I know the Arduino can handle the load I just don't know how to activate the second Ethernet port.

OK, let's presume that speed is not a problem. That requires a NAT table and SRAM to hold the packets that are enroute from one network to the other. How do you plan on holding the packets during the transfer? A packet could be 1500 bytes. The Uno-type processors don't have that much SRAM available after a normal startup.

And you must hack the w5100 library to get access to the raw packets on each socket.

You can always try it, but it would not be anywhere near a network router.

I have no desire for a network router. I have one box with this arduino in it and connected via network cable I have an other box with a different arduino in it. We'll call the network bridge arduino one, and the other arduino two. In the first box next to arduino one is a relay that I am controlling from the arduino. The second box has an other relay next to the second arduino. I need to close both relays remotely and that is it. So if I send a message to arduino one saying "Close relay 1" it will close the relay. If I send a message to arduino one to "Close relay 2" it will pass that message along to arduino two. All of my messages are 16bytes in length and every message is processed before the next message is received since I have a 1Hz message rate. I will never come close to meeting the SRAM max of the arduino. The code for this is extremely simple if I could figure out how to access the second network port on the arduino, there has to be a way to setup an arduino on multiple different networks.

The code for this is extremely simple if I could figure out how to access the second network port on the arduino, there has to be a way to setup an arduino on multiple different networks.

Then your skill level is way above mine. Maybe someone else will be able to help you.

edit: I do not see how you are going to beat this price for two arduinos, not counting all the work required to make those not even close to this router. NOT EVEN CLOSE!!

The issue is I am not just bridging networks, I am also acting on some of the commands. I need the arduino one to be able to close a relay as well as pass on messages. You find me a router that can close a relay then I'll be sold.

That router (RB750) and a single Arduino Ethernet (or an Uno/ethernet shield) will do the job. They are about the same price. Actually, the router may be less expensive than an Arduino Ethernet.

However, my favorite is the RB433UAH. It isn't cheap, but it really works good. Not only does it supply the network connection and the bridge, but power from the usb port and a way to connect remotely to the Arduino usb port from the internet/localnet like a telnet connection.
http://routerboard.com/RB433UAH

edit: I use a Mega 2560/ethernet shield combination with the RB433UAH.

either i'm not understanding what you really need, or perhaps you don't understand networks ?

is the "double ethernet ported arduino" just being as a daisy chain to extend the network ? as in you dont have spare network ports upstream of it ?

if its really bridging, ( as in crossing two network ranges, then why dont you open up the network mask ? ie if one ( or more ) arduino's are on say 192.168.0.x and others are on 192.168.1.x then you dont need to bridge the two, you set the ip's as needed ( the 192.168.(0 or 1).x ) and then use a netmask of say 255.255.254.0 that will work, if some brain dead ethernet library doesnt like that, then go down to a 16bit mask. ie 255.255.0.0

have you read / understood how net masks can help you ? i'm struggling to understand why you need separate networks and to bridge when clearly they must be within 105 meters of each other ?

zumost:
The issue is I am not just bridging networks, I am also acting on some of the commands. I need the arduino one to be able to close a relay as well as pass on messages. You find me a router that can close a relay then I'll be sold.

You can run both server and client code on a single arduino with an Ethernet shield to perform the functions you describe.