Unlike layer 1 and layer 2 devices, layer 3 devices are protocol aware and they are used to interconnect between different LAN sub networks or to connect a LAN to a WAN. The basic data in layer 3 is packets. The packets are made of fields such as TTL, source address, destination address, payload etc. Router and Layer 3 switches are examples of Layer 3 devices.
Routers route information between different sub networks by choosing the optimal route. They maintain a routing table of network addresses and corresponding ports and make routing decisions based on this table. Routers have different wan interfaces for connecting to networks like ADSL, E1, V35, X.25, frame relay, PPP, SONET/SDH etc.
These are very similar to routers and are capable of performing layer 3 routing. The main difference being they do not have a wan interface, they only have Ethernet ports. So the different sub networks connected to a layer 3 switch are all different LAN sub networks. However as technology is changing the difference between the terms Routers and Layer 3 switches is fast fading.