How can I tell if PPP compression is enabled for modem?

7,396

Solution 1

You can use the command pppstats -z to display compression statistics. If it displays all zeros then compression is not enabled.

excerpt from man page

   -z     Instead of the standard display, show statistics indicating the 
          performance of the packet compression algorithm in use.

   When the -z option is specified, instead displays the following fields,
   relating to the packet compression algorithm currently in use.   If
   packet compression is not in use, these fields will all display zeroes.  
   The fields displayed on the input side are:

   COMPRESSED BYTE
          The number of bytes of compressed packets received.

   COMPRESSED PACK
          The number of compressed packets received.

   INCOMPRESSIBLE BYTE
          The number of bytes of incompressible packets (that is, those 
          which were transmitted in uncompressed form) received.

   INCOMPRESSIBLE PACK
          The number of incompressible packets received.

   COMP RATIO
          The  recent  compression ratio for incoming packets, defined as 
          the uncompressed size divided by the compressed size (including 
          both compressible and incompressible packets).

   The fields displayed on the output side are:

   COMPRESSED BYTE
          The number of bytes of compressed packets transmitted.

   COMPRESSED PACK
          The number of compressed packets transmitted.

   INCOMPRESSIBLE BYTE
          The number of bytes of incompressible packets transmitted (that 
          is, those which were transmitted in uncompressed form).

   INCOMPRESSIBLE PACK
          The number of incompressible packets transmitted.

   COMP RATIO
          The recent compression ratio for outgoing packets.

Solution 2

Check /etc/ppp/options.

DO NOT Edit this file, rather copy it to some location and make edit.

check this:

# Disable Address/Control compression negotiation (use default, i.e.
# address/control field disabled).
#-ac

More info you can find here in the PPP-HOWTO.

Share:
7,396

Related videos on Youtube

fred basset
Author by

fred basset

Engineer working with C, C++, assembler and embedded hardware.

Updated on September 18, 2022

Comments

  • fred basset
    fred basset almost 2 years

    I'm using Debian Linux on an embedded system, we use ppp to connect to the WAN via a CDMA modem. I want to find out if compression is being used by ppp.

    In my /var/log/messages I see the line:

    kernel: [   54.740000] PPP Deflate Compression module registered
    

    but in /var/log/debug I see this:

    pppd[2433]: Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
    

    The output of pppstats -z is:

    IN:  COMPRESSED  INCOMPRESSIBLE   COMP | OUT: COMPRESSED  INCOMPRESSIBLE   COMP
        BYTE   PACK     BYTE   PACK  RATIO |     BYTE   PACK     BYTE   PACK  RATIO
           0      0        0      0   0.00 |        0      0        0      0   0.00
    

    So does the above mean compression is enabled, or not?

  • OmPS
    OmPS over 10 years
    it seems you already have compression enabled.
  • user2578106
    user2578106 over 10 years
    This is Address/Control Field Compression, which is not what is usually meant by compression on a PPP link.
  • fred basset
    fred basset over 10 years
    Great answer thank you, I was not aware of pppstats. I ran it with the -z option and it returned all zeros for the fields, which I assume means there is no compression in effect? This would also correlate with the protocol reject message I saw in the logs.