What were samurai used for?

In the mid-evil time like the Saxons and Germanic tribes, the Japanese developed an advanced feudal system. On the Bushi fighting scale the Samurai was the warrior before you became a Samurai your title would be Ninja the lowest rank on the Bushi fighting scale. Samurai usually always served under a shogon who was their master, and would send Samurai off to fight other tribes and factions in mid-evil Japan. there were also Daimyos who would hire Samurai for protection of their estates and families. then there were also Ronin who were "Masterless Samurai" Ronin were first Samurai but if a Samurai's Shogon or Daimyo dies they are no longer their vassels and are free to raom sworn to no-one. Ronin were usually Mercs. The Samurai were used as the perfect fighting machine and were basically in a sense Japanese Knights or vassels.