Hubs are networking devices that deliver signals to all ports (save one) in order for them to reply to the signal that was received. The physical layer is used to run the hub. Packet filtering is not available in this case. There are two types: There are two types of hubs: active and passive.
A switch is a network device that enables the establishment and termination of connections based on the requirement. The data link layer is used to control the switch. Packet filtering is available in this case. It's a full-duplex transmission method that's also known as efficient bridge.