Data link layer refers to things that happen within a single network; that's what a switch does. Only a router (or equivalent device, which I would still consider a "router") is able to connect different networks.The different networks may use the same technology (for example, Ethernet and Ethernet), or different technologies (for example, Ethernet and Wi-Fi); a switch is only able to connect parts of a single network that use the same technology (often this will be Ethernet).
A Switch is a Layer 2 device as they operate in the data link layer
Data-link layer
Switch working in Data link layer of OSI Model which is working my MAC address it is sending receiving packets by Mac address which switch make mac tale in RAM to save all information.
Switches / Bridges and hubs work at data link layer, but there are layer three switches which operate at network layer. Dhruv
Layer 2 (Data Link Layer) http://compnetworking.about.com/cs/internetworking/g/bldef_bridge.htm
Switches are on the second layer of the OSI model (Data Link); they do filtering based on host MAC addresses. You may also see a third layer switch; they not only provide all switching capabilities but some layer three routing capabilities too.
Switches are commonly known as "Layer 2 (Data Link Layer)".3550 Switches: These switches are working under Layer 2 (Data Link Layer) and it is forward the packets through MAC Address, but if we convert these type of switches into Routers it will function in Layer 3 (Network Layer) of OSI model as it's forward the packets based on the IP addresses.2950 Switches: These switches are working under Layer 2 (Data Link Layer) of OSI model only and it is forward the packets through MAC Address.
The link layer...
Data link layer
The data link layer (layer 2) and the physical layer (layer 1) use the constructed frame.
virtual switch
Physical layer = Hub, NIC, Repeater. Data Link Layer = Switch, Bridge. Network Layer = Router.