  We propose a scheme to simulate topological physics within a single
degenerate cavity, whose modes are mapped to lattice sites. A crucial
ingredient of the scheme is to construct a sharp boundary so that the open
boundary condition can be implemented for this effective lattice system. In
doing so, the topological properties of the system can manifest themselves on
the edge states, which can be probed from the spectrum of an output cavity
field. We demonstrate this with two examples: a static Su-Schrieffer-Heeger
chain and a periodically driven Floquet topological insulator. Our work opens
up new avenues to explore exotic photonic topological phases inside a single
optical cavity.
