Can you use Ethernet Shield to make a switch?

Question, I want to use the Ethernet shield, to make a switch. I this possible if I write the code to tell the Ethernet shield how to control the flow of the traffic.

You want to make an Ethernet switch with one Ethernet socket?

I want to build a 4 port switch using the Ethernet shields

Not directly with the official Arduino Ethernet shield -- it uses fixed I/O pins so there's no built in way to use more than one. I suppose it would be possible to hack multiple boards to use different pins, and edit the library to use these boards, but it wouldn't be a simple undertaking.

Another problem is RAM -- multiple Ethernet ports are going to require multiple frame buffers @ 1500 bytes each, which immediately rules out using a Uno, Leonardo, etc.

Another problem is CPU -- at 100 Mbps it's possible you'd be seeing a packet every 7 microseconds (150,000 64 byte packets per second). That gives at 16 Mhz CPU less than 120 clock cycles to analyze an incoming frame and retransmit it on another port, or send a pause frame to get the sender to stop transmitting... probably not realistic.

So...IF you use a Due AND you hack the Ethernet shield hardware AND the Ethernet library AND are clever with your programming then yes, you could probably get this to work.

I this possible if I write the code to tell the Ethernet shield how to control the flow of the traffic.

The short answer is no, definitely not. The Ethernet shield doesn't contain an any-purpose ethernet hardware but a specialized chip that is handling not only the ethernet protocol but also the higher layers of IP and TCP/UDP. A switch is layer 2 only, you can transmit any protocol over it. A router does it's task for specific protocols only (usually IP). What's more in reach (although it still doesn't make sense) is doing some kind of proxy but even that is not seriously possible because the WizNet5100 (the chip on the Ethernet Shield) does handle only 4 connections simultaneously, every web browser uses more in the standard case.

Why not use an older router and hack it...

openwrm i think it's called, using the serial pins you can write your own firmware... the cpu and wiznet is simply not fast enough in any respect for the job.....

I appreciate all the inputs, I was afraid of this after reading the data sheet on the Ethernet shield, was hoping, but I guess back to the drawing board, The the reason I put this question to the community was due to the fact the college I am currently a student requires a final project of something revise or something new invented, to graduate.