Codec Freedom -- Specifications -- Connection Profiles - Landlines

Landline connections generally follow the ISDN setup, with a 64000 bit/s data pipe that has a default destination of voice applications. Although end-user connections over ISDN are not as common as once they were, much of the telephony backbone assumes the ISDN B-channel structure and its G.711 codec, and by proxy, so do most Internet telephony solutions.

The G.711 codec comes in two flavours, named A-law and uLaw. The trade-offs between these versions are relatively unimportant, because the local telecom infrastructure will force one of the two onto their customers. There is a well-defined mapping between the two flavours, which can be repeated as often as desired with a known limited distortion.

Distortions are important to deal with; when distorted bytes are sent over a channel that is mapped from A-law to uLaw and back, then most of the values come out as they went in, but some have been distorted into a resulting value:

Distorted Resulting value
s26 s27
s28 s29
s30 s31
s32 s33
s45 s44
s47 s46
s63 s62
s80 s81

The prefix s is used to indicate a sign bit; the values are either positive or negative. In G.711, positive values are offset by 128 and negative values are offset by 0. The numeric values are shown in decimal. Take note that the Distorted and Resulting Values always differ only in their least significant bit only.

Distortion Detection

The Landline Connection Profile is responsible for providing such codes to the higher layers, that will escape these values to ensure an 8-bit clean interface to data and voice layers.

These lines start off with the G.711 codec, using the bit-insertion protocol. This protocol is defined in such a way that no Distorted values are offered for submission over landline connections.

The landline connection however, performs Distortion Detection during this initial phase. It does this by changing any byte to be sent that matches with a value in the Resulting Value column into the corresponding Distorted value.

On the receiving end, when a value from the Distorted column arrives, a flag is set to indicate that a value arrived that could have been distorted, but was not; if a value from the Resulting Value column arrives, a flag is set to indicate that a value arrived subject to distortion. The flags are initially reset. When changing the codec, an escape is sent that reveals whether the other side must assume distortion for the data sent here; this must be assumed if either something was received subject to distortion, or if nothing arrived without distortion although it could have been distorted. Note that this property is negotiated for each direction separately.

The packet mode may inquire for the codes to escape. If the other side has indicated that distortion must be assumed, then the values in the Distorted column are returned; otherwise, nothing is returned and a transparent channel is assumed.

This specification is based on the A-law flavour of G.711 for practical reasons, namely a lot of space for data in the softest samples. It would be possible to map this directly to uLaw if physical connections require this, but it may be more useful to map the following specifications to their uLaw equivalent; this could retain compatibility with these A-law specifications while also benefiting from its own detection of distortion.

Connection Profile

G.711 lines can be used for both bit-insertion and packet modes. The bit positions for bit-insertion mode have been defined above. For packet mode, the following profile defines the behaviour of a suitable escaping discipline:

blogroll