Communication involves two things - getting what was said and knowing which person said it. We must create a way in our minds to tell people apart. We must recognize individuals and remember things about each one. In effect, this means we must create a filing system with a file for each person we know. We have no acute sense that alone is up to this task.
Dogs are social animals, but they have an acute sense of smell.
A dog can smell your presence hours after you've passed by. When a dog meets you he wants a sniff. This tells him who you are, and enables him to open a file on you. Thereafter it makes it much easier for him to remember what transpires with you, because he can put it in your file. So he wants his sniff right away.