Hostels are cheap in Iran, almost always under $10 a night.
Of course it’s free when you stay with Iranians but you can show your appreciation by buying some fancy sweets for the kitchen. You should take off you shoes when you enter the home and not enter any room where a woman is to be found alone.
It’s also good manners to yell “Y’allah“ (to God) as you enter the home so that the women have a chance to cover themselves should they need to.
It’s normal practice to eat, sit and sleep on the luscious thick carpets common to all houses that can afford them. The thickness of the carpet and total coverage of one’s floor is a big status symbol in Iran. They make excellent mattresses and you may even be tempted to take one home with you – but how will it fit into your rucksack?
It’s also very safe for men to sleep outside.