Simple Ethernet switch design? - Page 1
Forum section: electronics / projects

author: iXod
author_rank: Frequent Contributor
timestamp: January 05, 2018, 07:28:13 am
content: I am building a SPDT gigabit ethernet switch: 1 input, 2 outputs. The input is connected to only one or the other output, controlled by a toggle switch or pushbutton. The goal is really simple: switch a LAN cable between 2 sources. I won’t go into any detail here but that’s it.The switching components I’ve been looking at are Maxim MAX4927ETN:https://www.mouser.com/ProductDetail/Maxim-Integrated/MAX4927ETN+/?qs=%2fha2pyFaduhgZe74ydus1U58ixbQgmWaBfBO1g%252b2jRY%3dThe datasheet shows a typical circuit consisting of the RJ45 connectors, transformers for each connector, and the switch:http://www.mouser.com/ds/2/256/MAX4927-105475.pdf(page 10)I started this idea by looking at electromechanical relays but then I saw the Maxim. Is there any disadvantage of going with a solid-state product compared to the traditional relay?Is there anything more that I should pay attention to? Is trace impedance critical with a board that has nothing else on it but these components?Thanks.

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 05, 2018, 07:33:57 am
content: Just get an off the shelf switch that uses a chipset with a publicly available datasheet, then wire a microcontroller to disable the ports you don't want on. You can even go a step further with VLAN support and whatnot.

author: Jeroen3
author_rank: Super Contributor
timestamp: January 05, 2018, 07:41:31 am
content: Quote from: iXod on January 05, 2018, 07:28:13 amWhy? They're $20?Quote from: iXod on January 05, 2018, 07:28:13 amQuote from: iXod on January 05, 2018, 07:28:13 amYes, impedance is important. That's why relays will be hard. Gigabit is >100 MHz.There are some safety critical switches that offer relays as option to bypass the switch when there is a blackout.

author: gertux
author_rank: Contributor
timestamp: January 05, 2018, 08:06:14 am
content: Quote from: NiHaoMike on January 05, 2018, 07:33:57 amAny suggestions for ‘an off the shelf switch that uses a chipset with a publicly available datasheet’ ?I’m also interested in something similar.

author: iXod
author_rank: Frequent Contributor
timestamp: January 05, 2018, 10:45:55 pm
content: I forgot an important detail in my description: it's an SPDT ethernet switch I'm designing. The one input will be connected to only one of the outputs (yes I know these are bidirectional ports; just using "input" and "output" loosely here...). Port will be selected by toggle or pushbutton switch.

author: nctnico
author_rank: Super Contributor
timestamp: January 05, 2018, 11:02:55 pm
content: Just use a simple signal relay. For suitable types watch one of Dave's teardowns of a cheap scope. The board layout will be a bit more tricky because you will want length matching and controlled impedances.

author: iXod
author_rank: Frequent Contributor
timestamp: January 06, 2018, 03:47:13 am
content: QuoteHow much of the implementation of impedance design do I need to provide to a PCB house? I've read at some PCB manufacturers' web sites that for a given PCB material they will design the trace width, spacing etc. of impedance-critical traces to met the impedance spec.

author: iXod
author_rank: Frequent Contributor
timestamp: January 06, 2018, 04:04:04 am
content: QuoteI see this board used for networking avionics and such in modern aircraft (AFDX, in essence, Ethernet):https://www.pickeringtest.com/product/data-communications-multiplexerIt uses the humble AXICOM IM03 series RF relay:http://www.te.com/usa-en/product-1-1462037-8.htmlI also see solid-state relays. This one is used specifically for LAN switching:https://www.diodes.com/assets/Datasheets/PI3L720.pdfI'm not sure what is best to use here. Comments and observations welcome.Cheers.

author: linux-works
author_rank: Super Contributor
timestamp: January 06, 2018, 04:26:43 am
content: I would suggest what others have; a manageable switch (web interface) that lets you switch vlans and then you can have a simple controller that sends out the right urls (or snmp, if you are a bit more advanced) and that will control the smart switch.relays for 125mhz ethernet are a really bad idea and an ugly hack.web-controlled gig switches that are 8 or less ports are not expensive.hell, another solution would be to use a rasp pi box and a few usb ethernet dongles and do ethernet bridging to switch. it will work, and you can send simple commands (even gpio stuff) to the rpi and it can do what you want based on external events.

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 06, 2018, 04:34:17 am
content: Quote from: gertux on January 05, 2018, 08:06:14 amhttp://spritesmods.com/?art=rtl8366sbYou can also just buy a managed switch, but what's the fun in that?

author: linux-works
author_rank: Super Contributor
timestamp: January 06, 2018, 04:49:37 am
content: Quoteuhm, dunno, how about data integrity?

author: iXod
author_rank: Frequent Contributor
timestamp: January 06, 2018, 05:23:36 am
content: QuoteI was considering this until I found that bandwidth is shared between all USB ports and even the ethernet port (on models that have this). And 10/100 only.

author: ejeffrey
author_rank: Super Contributor
timestamp: January 06, 2018, 05:28:59 am
content: There is no problem with using a solid state switch at these frequencies. That maxim chip looks like it does exactly what you have described, looks dead simple to use, and is only a few bucks. Sounds like a winner to me. One thing to watch out for: analog switches have limited common mode voltage range -- the signal must stay between Vcc and GND. So you the switch needs to go on the PHY side of the magnetics and you need separate transformers for each output port.Anything that involves hacking apart a commercial network switch and enabling and disabling ports sounds like a brittle, complicated, unreliable nightmare. Yes, you could to that, but if what you really want is an SPDT circuit switch that is not the best way to go. A network switch vs a circuit switch will also have different behaviors with regard to link detection and negotiation which you may care about.

author: ajb
author_rank: Super Contributor
timestamp: January 06, 2018, 05:47:28 am
content: Quote from: Jeroen3 on January 05, 2018, 07:41:31 am"Fail to wire" is the common name of that feature. I designed a small 3 port FTW switch a few months ago, and looked at what various FTW network interfaces on the market used. Invariably it was some sort of bog standard low signal relay.Here are a few part numbers I observed, all on gigabit interfaces:- AGQ210S4H- TXS2SS-L-4.5V- TQ2-L2-3V- TX2-L2-5V (?)Ethernet is designed to work around some degree of signal integrity issues. Think about what happens inside of patch panels. As long as some care is taken in the layout the relays on a PCB won't be appreciably worse. Honestly, if you don't need to automate this, an 8PDT mechanical switch would probably work. Maybe even an old 9-pin serial port switch box. Actually, come to think of it...Yeah, it turns out you can just buy a"manual ethernet switch".Quote from: iXod on January 06, 2018, 03:47:13 amGenerally, you, the PCB designer, determine the trace width(s) and/or separations in conjunction with the stackup to achieve the required impedance. You can specify the exact stackup to the board house if you want, but for small runs it will be cheaper to use one of their standard stackups and design to that. Ideally you would also specify the impedance control requirements to the board house and include test tracks for verification, but of course you'll have to pay extra for that and provide extra documentation in your fabrication package.

author: iXod
author_rank: Frequent Contributor
timestamp: January 06, 2018, 06:09:41 am
content: QuoteSeparate magnetics for all 3 ports. Just to be safe...

author: linux-works
author_rank: Super Contributor
timestamp: January 06, 2018, 10:10:20 am
content: we use odroid xu4's at work for full gig ethernet traffic generators (we have a spirent but for less formal tasks, we use an array of odroids). they are decent little machines. I think we can have 3 gig ethernets on one xu4 board (one native, 2 via usb3 ports).not a rpi at all. rpi is ok for 10/100 like you say.also, check out the 'espresso-bin' ($50 or so for a few ports and I think its all gig-e).

author: tooki
author_rank: Super Contributor
timestamp: January 06, 2018, 10:51:41 am
content: Quote from: Jeroen3 on January 05, 2018, 07:41:31 amCuz he means a literal switchbox, not a network switch (as in the gadget sold as a network switch, that is, an ethernet hub that intelligently routes packets).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 06, 2018, 11:25:56 am
content: Analog switch is a really bad idea: Ethernet cable is where the loud, nasty, sparking environment connects to your small, vulnerable components. All it takes is one ESD hit, and it may not even cope with ambient noise.If you have a quiet lab and don't mind possibly unreliable communications, sure, it should work. It might last a week or a decade, who knows. And, for a vast majority of Ethernet traffic... you don't actually care about reliability, but, I might guess your envisioned application is a bit unusual, hence the unusual equipment, so maybe it does need to be a bit more reliable than that.What's the fix? Quick would be adding at least two isolation transformers, so that the analog switch can be common to just one line (or preferably, three, and common to ground, which will also be your logic level control, whatever that is). That might not be the greatest (I forget how many transformers can be used on a single line -- you start with one at each end, remember), but it's the safest, simplest way.Otherwise -- just use an off the shelf switch device, as others have suggested. That's what they're there for, and as a bonus, you get refreshed signal quality so the run can be even longer (if that's ever a concern).Tim

author: timb
author_rank: Super Contributor
timestamp: January 06, 2018, 11:45:10 am
content: Quote from: tooki on January 06, 2018, 10:51:41 amA managed network switch would allow you to enable/disable individual ports through a web interface, thus doing what the OP wants.You can get a decent 8 Port managed or semi-managed switched for $50 and $20 respectively.

author: nali
author_rank: Frequent Contributor
timestamp: January 06, 2018, 12:08:58 pm
content: How about something like thishttp://www.banana-pi.org/r1.htmlGPIO for the switch input, then a few rules and/or bringing interfaces up/down to do the traffic routing... sorted.

author: linux-works
author_rank: Super Contributor
timestamp: January 06, 2018, 08:57:29 pm
content: I've never heard anything good about the banana pi.but I can confirm that the odroid xu4 is a hell of a machine and we use them for serious work, at my day job. they really are up to the task of gig ethernet even over usb3 dongles.even odroid c2 can do onboard gig-e well enough. it does not go thru usb like the pi does.

author: ogden
author_rank: Super Contributor
timestamp: January 06, 2018, 09:29:18 pm
content: Quote from: iXod on January 05, 2018, 07:28:13 amThere are none that I know. Solid state switching is widely used (mostly for HDMI/USB) and it works. Traditional relays have disadvantages: they need a lot of PCB estate.QuoteIn case of standalone switch - replace PHY/MAC in reference schematics with third magnetics and you are basically done. Run 100 ohm balanced pairs. If traces are not long, then it will be ok even if you do not care much about trace impedance - just run them in pairsMake sure to have solid ground plane and no high current traces around. If your application is similar to laptop docking station one: "which socket Ethernet cable is attached to?" - then indeed ignore all the managed switch solutions. Switch definitely will be unnecessary overengineering.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 06, 2018, 09:38:15 pm
content: Quote from: ogden on January 06, 2018, 09:29:18 pmAnalog switches work nicely for those, because they are fully shielded standards -- the voltage of any pin is well within the 0-3.3V supply range.A lot harder to guarantee that (even with STP Ethernet cable!).Tim

author: ogden
author_rank: Super Contributor
timestamp: January 06, 2018, 09:41:12 pm
content: Quote from: T3sl4co1l on January 06, 2018, 09:38:15 pmEasy. If Ethernet PHY IC is able to work thenpurpose-builtsolid state switch IC will do it with same success. Indeed transformers are needed.Hint: check datasheet first.http://www.mouser.com/ds/2/256/MAX4927-105475.pdf

author: linux-works
author_rank: Super Contributor
timestamp: January 06, 2018, 11:15:21 pm
content: https://www.amazon.com/ESPRESSObin-SBUD102-Single-Computer-Network/dp/B06Y3V2FBK/that's what I was referring to, the espresso-bin board. $50 and its a correct logical switch, if you want it to be.and the openwrt (dd-wrt, etc) boxes might also offer you a programmable and cheap way to switch ethernet. properly.

author: ogden
author_rank: Super Contributor
timestamp: January 06, 2018, 11:59:56 pm
content: Quote from: linux-works on January 06, 2018, 11:15:21 pmSo you say that switching Ethernet using MAX4927 is improper way of doing it?

author: linux-works
author_rank: Super Contributor
timestamp: January 07, 2018, 01:55:49 am
content: no, I was referring to using relays, which I don't believe in, at 125mhz, to be honest.the max chip seems fine, but I would not use relays since that chip and regular old software-controlled bridges (what we really call switches that do store/forward frame processing) are there and can be used.if you are doing a one-off, that espresso-bin looks good. if you are making a board in quantity, there are ethernet 'switch' chips that are off the shelf and not expensive.

author: gertux
author_rank: Contributor
timestamp: January 07, 2018, 12:12:39 pm
content: Quote from: linux-works on January 07, 2018, 01:55:49 amAny suggestions/recommendations ?Sent from my iPad using Tapatalk

author: andtfoot
author_rank: Unknown
timestamp: January 07, 2018, 03:28:14 pm
content: I've seen this done with 3 x dumb 5-port Ethernet switches and a couple of relays (I can do up a quick schematic if needed):- the 1st switch is used to split the 'input' to both other switches- the other switches are wired 'in series' with the outputs of switch 1, each going to it's own 'output'- power is then controlled using the relays to either switch 2 or 3, to determine where the signal can goNo need to worry about signal integrity, transformers, routing, etc and it's pretty robust. Obviously this as at a cost of not being as efficient.

author: nctnico
author_rank: Super Contributor
timestamp: January 07, 2018, 03:42:35 pm
content: Quote from: ogden on January 06, 2018, 09:41:12 pmUnfortunately not every ethernet PHY IC isn't able to work reliable by itself. I found that out the hard way and since then every ethernet port I design has extra TVS diodes in the signal lines.

author: ogden
author_rank: Super Contributor
timestamp: January 07, 2018, 07:59:02 pm
content: Quote from: nctnico on January 07, 2018, 03:42:35 pmIndeed. Main question here is -whereit is supposed to operate. There's big difference between router next to TV in your living room and industrial floor or comms tower populated with forest of antennas. For latter better just use opticsQuoteOh, indeed. As soon as you don't know where exactly your Ethernet port will be plugged into - better protect it well. Unfortunately OP did not tell about actual application much.

author: james_s
author_rank: Super Contributor
timestamp: January 09, 2018, 08:21:39 pm
content: At one of my jobs we had mechanical ethernet switchboxes, this was back in the 100Mb days so I don't know what's available now. These were used to switch PCs between the internal corporate network and raw internet that bypassed the corporate firewall, the use of a mechanical switchbox was mandatory, there is no way they would have allowed anything that could possibly be misconfigured to bridge the two networks. At least one guy was fired for doing that by accident.

author: iXod
author_rank: Frequent Contributor
timestamp: January 12, 2018, 01:56:11 am
content: So in order to "switch" ports off in a small off-the-shelf 5-port e-switch, all that is required is to make a particular port "inoperable". Wouldn't saturating the transformer for a given port disable it? Then "un-saturate" the transformer to enable it.Could this be done by raising, say, the center-tap to a DC voltage (5? 12?) to disable the port, then connecting the center-tap to its designed PCB point again to enable it?Saturate, un-saturate. Toggling ports on and off. I only need to do this with 2 ports so it seems straightforward--if my "saturation" approach is valid.This method is preferred to designing from scratch a switch with traces matched in length and impedance...Thanks.

author: Jeroen3
author_rank: Super Contributor
timestamp: January 12, 2018, 06:47:59 am
content: Applying a voltages to the center tap is called PoE IEEE 802.3at.If you want to keep it simple you really need a ethernet switch, or an ethernet extender, and turn off the power to that.

author: ogden
author_rank: Super Contributor
timestamp: January 12, 2018, 06:50:51 am
content: Quote from: iXod on January 12, 2018, 01:56:11 amBad idea. Won't work.1) You saturate core by applyingcurrent, not voltage. 2) Ethernet transformers arebalanced, they (are designed to) not saturate when current running through center tap. This is why PoE is able to work on Ethernet up-to quite significant currents, like 250mA per pair.I would just use manageable switch in your case.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 12, 2018, 08:40:22 am
content: Right, you need unbalanced current. You also need to not load the line, which means you can't simply saturate a transformer, as that would short it out. So you need to connect two saturable transformers in series (whatever that means for a balanced signal path!), plus figure out how to put current in.Typical solutions for bias current would be to use a CCS and coupling caps, or two transformers wired in series-opposing with an additional control winding wound over them (series-aiding).Doing four saturable reactors with balanced primary and secondary windings would be challenging for bandwidth beyond 100BASE-T (and even that might be hard).Tim