A medical ventilator is coupled to a patient via a hose system to generate a respiratory flow according to a predetermined ventilation mode. The ventilator has a first flow sensor for generating a first sensor signal indicative of an inspiratory flow into the hose system distant from the patient. The hose system has a further flow sensor for generating a further sensor signal indicative of the respiratory flow proximal to the patient. The ventilator has an input for receiving the further sensor signal. The ventilator compares the further sensor signal with an expected sensor signal indicative of the respiratory flow proximal to the patient. The expected sensor signal is determined by a combination of the first sensor signal and the predetermined ventilation mode. The ventilator controls the ventilating in dependence on the comparison.