How do Layer 3 switches differ from routers, and when would you choose one over the other?

Technical