Your question is pretty much about RF link calculations. If you google for 'RF Link Calculator' there are many online tools that do the math for you based on your parameters.
For the link budget margin, that is the difference between the signal you receive and that you need to have proper decoding (receive sensitivity). The margin can be used to cover fading or attenuation due to weather conditions like rain, if there is enough margin.