In contrast to classic train protection systems where most of the safety measures are built into the rail infrastructure, future versions of the European railway safety system ERTMS (European Railway Traffic Management System) require trains to check their own safety. One of the safety measures is the train integrity check, which checks whether all carriages are still in the train. The check has to be completed in a certain amount of time. This paper presents an overview for communication in such an integrity system, based on a wireless sensor network (WSN). Because a WSN with nodes in each carriage has a linear structure, existing communication protocols which assume a mesh-like topology do no suffice. Simulation shows that the proposed communication is feasible and has the necessary (soft) real-time properties to complete an integrity check in time. The protocol, based on the IEEE 802.15.4 network stack, is implemented and tested by Strukton.