What is the advantage of Layer 3 switch over the Router ??
In general, layer-3 switches move packets faster (near line rate) because everything they do is in hardware. They tend to be cheaper and cheaper to operate (power, personnel, etc.) vs. a comparable router.
This does come with significant limitations, however...
- reduced route table size
- no NAT
- no firewall and very limited security features
- limited routing protocol support, if any.
- possibly no IPv6 support at all (and that's not something that can be fixed with software) Granted that should be rare today. What I regularly see is IPv6 features substantially subtracting from IPv4 features.
Routers are predominantly designed to run routing protocols that regularly alter the path of traffic. They also handle numerous high-touch features such as NAT, QoS, security, VRF, etc. Outside the high-end market, routers are partially or totally software platforms.
For example, it's easy to take a commodity PC with a few NICs, load linux on it, and *poof* it's a router. No matter how much you hit it with the spice-weasel, it'll never be a switch.
Both "layer-3 switch" and "router" are essentially marketing terms - they have no definitive technical meaning.
Chances are that a "layer-3 switch" has more front-panel ports for cheaper than a "router", with less support for protocols and table size, while both do all forwarding at line rate, but that's highly dependent on the specific hardware in question.
It's all about the business requirement. To put an example, the Cisco Catalyst 3850 has a more rapid backplane than a Cisco ISR 2900 series router. Nevertheless, Cisco ISR's support way more media types than most other switches (Cisco). Some tangible hardware design of switches may actually be valuable (or not) for their use in particular conditions.