The
Link Quality Monitoring (LQM) option is defined in the PPP protocol
specification. When the PPP implementation supports LQM, PPP can
make policy decisions based on the quality of the link between peers.
When LQM is invoked, pppd
requests that the other end of the connection send Link Quality
Report (LQR) packets back to pppd.
If the link goes down or is degraded, many or all of the LQR packets
will be lost. This also indicates that data packets have been lost
and the connection is too bad to warrant continued traffic. pppd
counts the arriving LQRs, and if too many have been lost, pppd
closes the connection. LQM packets do not count against the idle
line disconnection timer, since they are part of the protocol rather
than user data.
Guides for Evaluation of Link Quality |
 |
pppd bases its evaluation
of the link status on the arguments of two associated options, lqrinterval
and lqthreshold. The value of the lqrinterval option tells pppd
how often to request LQR packets from the peer machine. The default
value is every ten seconds, or five per minute, allowing for timing
slop. lqthreshold's argument is the minimum acceptable link quality.
The default lqthreshold is one out of five packets. With the default
values in place, the link will shut down if no LQR packets arrived
during the previous minute.
Adjusting LQM Behavior |
 |
The
default LQM behavior, one successful packet out of five sent every
minute, is fairly permissive. pppd
is more demanding about line quality if you change the defaults.
Either evaluation setting can be changed to make LQM more stringent.
For example, you can demand that at least one LQR arrive per minute
by specifying
lqrinterval 5 lqthreshold 1/12 |
Or you can demand that no more than one LQR be lost each minute
by specifying
lqrinterval 5 lqthreshold 11/12 |
Weighing the Costs of LQM |
 |
pppd discovers line failures
more quickly if you decrease the lqrinterval because LQR's will
arrive more frequently. However, sending more LQR's increases monitoring
traffic, slowing down the transfer of user data. So you should
remember to also consider raising the lqthreshold. If the lqthreshold
is 'lqthreshold 5/6', no more than one LQR can
be dropped per minute. If two LQRs in a row are dropped, pppd
shuts down the line.
LQM Response to Link Failures |
 |
LQM
is particularly useful for detecting and responding to total link
failures. The response can include failover protection which switches
the connection to an available dial-up modem. Most total failures,
for example, a backhoe digging through the telephone company's
cable, cause the connection's CSU/DSU or modem to deassert the Carrier
Detect signal. pppd observes this
as a hangup event.
Failure Without Disconnection |
 |
But some failure modes, like misconfigured flow control and
over-reliance on in-band XON/XOFF flow control, leave modems connected
even though the PPP peers are unable to communicate. In this situation,
the peers observe an LQM failure and take appropriate action, usually
disconnecting and redialing. LQM is also useful if an intercontinental
telephone connection is of such poor quality that significant numbers
of packets are damaged in transit. Again, the PPP implementations
can decide, based on LQM measurements, to hang up and redial in
hopes of getting a better connection. This is a very rare occurrence
if your modems provide V. 42 or MNP 4 error correction, but it does
occasionally happen. Whatever the cause, the disconnection and redial
operation can happen without user intervention or application awareness.
This is because even if PPP frames are damaged or lost, the upper
protocol layers arrange for retransmission as needed to provide
the user with a complete data stream. The user simply experiences
a pause while the modems reestablish the connection.
Peer Refusal to Comply with LQM Request |
 |
If,
during LCP option negotiation, the peer refuses to send Link Quality
Reports, pppd instead begins sending
LCP Echo-Request messages at the requested lqrinterval and use the
arriving LCP Echo-Response messages to make the link quality decision.
If the peer does not correctly use a LCP Configure-Reject message
to tell PPP to switch to LCP Echo-Requests, PPP can be given either
the echolqm argument, to dispense with the negotiation phase and
begin directly with Echo-Requests, or the nolqm argument, to disable
link quality monitoring completely. At pppd's
debugging verbosity level 4, the log file receives summary messages
like this:
5/7-13:45:27-1514 LQM: Pkt: 1/1 Oct: 53/53 LQRs: 5/5 |
This means that, during the last testing interval, this system
transmitted one packet and received one packet. Fifty-three octets
crossed the link in each direction. And this system has received
responses to all five of the most recent five Link Quality Reports
it sent. The LQR packet is 36 octets long, and the default lqrinterval
of ten seconds will cause the additional traffic to be unnoticed
on most connections. However, if the application is very sensitive
to speed and requires absolutely every bit of available line bandwidth,
use the nolqm argument to disable LQM.