In this paper we study continuous flow finite buffer systems with input rates modulated by Markov chains. Discrete event simulations are applied for estimating loss probabilities. The simulations are executed under a twisted version of the original probability measure (importance sampling). We present a simple rule for determining a new measure, then show that the new measure matches the ‘most likely' empirical measure that we expect from large deviations arguments, and finally prove optimality of the new measure.