All switches managed or not operate at layer 2 regardless for the core function of switching.
Unmanaged switch means no user interface.
Then "managed" implies functions such as PoE (layer 1) then VLANs, Spanning tree, Storm control, QoS, MAC ACLs (all layer 2) accessed by web UI and/or CLI for which it needs at least one management IP address.
"Smart" switch is just a limited feature subset of managed.
A layer 2 switch would strictly have no other interaction with IP addresses other than its management address, plus a few clients or services such as DNS, SNMP, SNTP to facilitate management.
A layer 3 switch has some additional functions requiring awareness of the IP addresses of devices connecting through it such as static routes, DHCP server or relay, IGMP for multicast, IP ACLs. It may overlap with the functionality of a router without a strictly defined distinction so protocols such as GRE, OSPF may appear here too.
A layer 3 switch may be able to operate in layer 2 or layer 3 mode according a UI setting.
In a layer 3 role a switch often has a distinct IP address on some or all of the VLANs in which case it can act as a router and answer or relay DHCP requests.
But if it has ability to perform NAT or firewalling it is more likely to be primarily a router rather than a switch.
Outside of the consumer market, something sold as a "router" is much less likely to have a switch chip (ASIC / FPGA) in which case it won't offer those basic layer 2 functions directly through the hardware, though the OS may be able to bridge in software. Wi-Fi is also less likely to be built-in.
For example if you have a separate router but only want traffic to hit that if going to/from Internet, you can use a layer 3 switches to route between VLANs locally. Wi-Fi will still traverse the router unless you have separate access points connected to the switches.
If multiple switches you only need 1 layer 3 switch to act as core and providing internal routing and a default route (pointing via the Internet router). The rest of the switches (aka access switches) only need layer 2 functions.
You can choose to plug end devices into only the access switches but in practice there is no reason not to also use spare ports on the core switch.
Larger or more formal networks may have a strict hierarchy of core, distribution and access switches if it is critical for end devices not to be able to take out the core and distribution layers.
I use Cisco SG3xx and 5xx series and even the 3xx series have a selectable layer 3 mode. More expensive models may have some 5G or 10G ports whether trunking / stacking between switches or for end devices.
Currently I have kept all routing, firewalling and NAT functions on routers rather than switches, even for 1000+ devices, but it's useful to know that switches could take over the LAN routing without relying on a router CPU should network demands favour this.
prlzx on iDNET: VDSL / 21CN at ~40Mbps / 10Mbps
with IP4/6 (no v6? - not true Internet)
Edited by prlzx (Wed 11-Oct-17 18:38:27)