Network switches and network hubs are the mainstays of computer networks. In the case of networking, a switch is a device that can perform filtering and packet forwarding when exchanging information packets between different parts of the local area network. The switch works on one of the data link layers of the OSI layer. However, sometimes it also works in the network layer. Local area networks (LANs) that use switches to communicate between their different parts are called switched LANs. With a switch you can create a network - such as a network of several office / home PCs together. Or just connect to the ISP network. With a switch you can only connect to one local network , not another. This requires a router. While the router has a switch (LAN port) , it also has one or more WAN ports to connect to other networks. For example , only ISPs in the neighborhood are connected to their local LAN , but their switches are again connected to the Internet through a router. Suppose there is a traffic control system at the head of a crossroads and what happens if there is not. If there is traffic control, the vehicles move smoothly and if there is no traffic, a chaotic situation is created which slows down the vehicles. In this case the hub is the road without traffic control and the switch is the road with traffic control. When a PC A connected to a hub searches for another PC B , it goes to each port of the hub and asks, "Are you B?" In this way he communicates with the real B when he finds it. Now think what will happen if AB is looking for DH is looking for FC . And in the case of a switch, when a PC is connected to a switch, the switch keeps in its memory which port the PC is connected to. As a result, when one PC searches for another, the switch communicates between the two.