legally mortgage backed securities are bonds since they are tradable debt securities but they're not a plain bond, due to the option of borrower's early repayment Macaulay or modified duration used for Treasuries doesn't work - you need effective/option-adjusted duration
the duration formula for MBS assumes for some pre-payments if those happen at a smaller rate - the duration increases