Güralp Compressed Format
8.3.1 The transport layer
The transmission header consists of 4 bytes:
1
2
3
4
ASCII G (0x47)
Block sequence
number
Block size
(MSB)
Block size
(LSB)
Block sequence number :
An unsigned integer, which increments by 1 after each
block, wrapping round to 0 from 255.
Block size :
The size of the block in bytes, excluding the transmission header and
checksum tail, but including the GCF block header.
After the transmission header, the GCF block is sent (with a length equal to the
number of bytes specified in
Block Size
), followed by a two-byte checksum. This
value is the sum of all bytes in the block header and body, modulo 65536, and is
presented in big-endian byte order.
To optimise the use of available transmitter bandwidth the transmitted data block is
truncated to the actual data length. This reduction is only applied to the difference
records - the first and last absolute values are still transmitted as 32 bit values.
8.3.2 ACK and NACK signals
After transmission of the block is complete, the transmitter waits a nominal 150 ms
for either a
NACK
or
ACK
signal before starting to transmit the next block.
If it receives an
ACK
, transmission of the next block commences immediately. If
NACK
is received, the block is re-transmitted.
The receiver should read the block, calculate the data checksum, and compare that
with the value sent in the transmission header. If the two values match, the receiver
should send an
ACK
signal, otherwise a
NACK
.
ACK
and
NACK
signals can be in two formats: an older 2-byte format and a newer 6-
byte format. The 2-byte signal is simply the first 2 bytes of the 6 byte signal. When
both the transmitter and receiver use the 6 byte version, the link is said to be
operating BRP (Block Recovery Protocol), which allows recovery of lost data (from up
to 255 blocks ago) as well as error correction on a per-block basis.
The format of an
ACK
or
NACK
message is
Byte
1
2
3
4
5
6
ACK
0x01
Stream ID
LSB
^S (0x13)
or 0
Stream
ID
Stream
ID
Stream ID
MSB
NACK
0x02
Stream ID
LSB
Block
number
Stream
ID
Stream
ID
Stream ID
MSB
119
Issue U - December, 2021