In order to mimic the phase changes in the primordial Big Bang, several cosmological solid-state experiments have been conceived, during the last decade, to investigate the spontaneous symmetry breaking in superconductors and superfluids cooled through their transition temperature. In one of such experiments, the number of magnetic flux quanta spontaneously trapped in a superconducting loop was measured by means of a long Josephson tunnel junction built on top of the loop itself. We have analyzed this system and found a number of interesting features not occurring in the conventional case with simply connected electrodes. In particular, the fluxoid quantization results in a frustration of the Josephson phase, which, in turn, reduces the junction critical current. Further, the possible stable states of the system are obtained by a self-consistent application of the principle of minimum energy. The theoretical findings are supported by measurements on a number of samples having different geometrical configuration. The experiments demonstrate that a very large signal-to-noise ratio can be achieved in the flux quanta detection.