From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,4cdcab054a45d26e X-Google-Attributes: gid1164f8,public From: aaron@cisco.com (Aaron Leonard) Subject: Re: Using Sockets and a Terminal Server to Access Hardware. Date: 1997/03/10 Message-ID: <5g1lpj$umf$1@mate.kjsl.com>#1/1 X-Deja-AN: 224457883 Distribution: world Sender: aaron@Not-Craw--Craw.cisco.COM (Aaron Leonard) References: <3323678E.2263@pc.jaring.my> Organization: cisco Systems (formerly TGV) Reply-To: Aaron@cisco.COM Newsgroups: comp.sys.dec In article <3323678E.2263@pc.jaring.my>, Ranjit Singh Banwait writes: |Hi, | |I am playing around with interfacing to some hardware |through a Dec700 terminal server. I enabled the telnet |server service on a port of the terminal server and |plugged my hardware in. Then I made a tcp/ip socket |connection to the port. I stay in the NVT mode of the |telnet server application I communicate with the hardware. | |Problem: |I am able to get data from the hardware into my program but |I have problems when the hardware sends a byte with hex |value FF or when the hardware sends a carriage return. |A byte FF is followed by a second FF which is added by the |telnet server(I think) |A carriage return is followed by a NULL character(decimal 0). Yes, this is correct behavior for TELNET NVT. 0xFF is the NVT escape code (IAC); a 0xFF in the application data stream will go out on the wire as 0xFF 0xFF. (Other codes following a 0xFF will be intepreted as TELNET options/commands.) A not followed by will go out on the wire as . (Worse, from the standpoint of getting data as-is thru the connection, NVT standardly only supports 7-bit ASCII, not 8-bit.) See RFC-854. If the TELNET BINARY option is negotiated (see RFC-856), then 8-bit data is allowed, and the mapping is not done. However, the IAC (0xFF) doubling will still be done. |Question: |If I want to interface to hardware over a network, should |I be using Sockets and a terminal server or some other connection |method and/or hardware. If the hardware you're trying to talk to has a serial interface, then connecting it to a terminal server and talking to the terminal server via TCP sockets is probably the best approach. |Is there a way I can configure NVT to prevent it from messing |with my data. The behavior you've described above is how NVT is supposed to work. If you want to keep on using NVT, then your code should take that into account. Alternatively, you should be able to configure the terminal server NOT to use TELNET NVT, but instead to use raw TCP (aka "stream"), which will cause the data transmitted over the serial line to be passed as-is over the TCP connection. Most terminal servers - certainly Cisco ones - provide for a way to configure a TCP connection to a serial port in this manner. I've heard that DECserver 700s *don't* support raw TCP; you might ask Digital whether they have software that supports this. If they don't, you'll either have to swap out your terminal server or else modify your application to talk NVT. Another thought: if you're running MultiNet/VMS, you can set up a TELNET terminal device (NTY) to handle the I/O to/from the terminal server. The NTY (if using a temporary NTY, not a permanent one) will handle the TELNET negotiations and IACs, and so should spare your application the problem of having to worry about that stuff. See ftp://public.tgv.cisco.com/aaron/hll_nty/ for sample code. If you're using a different TCP/IP stack, you might want to check to see whether it provides for a similar facility. Regards, Aaron Aaron Leonard aaron@cisco.com [ work ] Aaron@Leonard.Tucson.AZ.US [ home ]