Problem with Telnet server

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with Telnet server

1,285 Views
amleng
Contributor IV

Hello all,

I need to send many small messages (less than 100 bytes) continuously like stream by Telnet protocol. I implemented a Telnet server (based on web_hvac demo). I use windows command prompt to receive the data. I think there is a problem there. I can not get all messages. Some data lost. it gets worst as it's going on. Any thought? any suggestion?

Regards,

Sina

0 Kudos
7 Replies

716 Views
amleng
Contributor IV

i use printf() to send data over Telnet. If I increase  TELNETDCFG_BUFFER_SIZE  to 1024 it gets better for a few first messages and gets slow again! It seems there is a buffer issue! I'm not sure tho. 

0 Kudos

716 Views
amleng
Contributor IV

I send 100-byte messages every 35ms. It seems telnet works too slow or maybe buffering problem?

0 Kudos

716 Views
Martin_
NXP Employee
NXP Employee

MQX 4.0, right ? a small change in tcp_send.c adds TCP push flag bit into each outgoing tcp packet. comment out the 4 lines as shown below:

//if ( ((tcb->status & TCPS_TPUSH) != 0  &&

   //    GE32(tcb->sndpush, dataseq)      &&

   //    LE32(tcb->sndpush,dataseq+sent)) ||

   //   (flags & FIN))

   {

      flags |= PSH;

   } /* Endif */

0 Kudos

716 Views
chris-quin
Contributor I

But why did you change it? Is there an acceptable reason? I got errors because of this.

Greetings

0 Kudos

716 Views
amleng
Contributor IV

Actually, I use MQX 4.1. Those changes didn't help. no effect on the timing! Is there any other over head I can eliminate?  any ACK/NACK  routines? any other functions I can use to send out data over Telnet?

0 Kudos

716 Views
Martin_
NXP Employee
NXP Employee

You should attach Wireshark communication log. Windows 7 TCP stack adds 200 ms delay to ACKs, by default.

TcpAckFrequency and Nagle

Recently I worked with ethernet_serial demo (it will be in MQX 4.0.2) for transmit side it simply reads characters from UART and sends them in short TCP packets (1 byte of data payload) to a remote peer. By disabling Windows 7 TCP ACK delay I found that RTCS transmits outbound packets very fast. Just the remote application only buffers the incoming data and doesn't display them on time. By adding push flags to the outbound packets the remote application is instructed to flush the incoming buffer frequently.

0 Kudos

716 Views
amleng
Contributor IV

Awesome! I just did the modification on Telnet command prompt and it works pretty smooth.

Thanks martin,

0 Kudos