How MVR-xchange Works

This overview assumes a working familiarity with the MVR-xchange communication protocol.

MVR-xchange TCP Mode

In the TCP mode, each station needs to:

  • provide a receiving TCP server. This server listens for incoming communication and sends responses to incoming commands
  • start an mDNS service, announcing the _mvrxchange._tcp.local service with the address and port of the listener
  • have a TCP client, to send MVR commands and to receive responses and incoming files

mDNS

MVR-xchange utilizes mDNS (RFC6762 Multicast DNS) for discovery and detection of stations being present on the network. Developers must create a service on the network and each station must respond to ongoing mDNS queries for the service.

Periodic queries

In order to determine whether station(s) are still present on the network, stations might send periodic mDNS queries. Stations not responding to the mDNS query will be marked as offline by the other stations. Each station must also respond to it’s own query, allowing other stations to see its presence on the network being announced/confirmed.

%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
sequenceDiagram
  Note over Station A,Station B: Initial mDNS discovery:
  Station A->>Station B: mDNS query
  Station B->>Station A: mDNS response
  Note over Station A,Station B: Periodic mDNS queries:
  Station A->>Station B: mDNS Periodic query
  Station B->>Station A: mDNS response
  Note over Station A,Station B:  Each station must respond <br> to received queries and <br> it must also respond <br> to it's own queries
  Station B->>Station A: mDNS Periodic query
  Station A->>Station B: mDNS response

mDNS records

Each station must ensure to have SRV, PTR, TXT and A records. The SRV record must include the TCP listener port. The A record provides the IP address.

Example of the SRV record

This example shows an MVR-xchange group called “WorkGroup”, with the listener on port 60000 (the port choice is on each station):

Instance: WorkGroup
Service: _mvrxchange
Protocol: _tcp
Name: local
Port: 60000
Target: WorkGroup._mvrxchange._tcp.local

Example of the PTR record

This example shows a station with the hostname of “MyHostname”:

Name: WorkGroup._mvrxchange._tcp.local
Domain Name: MyHostname.WorkGroup._mvrxchange._tcp.local

Example of the A record

This example shows a station with the IP address 192.168.1.18:

Name: WorkGroup._mvrxchange._tcp.local
Address: WorkGroup._mvrxchange._tcp.local (192.168.1.18)

Example of TXT record

This example shows a station called “My Station”:

Name: WorkGroup._mvrxchange._tcp.local
TXT: StationName=My Station
TXT: StationUUID=ABCDEFGH-0200-0004-8408-8F9800023A75

TCP Communication

Each TCP interaction is a temporary, short-lived connection. The station sending an MVR-xchange command establishes a TCP connection to another station. Responses to MVR-xchange commands are sent via the currently already open TCP connection. After the interaction, the connection is closed.

Example of MVR_JOIN:

%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
sequenceDiagram
  Note over Station A,Station B: Connection is established
  Station A->>Station B: MVR_JOIN
  Station B->>Station A: MVR_JOIN_RET
  Note over Station A,Station B: The response is sent <br>in the already open <br> TCP connection
  Note over Station A,Station B: Connection is closed

Example of MVR_COMMITs:

%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
sequenceDiagram
  Note over Station A,Station B: Connection is established
  Station A->>Station B: MVR_COMMIT
  Station B->>Station A: MVR_COMMIT_RET
  Note over Station A,Station B: The response is sent <br>in the already open <br> TCP connection
  Note over Station A,Station B: Connection is closed
  Note over Station B,Station A: Connection is established
  Station B->>Station A: MVR_COMMIT
  Station A->>Station B: MVR_COMMIT_RET
  Note over Station A,Station B: The response is sent <br>in the already open <br> TCP connection
  Note over Station A,Station B: Connection is closed

Example of MVR_REQUEST:

%%{init:{"fontFamily":"monospace", "sequence":{"showSequenceNumbers":true}}}%%
sequenceDiagram
  Note over Station A,Station B: Connection is established
  Station A->>Station B: MVR_REQUEST
  Station B->>Station A: MVR_REQUEST_RET
  Station B->>Station A: Transmitting the content of the file
  Note over Station A,Station B: The response is sent <br>in the already open <br> TCP connection
  Note over Station A,Station B: Connection is closed