Cavity structures appear in a lot of electromagnetic applications, including jet engine inlet and car grooves. It is usually formulated as a defect in a half space plane. Since the domain is unbounded, solving the corresponding wave equation is quite challenging, especially in the high frequency regime. In this talk, I will talk about how to construct a well-posed boundary integral equation to solve the problem, both in two and three dimensions. For numerical computation, we apply several techniques to make the algorithm fast, including hierarchical matrix factorization, Fourier decomposition and parallel computation. I will also talk about the low frequency breakdown problem for the three dimensional case.