switch at data link layer is called as bridge which has many ports and each port is connected to one collision domain or LANs
switch is used to connect the various sgments of LANs which are then called as switched LANs
switch maintains a table of MAC addresses so when packet comes to switch It will filter the MAC address and forward the packet to destined LAN segment
we can say Hub does not have filtering capability like switch, It forwards packets to all the segment no matter for which destination it belongs so Hub causes heavy traffic on network.
Hub does not have forwarding and filtering capability like swich.
Collision domain is 2.