LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I establish a telnet session with unit under test?

I am going to the next step as a novice and moving from serial communications to ethernet on my unit under test. I have been all over the help and discussion forums etc and cannot find an answer. I need to open up a telnet session with my unit under test and keep it open to send commands back and forth for control of the unit. Can anyone give me a hint of how I am to establish this communication? I have the IP address and I am using port 23 but I just get the session started and then immediately closed. The sequence of events will be: start the session, the unit will reply with a username and then password, after that I need the session to remain open so I can send commands as if I am sitting at the serial port. When complete the session will then be terminated. Thanks in advance for any help.
0 Kudos
Message 1 of 3
(4,539 Views)
I Googled this link

http://www.ni.com/support/labview/toolkits/internet/telnet.htm

From other info that I have gleaned off the web, Telnet is a non-trivial protocol and you could spend much more time than the cost of the tool kit trying to get it going, IMHO.
Message 2 of 3
(4,527 Views)
If you want to do telnet using plain TCP, you need to do everything yourself, including the telnet options negotiation.

RFC 854 should have most of what you need (look towards the bottom).

Most likely, the server will propose a few options, which you should either accept or reject depending on your needs.
Easiest is probably to use a packet sniffer on a regular telnet session, then dissect the negotiation to see what that particular server wants.

RFC 990 has a list of telnet options, look for the section labeled "ASSIGNED TELNET OPTIONS".

It should be simple to write some code that negotiates with one particular host. It will be more difficult to write a full-blown telnet client that does general negotiations with any type of telnet server.

I have a small program that telnets to a router to do some configuration. The only thing I reply to the proposed options is:

"\FF\FD\03\FF\FE\01\r\n" (In \-codes). Translated: "Don't suppress go ahead, Do echo".
(FF=IAC "Interpret as command", FD=Do, FE=Don't, 01=echo, 03= suppress go ahead.)
Message 3 of 3
(4,524 Views)