Shoguns were lords that controlled parts of the land.
Samurai were knights that protected the peasants. They got pieces of land from the shoguns. They had a code of honor.
Peasants worked on the land in exchange for food and protection.
Sadly I cannot remeber what a daimyo is. I apologize.