1

within a small embedded application I'm providing a Telnet server for sending simple commands to it. For testing I connect to it using putty. Now I found there are 21 bytes of some data are sent to the server on connection. So...what could this be? Is it a initialisation sequence?

From my understanding telnet is a plain connection which should not have such data...

Thanks!

Elmi
  • 5,899
  • 15
  • 72
  • 143
  • My question may sound silly, but are you using the telnet Connection mode or the ssh connection mode in Putty? – ibtarek Apr 07 '14 at 09:10
  • It is the telnet connection mode - after dropping these 21 bytes all following data are received as plain text. In SSH mode Putty should stop this connection in case other end does not respond properly. – Elmi Apr 07 '14 at 09:14
  • 21 bytes of what exactly? – user207421 Apr 07 '14 at 09:45
  • Whereas the Telnet protocol is good for communicating *plain text* (and is often used for such), **it is in no way a plain protocol**. Handling all the *IAC* control sequences in a robust way is actually rather hard. See [RFC 1143](https://tools.ietf.org/html/rfc1143) for a possible way to implement option negotiation. Denying requested options is fine, simply ignoring bytes isn't. – blubberdiblub Jan 03 '17 at 09:16

1 Answers1

2

OK, I got it: when selecting "Active auto negotiation mode" in Putty it sends these data with additional information of whatever...so one has tod rop all characters with an ASCII code larger than 127 to ignore these data.

Elmi
  • 5,899
  • 15
  • 72
  • 143
  • It would make more sense just to disable that option. Your suggestion solution won't actually work in all cases. – user207421 Apr 07 '14 at 09:56
  • I don't agree. The negotiation data are fully conform to what a telnet client is allowed to send, so a properly implemented server should be able to handle these data (means at least to recognise and drop them). – Elmi Apr 07 '14 at 11:11