Escaping XON/XOFF in TCP/IP data mode

6 thoughts on “Escaping XON/XOFF in TCP/IP data mode

  1. GE864-QUAD V2

     

    We need to transfer big amounts of data and to assure that no data is lost because of buffer overflows we need to use flow control. Unfortunately because of our hardware design HW flow control is not a option so we need to use SW flow control with TCP/IP sockets, how can we escape XON/XOFF characters on the serial port?

     

    AT#BASE64 doesn’t help here because it works between modem and socket, what we need si between modem and our device on the serial line.

    Hex mode configured with AT#SCFGEXT is only for command mode as well.

    1. "XON/XOFF with filtering" (at&k4) means that the XON/XOFF
      characters are filtered out of the data stream by the modem before being
      transmitted to the remote modem;
      “XON/XOFF without filtering” (at&k5) is the Transparent XON/XOFF
      flow control :it does not filter these characters. Instead the modem
      allows them to be transmitted to the remote DCE to instruct it to stop
      sending data.

       

      This means that in either case your software layer should add its own layer to handle the situations: non flow-control XON/XOFFin data stream must be changed in other set of characters prior to be sent to the modem.

      Most text based protocols like HTTP will work with AT&K4.

       

      Anyway my information is that software flow control is only valid for GSM/CSD, and not for GPRS. I’ll check.

      1. Yes, I am configuring the modem with AT&K4. We are using custom binary protocol XON/XOFF characters appear from time to time.

        In my tests I see that sending big amount of data triggers modem to send XOFF/XON to control the flow, but when these characters are presend in the binary data that I’m sending they are passed to the socket.

      2. Anyway my information is that software flow control is only valid for GSM/CSD, and not for GPRS. I’ll check.

        Such confirmation will be greatly appreciated.

        1. Hmmm … on some tests XON/XOFF characters are filtered from the modem, on some not. I’m totaly puzzled and can’t get the logic:

           

          – it seems that if the modem serial line receive buffer is going to overflow then XOFF/XON are send to control the flow. In that case XON/XOFF characters are filtered from the data on the serial line and not appear in the socket.

           

          – from other side one very simple test – openning socket and sending "x13 x11 x13 x11" (i.e. XOFF space XON space etc.) doesn’t filter anything

          1. The answer was confirmed by R&D:
            
            SW flow control cannot be used for binary data because Xon/Xoff bytes may be included in binary stream, therefore it cannot be used for binary connections like PPP, CSD, IPEasy, etc.
            
            Some TCP/IP packet can be corrupted because some byte are recognized like Xon/Xoff byte and removed from stream.