|
EM datagrams on *.kmall format
Reg. nr. 410224 rev I
|
When a multibeam datagram (EMdgmMRZ_def and EMdgmMWC_def) is sent from the multibeam echosounder system, the datagram will be split into several partitions if the multibeam datagram size exceeds the maximum datagram size (MAX_DGM_SIZE, corresponding to maximum size of a UDP package). The multibeam data logger has to process the raw multibeam datagram and combine the partitions into one clean multibeam datagram (EMdgmMRZ_def or EMdgmMWC_def). This process is described below.
Major change from Revision I:
Every partition contains the datafield EMdgmMbody_def. Before Revision I, EMdgmMbody_def was only in the first partition. See the "Before Rev I." column in the table below. This header has to be deleted for all the partitions, except for the first partition.
Below we have an example where a raw EMdgmMRZ_def datagram has been recorded. The size of the raw logged EMdgmMRZ_def datagram is in our example 130 000 bytes. EMdgmHeader_def.numBytesDgm equals the max datagram size (MAX_DGM_SIZE) for all the partitions, except for the last partition. We know how many partitions we shall expect (EMdgmMpartition_def.numOfDgms) and which partition we currently are processing (EMdgmMpartition_def.dgmNum). Since the raw EMdgmMRZ_def size is 130 000 bytes, EMdgmMpartition_def.numOfDgms will be 3 (see the code example further down). The very last partition contains the remainder of the raw EMdgmMRZ_def datagram. EMdgmHeader_def.numBytesDgm of the last partition will be 130 000 - 2 x MAX_DGM_SIZE = 2000 bytes. Again, see the code example. Every partition ends with the size of the partition, named EMdgmMpartitionNumBytes_def in this example. EMdgmMpartitionNumBytes_def and EMdgm_payload_def are dummy datafields and do not exist in the datagram format.
| Partition | From Rev. I | Before Rev. I | Description | |||
|---|---|---|---|---|---|---|
| 1 | EMdgmHeader_def | EMdgmHeader_def | Definition of general header. EMdgmHeader_def.numBytesDgm = MAX_DGM_SIZE | |||
| EMdgmMpartition_def | EMdgmMpartition_def | Partition information. EMdgmMpartition_def.numOfDgms = 3, EMdgmMpartition_def.dgmNum = 1 | ||||
| EMdgmMbody_def | EMdgmMbody_def | Start of body of all M datagrams | ||||
| EMdgm_payload_def | EMdgm_payload_def | Common dummy struct for multibeam payload. See definition in table below. | ||||
| EMdgmMpartitionNumBytes_def | EMdgmMpartitionNumBytes_def | Equal to EMdgmHeader_def.numBytesDgm | ||||
| 2 | EMdgmHeader_def | EMdgmHeader_def | Definition of general header. EMdgmHeader_def.numBytesDgm = MAX_DGM_SIZE | |||
| EMdgmMpartition_def | EMdgmMpartition_def | Partition information. EMdgmMpartition_def.numOfDgms = 3, EMdgmMpartition_def.dgmNum = 2 | ||||
| EMdgmMbody_def | Start of body of all M datagrams | |||||
| EMdgm_payload_def | EMdgm_payload_def | Common dummy struct for multibeam payload. See definition in table below. | ||||
| EMdgmMpartitionNumBytes_def | EMdgmMpartitionNumBytes_def | Equal to EMdgmHeader_def.numBytesDgm | ||||
| 3 | EMdgmHeader_def | EMdgmHeader_def | Definition of general header. EMdgmHeader_def.numBytesDgm = 2000. (130 000 - 2 x MAX_DGM_SIZE ) | |||
| EMdgmMpartition_def | EMdgmMpartition_def | Partition information. EMdgmMpartition_def.numOfDgms = 3, EMdgmMpartition_def.dgmNum = 3 | ||||
| EMdgmMbody_def | Start of body of all M datagrams. | |||||
| EMdgm_payload_def | EMdgm_payload_def | Common dummy struct for multibeam payload. See definition in table below. | ||||
| EMdgmMpartitionNumBytes_def | EMdgmMpartitionNumBytes_def | Dummy datafield, equal to EMdgmHeader_def.numBytesDgm, 4 bytes. |
| Name | Data struct |
|---|---|
| EMdgm_payload_def | EMdgmMRZ_pingInfo_def |
| EMdgmMRZ_txSectorInfo_def | |
| EMdgmMRZ_rxInfo_def | |
| EMdgmMRZ_extraDetClassInfo_def | |
| EMdgmMRZ_sounding_def | |
| EMdgmMRZ_txSectorInfo_def | |
| EMdgmMpartitionNumBytes_def | uint32_t |
You may notice there is redundant information in the raw EMdgmMRZ_def datagram shown in the table in the previous section. In the final EMdgmMRZ_def, we do not care about partitions. The next task will be to reassemble the raw datagram and create a complete EMdgmMRZ_def datagram according to the datagram specification. We only want EMdgmHeader_def, EMdgmMpartition_def and EMdgmMbody_def once in our datagram. In the example above, the three data fields are represented three times, thus we have to remove two of the groups.
When we have reassembled the raw EMdgmMRZ_def datagram to a complete EMdgmMRZ_def datagram, we remove the redundant fields. See the table below for the final complete EMdgmMRZ_def datagram.
| Reassembled EMdgmMRZ_def | Description | |
|---|---|---|
| EMdgmHeader_def | Definition of general header. See code example below for computation of EMdgmHeader_def.numBytesDgm. | |
| EMdgmMpartition_def | Partition information. Always EMdgmMpartition_def.numOfDgms = 1, EMdgmMpartition_def.dgmNum = 1 in the final EMdgmMRZ_def. | |
| EMdgmMbody_def | Start of body of all M datagrams | |
| EMdgm_payload_def | Dummy struct for payload. See table above. | |
| EMdgmMpartitionNumBytes_def | Equal to EMdgmHeader_def.numBytesDgm. Dummy data field. |
Since the redundant data fields have been removed, EMdgmHeader_def.numBytesDgm needs be recomputed. See the code example below.
An example of how to combine the logged multibeam datagram #MRZ in C++ can be found here. Note that this example will only work with localhost. Use replay of *.kmall file in SIS 5 for input to the logger.