Problems sending data containing 0xFF and-or CR

When I send binary data that contains bytes with the value 0xFF to or from my Lantronix device server's serial port sometimes the FF is doubled, and sometimes it is stripped from the data stream.Also, if I send text data the CR character at the end of each line is followed by a Null character, but the original data has no Null characters in it.What would cause this?


This behavior is caused by a mismatch between the Lantronix device server's network configuration and the network configuration of the host that is communicating with the device server. Specifically one side is set up to use telnet and the other side is set up for raw TCP.

If one side of a connection is using telnet and the other side is using raw TCP then FF characters will usually be either doubled or stripped, depending on which direction the data is being sent.

For instance, say a host is opening a telnet connection to port 10001 on a UDS (or similar product) and the UDS has Telnet Mode disabled (DisConn Mode 00). In this situation the host will be sending and interpreting telnet IAC (Interpret As Command) strings.

FF signals a telnet client or server that the next few characters will be a telnet IAC string. If telnet receives an FF to send onto the network it will send the IAC command FF FF, which just means "send an FF".

If an FF comes in on the network side, telnet will strip it and look at the following character to see if it's a valid IAC command. If it is it will interpret the command string, if not it will just send the characters following the FF as data.

Also, a telnet client or server will pad a CR character with a Null when it sends data over the network. If the other end of the connection is also using the telnet protocol it will strip the Null. This is referred to as a 'telnet pad'.

To resolve this, on UDSs and similar products running CoBos, telnet mode can be enabled by changing DisConn Mode to 40.

If you are seeing the above symptoms and you already have telnet mode enabled, it's likely that the other end of the connection is expecting raw data, so try disabling telnet mode by setting DisConn Mode to the default value of 00.

Enabling and disabling telnet on other Lantronix products varies by product line. Please see the User Guide or Installation Guide for your product, available from http://www.lantronix.com/support/documentation.html.

Documentation for most discontinued products is available from http://www.lantronix.com/support/discontinued.html

For more information on telnet and IAC strings see RFC 854 at http://tools.ietf.org/html/rfc854, and/or do a web search on 'telnet iac".



[Originally Published On: 12/06/2007 10:01 AM]