Patent ID: 8891558

Claim:
A communication device for achieving packet synchronization with respect to data input from an external device, the communication device comprising: one or more processors configured to: perform a check on check target data using a predetermined amount of first input data as a check code each time a unit amount of data is input and determine that the check code is detected when a result of the check is successful, the check target data being input data preceding the first input data; assume that a start position of the check target data at a time when the check code is detected corresponds to a start position of a header of a first packet, and read a packet length of the first packet from the header of the first packet; determine whether a length of the check target data at the time when the check code is detected matches the read packet length of the first packet; assume that a start position of input data succeeding the check code corresponds to a start position of a header of a second packet succeeding the first packet, and read a packet length of the second packet from the header of the second packet; measure an input data length starting from the start position of the header of the second packet, every time the unit amount of the data is input; detect the check code by generating a predetermined amount of the check code corresponding to process target data every time the unit amount of the data is input, the process target data corresponding to the input data starting from the start position of the header of the second packet, the check code being detected when the generated check code matches the predetermined amount of the input data succeeding the process target data; and determine whether a length of the process target data at the time when the check code is detected matches the measured input data length, wherein the communication device is connected via a USB cable to the external device and receives data transferred from the external device in a bulk transfer mode, wherein the first packet and the second packet are IP (Internet Protocol) packets, and wherein the one or more processors respectively read the packet lengths of the first packet and the second packet from headers of the IP packets, according to version information located at a predetermined position in the headers of the IP packets.