  The diffraction problem of a plane wave impinging on a grating formed by
nested cavities is solved by means of the modal method, for $s$ and $p$
polarization modes. The cavities are formed by perfectly conducting sheets that
describe rectangular profiles. The electromagnetic response of the grating is
analyzed, paying particular attention to the generation of resonances within
the structure. The dependence of the resonances on the geometrical parameters
of the grating is studied, and results of far and near field are shown. The
results are checked and compared with those available in the literature for
certain limit cases.
