  Dynamical mass estimates for the main asteroid belt and the trans-Neptunian
Kuiper belt have been found from their gravitational influence on the motion of
planets. Discrete rotating models consisting of moving material points have
been used to model the total attraction from small or as yet undetected bodies
of the belts. The masses of the model belts have been included in the set of
parameters being refined and determined and have been obtained by processing
more than 800 thousand modern positional observations of planets and
spacecraft. We have processed the observations and determined the parameters
based on the new EPM2017 version of the IAA RAS planetary ephemerides. The
large observed radial extent of the belts (more than 1.2 au for the main belt
and more than 8 au for the Kuiper belt) and the concentration of bodies in the
Kuiper belt at a distance of about 44 au found from observations have been
taken into account in the discrete models. We have also used individual mass
estimates for large bodies of the belts as well as for objects that spacecraft
have approached and for bodies with satellites. Our mass estimate for the main
asteroid belt is $(4.008 \pm 0.029)\cdot 10^{-4} \ m_{\oplus}$ (3$\sigma$). The
bulk of the Kuiper belt objects are in the ring zone from 39.4 to 47.8 AU. The
estimate of its total mass together with the mass of the 31 largest
trans-Neptunian Kuiper belt objects is $(1.97 \pm 0.030)\cdot 10^{-2} \
m_{\oplus}$ (3$\sigma$), which exceeds the mass of the main asteroid belt
almost by a factor of 50. The mass of the 31 largest trans-Neptunian objects
(TNOs) is only about 40% of the total one.
