This is a famous article of Nick Bostrom from 2002 (published in Philosophical Quaterly). I saw this first in a seminar on anti-realistic theories of truth.
If we are indeed living inside a simulation, what knowledge can we have about an external world?
You might also enjoy a discussion of the "brains in a vat" hypothesis: http://plato.stanford.edu/entries/brain-vat/