Barefoot networks(<a href="https://barefootnetworks.com/" rel="nofollow">https://barefootnetworks.com/</a>) has programmable switches using their custom designed chips and run using their programming language p4 (<a href="http://onrc.stanford.edu/p4.html" rel="nofollow">http://onrc.stanford.edu/p4.html</a>). Its pretty powerful stuff and the chips are about $2000 a pop last I checked
An easy way to hack an ethernet switch (or router) is a computer with a number of network cards. A cheap one is for instance the Banana Pi R1 (<a href="http://www.banana-pi.org/r1.html" rel="nofollow">http://www.banana-pi.org/r1.html</a>) which exposes five ethernet cards to the operating system.
There's a lot of different stuff out there depending on what you want to hack. Mellanox Spectrum with switchdev or Facebook Wedge with FBOSS will let you hack the control plane. Barefoot Tofino with P4 or NetFPGA will let you hack the data plane.