I always mess up with the basic concepts in networking. This are the very basic questions. 

1. What is a router, its functions and what is meant by routing?
2. What is a switch, its functions? Many time I heard that there are layer 3 switches. If there are layer three switches , why they are not called as router? since they are doing work of a router. What is the exact difference by which we decide this router and this is switch?
3. What is a hub?

I have read about these questions plenty of time and then to I have messed up in my interviews. Please let me know or give me a link to study about these things in very detail.