Go Down

Topic: Arduino with two physical ethernet ports (Two Shields) (Read 10646 times) previous topic - next topic

RET80

I am in need in developing a module that requires two physical ethernet ports to be available so that data can pass through one port (be seen via serial output) and pass through the other output to an end device.  This device will not be filtering standard HTTP requests, but instead be sifting through raw byte data, so nothing to 'heavy' so-to-speak.

I have the standard Arduino uno with just one Ethernet shield and I notice that the shield has ICSP pins which can only connect to the arduino board, so if I piggy-back another ethernet shield on top of the existing ethernet shield, I cannot make use of the ICSP pins, is there any way around this or better yet, what role do the ICSP pins play in the ethernet shield? It could be something I may not even need at all.

So in short, I'm just seeing the feasibility of this.

SurferTim

I'm pretty good with one ethernet shield, and I wouldn't try that. Connecting the shield will be the easy part compared to modifying the ethernet library to handle both devices.

The newer shield use the ICSP pins for the SPI data lines, and D10 is the w5100 slave select. You must remove and resolder a new 6 pin connector with the longer pins to accommodate the second shield. You must use another pin for the second w5100 slave select.

Both shields and the Uno may require more power than the voltage regulator or usb can handle.

Now you must modify the ethernet library to use both slave selects.


RET80

Connecting would be the easy part, and yes I would need to repin the ICSP port if it IS required...
but couldn't someone just call to two ports to open when firing up the setup() function?

SurferTim

That is the right question. Yes, you can. I have server code that monitors two ports with different web pages on each. Is that what you are looking to do?

RET80


That is the right question. Yes, you can. I have server code that monitors two ports with different web pages on each. Is that what you are looking to do?



Yes basically, but the next challenge is to actually piggy-back the two shields, is that possible? or will I run into a hardware wall if the arduino is requesting resources from either shield?

I'll require both shields so that I can enable the two physical ports.

SurferTim

I don't use two shields, so I can't help you with that part.

PeterH

Can you explain again why you need TWO shields? I'm not seeing any need from what you've said so far.

RET80

#7
Sep 04, 2013, 01:10 am Last Edit: Sep 04, 2013, 01:14 am by RET80 Reason: 1

Can you explain again why you need TWO shields? I'm not seeing any need from what you've said so far.


A pass-through like a gateway or switch.

The device will have an eth0 and and eth1
the eth0 ethernet port will receive packet data via interception (like WireShark) from the preparatory device and display the information through the Arduino's TTL serial display.

The eth1will pass that data out of the Arduino to another target device for its final manipulations.
This is not your classic server/client relationship  and does not follow standard HTTP protocol.  

I have attached an image showing the setup, you will see the data flow and the two devices in question

wizdum

What data rate do you need? This is going to be like hooking up a fire hose with a drinking straw in the middle.  :smiley-eek-blue: It sounds like you're trying to make a network tap. An Arduino is a really terrible way to achieve that, I don't even think it could keep up with the "idle" chatter caused by computers just being plugged into the network, never mind actually sending/receiving data.

The cheapest way would be with a laptop running wireshark, and a network tap. The second cheapest would be a dedicated PC with two or more NICs, running PFSense.

PeterH

Yeah, but I'm still not seeing why you need the input and output to be in separate collision domains. Gateways and switches are very different things and it's not at all clear that this is either of those things. What is this device actually doing?

RET80


Yeah, but I'm still not seeing why you need the input and output to be in separate collision domains. Gateways and switches are very different things and it's not at all clear that this is either of those things. What is this device actually doing?


How could it not be more clear? you have an input and an output, stuff goes in, stuff comes out.
It's reading RAW byte data from one device and sends it to another, that raw data is a specific, in-house protocol.
I want the Arduino to just SEE what's being passed through it, it will in no way alter the data.

RET80


What data rate do you need? This is going to be like hooking up a fire hose with a drinking straw in the middle.  :smiley-eek-blue: It sounds like you're trying to make a network tap. An Arduino is a really terrible way to achieve that, I don't even think it could keep up with the "idle" chatter caused by computers just being plugged into the network, never mind actually sending/receiving data.

The cheapest way would be with a laptop running wireshark, and a network tap. The second cheapest would be a dedicated PC with two or more NICs, running PFSense.


Data rate can be anything really, the requests being sent through that line are occurring once a second, for example it's literally "saying" this from one device to the other:
* "Hey, I'm alive!"
* "Okay sending a byte of data"
* "Hey, I'm alive!"
* "Okay, sending another byte of data"

Now these bytes of data are accumulated / created at the host device and they relate to changes in the environment.

RET80

#12
Sep 04, 2013, 05:16 pm Last Edit: Sep 04, 2013, 05:18 pm by RET80 Reason: 1
If the whole '2 port arduino' isn't a good idea or just not implementable at all, would a switch do the same as long the devices are able to broadcast on all ports of a switch?

For example, if the host device is on port 1 of 4 on a switch, it broadcasts its message to all 4 ports of the switch? If that's the case I can plug in the Arduino to port 2 and the end device on port 3.

PeterH

#13
Sep 04, 2013, 05:20 pm Last Edit: Sep 04, 2013, 05:22 pm by PeterH Reason: 1

How could it not be more clear? you have an input and an output, stuff goes in, stuff comes out.
It's reading RAW byte data from one device and sends it to another, that raw data is a specific, in-house protocol.
I want the Arduino to just SEE what's being passed through it, it will in no way alter the data.


It's not clear because nothing you've said so far precludes having the output interface and the input interface be the same network interface. Ethernet is not like a serial interface, it can carry multiple protocols in multiple directions with multiple senders and receivers all connected to the same network segment. Unless you have some reason why you need to prevent the input packets from being visible on the output network - which you haven't hinted at so far - I can't see why you insist that the input and output networks need to be different. Maybe there is a valid reason, but you haven't given it yet which is why I'm asking the question. If this is a false assumption on your part, you're making this problem a lot harder than it needs to be.

RET80



How could it not be more clear? you have an input and an output, stuff goes in, stuff comes out.
It's reading RAW byte data from one device and sends it to another, that raw data is a specific, in-house protocol.
I want the Arduino to just SEE what's being passed through it, it will in no way alter the data.


It's not clear because nothing you've said so far precludes having the output interface and the input interface be the same network interface. Ethernet is not like a serial interface, it can carry multiple protocols in multiple directions with multiple senders and receivers all connected to the same network segment. Unless you have some reason why you need to prevent the input packets from being visible on the output network - which you haven't hinted at so far - I can't see why you insist that the input and output networks need to be different. Maybe there is a valid reason, but you haven't given it yet which is why I'm asking the question.


Well then, how would you proceed with this setup?
As you can see the data flow is only in one direction from origin to end device with the Arduino being the 'patch' in the center.
The input and output packets are both visible.  Imagine if you will (with the diagram) if the Arduino was removed, it would be a simple, direct connection from host to end device as it sends data unilaterally in one direction.  All the Arduino will do is just be a transparent patch between the two devices to sniff data.

Maybe I'm misunderstanding something?

Go Up