Dogs know their own names after so long. They an also tell what you're trying to communicate to them. If you're talking sweetly and calmly, then they know they've done something good. If you scream and yell, then they know they've done something bad. They're very smart creatures.