5405 Morehouse Drive, Ste 350 San Diego, CA 92121 858.558.0293 phone 858.558.8549 fax Serial Tunneling with the SBL2e Date: September 18, 2009 Introduction By using two SBL2e devices you can create a “serial tunnel” that enables two serial devices to communicate over an IP network, even if both of your serial devices have no network capabilities. The IP connection between the two SBL2e devices will be transparent to the serial devices. A common configuration is shown below. The “Serial” connection can be TTL, or with the addition of external level shifters, RS-232, RS-422 or RS-485. The SBL2e Adapter board that comes with the EVAL-SBL2e-KIT has example hardware designs for adding the level shifters. Serial Device Serial Ethernet Internet or LAN Ethernet Serial Serial Device An easy way to test a RS-232 configuration is to purchase two SBL2e development kits, and use the SBL2e adapter board’s RS-232 level shifted DB9 connections to your RS-232 device. Software Configuration Serial tunneling is usually done using TCP, but you can use UDP as well. When using TCP, the SBL2e Serial-to-Ethernet application can be configured to be a TCP Server or a TCP Client. • TCP Server mode (default): The SBL2e will wait for incoming TCP connections. Once a connection has been made, serial and network data can flow in both directions. • TCP Client mode: The SBL2e create an outgoing TCP connection to a TCP server. You can choose to have the connection made at power-up, which keeps a TCP connection active at all times. Or, you can choose to have a TCP connection only when serial data is available (ie. serial data is received by the SBL2e serial port). To enable serial tunneling, you need to: • Configure one SBL2e as a Server, and the other as a Client. An analogy would be a telephone call. One device (the Client) needs to “call” the other device who is listening for the call (the Server). • Specify the device name or IP Address of the Server in the Client configuration TCP Server Configuration Use your web browser to access the web server of your NetBurner device that will be the Server. If you do not know the IP address, run the NetBurner IPSetup utility to determine what it is, then type the IP address into the URL field of your web browser. The server mode is the default, so we just need to verify the settings on the Network page. Please refer to the screen shot below for the following settings: IP Settings: The settings were received from a DHCP Server. You will probably want to use static IP settings at some point so the IP address of the server will not change. Incoming TCP Settings: The Listen checkbox is checked, and the listen port numbers are the default values of 23 (telnet) and 24. You can change the port numbers if you wish, but you will need to make sure they match the Client settings. Outgoing TCP Settings: The “Make outgoing connections” option should be set to “Never”. TCP Client Configuration Use your web browser to access the web server of your NetBurner device that will be the Client. If you do not know the IP address, run the NetBurner IPSetup utility to determine what it is, then type the IP address into the URL field of your web browser. If you make any changes, be sure to click on the “Submit New Settings” button at the bottom of the web page. IP Settings: The settings were received from a DHCP Server. Incoming TCP Settings: The Listen checkbox for Port 0 is unchecked, because the Client will make an outgoing connection to this port. Outgoing TCP Settings: The “Make outgoing connections” option is set to “On Power-up”. The “Connect on network port” is set to 23 so it matches the Port 0 listen port number of the Server. The “Connect/Send to this address” field is set to the IP address of the Server. Troubleshooting Once you have completed the software configuration, a simple test is to run two instances of the MTTTY program on one computer with two serial ports. Any characters you type in one window should be sent to the other. If you are sure that everything is configured correctly but the devices are not connecting you can verify each device as follows: 1. On your PC, open a command prompt window and one instance of MTTTY. 2. Take the first SBL2e, access it’s web page, and configure the device as a Server (Listener). Disable any Outgoing Connection settings. Or, you can use the “Reset” button to reset to factory defaults. 3. Telnet to the SBL2e and verify you can send/receive data between the telnet session and the MTTTY session. 4. Repeat this procedure for the second SBL2e device. 5. If both devices operate properly, then the issue is with the Client settings for an Outgoing connection. Try reconfiguring the SBL2e you are using for the Client as described in the application note.