kaiser.cx

Welcome to the homepage of Martin Kaiser

PCAP format for MDB

Introduction

The MDB (Multi-Drop Bus) protocol is used inside a vending machine. MDB defines the communication between the main control board (VMC = Vending Machine Controller) and peripheral components, e.g. a payment terminal or a bill validator.

The VMC acts as bus master and sends a request to one peripheral at a time. A peripheral may send data only in response to such a request.

The MDB specification is maintained by the National Automatic Merchandising Association (NAMA). As of August 2023, the current version of the MDB specification is 4.3. It is available from
https://namanow.org/nama-releases-mdb-version-4-3/

Data Link Type

300 (DLT_MDB) was assigned for MDB.

For pcap files, this value shall be set in the global header’s network field. Pcapng defines an Interface Description Block, its LinkType must be set to this value.

Packet Data

The packet data consists of an MDB pseudo-header plus the captured MDB data.

pseudo-header MDB data

pseudo-header

The pseudo-header has information about the type of the captured data.

field length (bytes) mandatory description
version 1 yes set to 0 for now
event 1 yes see the table below
peripheral address 1 no required only for event 0xFE

The peripheral address must be set in the header for packets from a peripheral to the VMC (packets from the VMC to a peripheral have the peripheral address in the MDB data). The possible values for peripheral address are defined in section 2.3 of the MDB specification, the xxx bits in this definition should be set to 0.

event

The event byte may be set to one of the following values.

value description periph. address MDB data
0xFF data from VMC to peripheral no yes
0xFE data from peripheral to VMC yes yes
0xFD VMC initiated a bus reset no no

Examples

The VMC sends a vend request to the Cashless #1 peripheral.

pseudo-header MDB data
0x00 0xff 0x13 0x00 0x00 0x3c 0x00 0x01 0x50

The Cashless #1 peripheral sends a response to the VMC and approves the vending operation.

pseudo-header MDB data
0x00 0xfe 0x10 0x05 0x00 0x10 0x15

Links

Questions, comments

Please send any questions or comments to ‘www(at)kaiser(dot)cx’