Prosody data communications Protocols: V.110

V.110 is an ITU-T standard data communications protocol.

This protocol implements the both the transmitter and the receiver for V.110. Since the protocol implements flow control, both halves must work together to co-ordinate the data flow.

V.110 uses a fixed framing pattern to carry the data. This pattern also may carry control bits. For most of the speeds supported, the same 80 bit framing pattern is used which is shown here:

FIRST LAST
0 0 0 0 0 0 0 0
1 D0 D1 D2 D3 D4 D5 S1
1 D6 D7 D8 D9 D10 D11 X
1 D12 D13 D14 D15 D16 D17 S3
1 D18 D19 D20 D21 D22 D23 S4
1 E1 E2 E3 E4 E5 E6 E7
1 D24 D25 D26 D27 D28 D29 S6
1 D30 D31 D32 D33 D34 D35 X
1 D36 D37 D38 D39 D40 D41 S8
1 D42 D43 D44 D45 D46 D47 S9

When this pattern is used, it carries three status bits, E1, E2, and E3, which help identify the speed. This pattern can be restricted to 1, 2, or 4 bits of the 8-bit timeslot to produce slower speeds. These are the possible speeds:

Bits used per timeslot
E3E2E1 1 2 4 8
001 600 (1200) (2400) (4800)
010 1200 (2400) (4800) (9600)
011 2400 (4800) (9600) (19200)
100 (3000) (6000) 12000 (24000)
101 (3600) 7200 14400 (28800)
110 4800 9600 19200 38400

Speeds in brackets can be selected by the use of the E bits, but are not defined in V.110. Such speeds can only be selected for transmission if there is no standard encoding for that speed (e.g. 9600 always uses the 2 bits per timeslot encoding).

The receiver selects the data rate automatically from the E1/E2/E3 bits, but the number of bits per timeslot is the same as the transmitter setting. The automatic selection occurs when the E bits are encountered in the frame. This means that when the E bits change, data in the first half of the frame may be misinterpreted. However, this should not occur in normal operation as the speed is typically changed only during the initial handshake when the X bit is OFF preventing data transfer.

The S and X bits control handshaking and are handled automatically.

The D bits are used to carry user data. However, depending on the speed being used, not all may carry user data, and each user data bit may be encoded in several frame bits. This is done as follows:

Encoding (E3E2E1)User bits per frameEffect
001 6 Bits other than multiples of eight are copies of the previous bit. (e.g. D0, D1, ... D7 are all the same and only encode a single bit of user data).
010 12 Bits other than multiples of four are copies of the previous bit.
011 24 Odd numbered bits are each copies of the previous bit.
100 30 Bits D10, D11, D14, D15, D18, D19, D21, D22, D23, D34, D35, D38, D39, D42, D43, D45, D46, and D47 are fill bits used only for padding. They are ignored by the receiver.
101 36 Bits D10, D11, D14, D15, D18, D19, D34, D35, D38, D39, D42, and D43 are fill bits used only for padding. They are ignored by the receiver.
110 48 All bits are user data

Where a user data bit is sent in several frame bits, the current receiver implementation uses only the first copy. In principle, it would be entitled to use any copy, or use all copies in an error-correction scheme.

The speed of 48000 bps is also supported, but as this uses a different frame format which does not include E bits, there is no automatic adjustment possible after this speed has been selected. This frame format is:

FIRST LAST
1 D0 D1 D2 D3 D4 D5 S1
0 D6 D7 D8 D9 D10 D11 X
1 D12 D13 D14 D15 D16 D17 S3
1 D18 D19 D20 D21 D22 D23 S4

The speed of 56000 bps is not supported.

The non-standard speed of 64000 bps is also supported through the use of the RA0 stage directly on the data channel. Since there is no framing and no initial handshake, the receiver will decode any arbitrary garbage prior to the channel being switched through.

API function behaviour

This should be read in conjunction with the generic data communications documentation.

smdc_channel_config()

You must use #include "smdc_v110.h" to get the appropriate declarations.

The protocol value is kSMDCProtocolV110.

The config_data pointer must point to one of these structs:

	typedef struct smdc_v110_config_parms {
		unsigned long speed;
		int format;
	} SMDC_V110_CONFIG_PARMS;

Where 'speed' is the speed in bits per second and 'format' is either 'kSMDCFormatAsync' or 'kSMDCFormatSync'.

The possible speeds are given in the table above.

Async connections are only available as 8 bits, no parity, one stop bit. The transmitter does not perform stop bit deletion.

The firmware module v110 must have been downloaded.

This protocol does not use encodings, so the 'encoding' field must be set to the value kSMDCConfigEncodingNone.

smdc_line_control()

[note] the transmit channel starts sending framing pattern with S=X=OFF as soon as it is configured. The Connect commands allow the initial handshake to proceed (S=X=ON as soon as framing is received).

[note] The RTS commands have no effect.

The Disconnect command has no effect.

There is an extra command available, kSMDCLineCtlSetAux which allows the value of the S, X, and E bits to be overridden. It uses two extra fields in the smdc_line_control_parms struct, namely aux_mask and aux_toggle. Each bit in these two fields controls one of the fifteen auxiliary bits in the V.110 frame. The bits are (in order of transmission): S1, X2, S3, S4, E1, E2, E3, E4, E5, E6, E7, S6, X7, S8, and S9. These are defined symbolically in the header file as kSMDCV110Aux_S1 etc. The four combinations possible are:

in aux_maskin aux_togglevalue sent
000
011
10normal
11inverted

The 'normal' behaviour of bits E1, E2, and E3 is essential for the remote end to decode the frames correctly, so these should not be changed. To avoid affecting bits indiscriminately, the suggested way to set the aux_mask field is like this example to set X=OFF:

	p.aux_mask = ~(kSMDCV110Aux_X2 | kSMDCV110Aux_X7);
	p.aux_toggle = kSMDCV110Aux_X2 | kSMDCV110Aux_X7;

which guarantees that the only bits affected are the X bits. (Note that 0=ON and 1=OFF according to the V.110 standard, which is somewhat confusing). Usually the auxiliary bits are controlled in groups:

S1, S3, S6, S8 called SA
S4, S9 called SB
X2, X7 called X
E1, E2, E3 set automatically from the speed
E4, E5, E6 for adjusting sync clock (not needed or implemented for Prosody)
E7 fixed at 1 (X.30 compatibility)

The kSMDCLineCtlCmdSetPrefixSuffix command is not supported by this protocol.

smdc_line_status()

The tx_status field is not updated and always indicates an idle connection.

smdc_tx_status()

The status 'empty' is never reported.

smdc_tx_control()

The only notification implemented is NotifyOnCapacity.

smdc_rx_status()

Reporting of overrun is not implemented.

smdc_rx_control()

Stop and resume are not implemented.

smdc_rx_data()

Each octet represents data received, with bits having been received least significant bit first. For async encoding, start and stop bits have been removed and do not appear in the data received.

smdc_tx_data()

Each octet represents data to be transmitted least significant bit first. For async encoding, start and stop bits will be added.