COM port redirector
Encyclopedia
A COM port redirector is a specialized software (often including device driver and user application) that includes the underlying network software necessary to access networked device servers that provide remote serial
Serial communication
In telecommunication and computer science, serial communication is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. This is in contrast to parallel communication, where several bits are sent as a whole, on a link with several parallel channels...

 devices or modem
Modem
A modem is a device that modulates an analog carrier signal to encode digital information, and also demodulates such a carrier signal to decode the transmitted information. The goal is to produce a signal that can be transmitted easily and decoded to reproduce the original digital data...

s.

Overview

The purpose of the redirector is to make the virtual COM port exhibit behavior that closely resembles that of a "real" COM port, i.e., a COM port driver for local serial port
Serial port
In computing, a serial port is a serial communication physical interface through which information transfers in or out one bit at a time...

 hardware. A virtual COM port itself is a relatively simple software mechanism that can be implemented by driver software similar to that of a conventional COM port driver. The main challenges arise in two other areas: the network connection to the device server and the behavior of the device server. These issues are described in the Technology section below.

Applications use a COM port redirector through one or more virtual COM ports that the redirector creates, as configured by the user. When the application opens the virtual COM port, the redirector makes an IP
Internet Protocol
The Internet Protocol is the principal communications protocol used for relaying datagrams across an internetwork using the Internet Protocol Suite...

 network connection to the device server at the specified IP address and TCP/UDP port number that corresponds to the remote device on the server. The COM port redirector then begins relaying the application data stream between the virtual COM port and the device server.

A redirector will typically permit creation of many (at least 256) virtual COM ports, but simultaneous use of hundreds of ports is often practically limited by a number of factors, including the memory and processor requirements of the redirector, limits on operating system resources, and the performance of the network stack.

A redirector for the Windows operating system is typically configured using a control-panel style graphical user interface for creating virtual COM ports, configuring settings for individual COM ports, and configuring global settings affecting all COM ports. The redirector GUI typically also includes displays of virtual COM port activity and various diagnostic aids.

The performance of a COM port redirector is determined by both its implementation and the network it uses to reach device servers. The performance drawbacks of simple redirector implementations can be largely addressed by kernel-level drivers that avoid context switches. Network packet loss or excessive packet times have dramatic effects on redirector operation and must be avoided.

COM port redirector software products have been offered by at least 30 vendors dating back to the early 1990s. Compatible networked device servers are currently available from a large number of manufacturers, with a heavy concentration of revenue in the top players, who are based in the North America and Asia/Pacific regions.

The equivalent software for a Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

/Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 operating system is commonly called a tty port redirector and most of the information on this page also applies to it.

Redirectors address a number of issues related to the network connection, including:
  • Network protocol support that is compatible with the device server.

Most device servers are accessed with TCP
Transmission Control Protocol
The Transmission Control Protocol is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite, complementing the Internet Protocol , and therefore the entire suite is commonly referred to as TCP/IP...

 connections (raw or using the Telnet protocol) to gain reliable delivery of the application's data stream in order of transmission. The majority of server manufacturers use public TCP protocols (raw, Telnet, or Telnet with RFC 2217 extensions). Several of the larger server manufacturers use proprietary protocols in addition to, or instead of, public protocols. Device servers for certain applications, such as those that use wireless networks, use UDP
User Datagram Protocol
The User Datagram Protocol is one of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol network without requiring...

 instead of TCP to gain performance at the risk of network reliability.

  • Initiating the network connection to a device server and determining that server is ready to relay application data.

  • Accepting inbound connections initiated by device servers running in client mode and routing the data stream to a waiting application.

  • Flow control of the network data stream to prevent overrun of the server. (This is not the same as hardware/software flow control of the serial device itself.)

  • Data rate limiting of the application data stream to provide the performance expected for the baud rate currently in effect on the virtual COM port, which is slower than the maximum speed of the network connection to the server.

  • The timing effects of the TCP protocol stack, e.g. network packetization and the Nagle algorithm.

  • Network connections through proxy server
    Proxy server
    In computer networks, a proxy server is a server that acts as an intermediary for requests from clients seeking resources from other servers. A client connects to the proxy server, requesting some service, such as a file, connection, web page, or other resource available from a different server...

    s.

  • Management of the IP routing table
    Routing table
    In computer networking a routing table, or Routing Information Base , is a data table stored in a router or a networked computer that lists the routes to particular network destinations, and in some cases, metrics associated with those routes. The routing table contains information about the...

     to avoid loss of an IP route to the device server.

  • Detection and handling of network interruptions, possibly with an automatic attempt to reconnect to the device server to resume application data flow.


Redirectors must also deal with the feature differences of networked device servers related to:
  • Visibility and control of serial line signals such as DSR, DCD, CTS, DTR. The redirector may be able to sufficiently emulate these signals.

  • Relay of BREAK signals.

  • Settings for hardware or software flow control.

  • Handling of the network connection when serial devices or modems disconnect.

Variants

Specialized types of redirectors have been offered to meet the needs of certain applications.

A redirector may support back-to-back operation, in which two computers run copies of the redirector and an outbound connection from one results in an inbound connection to the other. In effect, this technique creates a serial communications tunnel through a network connection. In practice, this configuration works only for certain applications but offers potentially lower costs and higher performance using the Internet to carry serial communications instead of modems between two computers.

A redirector may include a modem emulator that allows the application to use "AT" modem commands even though no physical modem is present. The "number" dialed is an IP address, and the connection is a TCP network connection instead of a modem telephone call. This type of redirector is generally used by applications in originating client software needs to use a modem but the destination for the connection is a network endpoint. Back-to-back operation of this type of redirector can, in some cases, function as a replacement for modems on two computers for some applications. Network effects on timing of the data stream generally preclude the use of this method for transmitting faxes. Additionally, this method is also not reliable if used for PPP
Point-to-Point Protocol
In networking, the Point-to-Point Protocol is a data link protocol commonly used in establishing a direct connection between two networking nodes...

 connections (such as dial-up networking) due to architectural limitations of the TCP protocol, a topic discussed in technical literature related to TCP-over-TCP.

Virtual Serial Port

One variant of a COM port redirector is a Virtual Serial Port. A virtual serial port is a redirector without network software support which is usually used to create a pair of back-to-back virtual COM ports on the same computer. Two legacy applications can then communicate using virtual serial ports instead of conventional inter-process communication
Inter-process communication
In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...

 mechanisms such as named pipe
Named pipe
In computing, a named pipe is an extension to the traditional pipe concept on Unix and Unix-like systems, and is one of the methods of inter-process communication. The concept is also found in Microsoft Windows, although the semantics differ substantially...

s.

This type of software is capable of emulating all serial port functionality, including Baud rate
Baud
In telecommunications and electronics, baud is synonymous to symbols per second or pulses per second. It is the unit of symbol rate, also known as baud rate or modulation rate; the number of distinct symbol changes made to the transmission medium per second in a digitally modulated signal or a...

, Data bits, Parity bits, Stop bits, etc. Additionally it allows the data flow to be controlled, emulating all signal lines (DTR/DSR/CTS/RTS/DCD/RI) and customizing pinout.

Serial port emulation

  • Serial port emulation is useful especially when there is a lack of available physical serial ports. Communication between software and/or devices which would otherwise require extra physical connections, can be benefited by using a virtual COM Port emulator.

  • Virtual serial ports lets you send or receive data over a TCP/IP port using any serial communication program. This facility allows creating a full-fledged client-server architecture which provides multiple connections and data sharing possibilities between different applications. Such a connection is the best way to allow use of rare and expensive serial devices by different users simultaneously.

  • Using serial port emulation one can split a real COM port between a number of virtual serial ports. This makes it possible to supply data from a single serial device to a number of different applications. Such necessity arises when several applications compete for a single GPS connection and the user must close one program to allow another to access a single GPS device.

  • A virtual serial port may have the same name as physical one. This facility allows real serial port overlapping (mapping) and receiving data from a physical port through virtual port. In other words, you can map any serial port or virtual port to any other existing port in your system. In this case applications will work with virtual ports, but, in fact, they will receive data from overlapped real ports.

Specification

  • RFC 854 - Telnet protocol specification
  • RFC 2217 - COM port control protocol specification

Commercial solutions


Open source solutions

  • com0com Project - virtual serial port tools for Windows: com0com (null modem), com2tcp (COM port to TCP redirector), hub4com (COM port sharing))
  • Multicom for Mac. TTY <-> IP <-> PTY (Serial to TCP to Pseudo-Serial). Verified on Snow Leopard. Also verified multiple instances of app function with each other (in Terminal: Open -na MultiCom OR open -n \Applications\Multicom)
  • netfwd can be used as raw protocol server/client for BSD operating systems (e.g. OpenBSD)
  • remserial acts as a bridge between a TCP/IP network port and a Linux character device (tty for example).
  • ser2sock.c - Mirrors or duplicates the serial data so all connected sockets can see the same serial message (Linux,BSD,...)
  • serproxy also available here
  • socat Project - available in most Linux distros, can link many socket based connections together, including serial ports
  • ser2net daemon allows telnet and tcp sessions to be established with serial ports.
  • termnetd (on Ubuntu Linux) allows TCP/IP <-> /dev/ttyS* connection.

Freeware solutions

  • Free Virtual Serial Ports by HHD Software for Windows Vista and Windows 7 (32bit and 64bit). Free for any purpose.
  • Comfoolery by Brian Poe, originally available here
  • Eterlogic Free Virtual Serial Ports Emulator - 32bit version free for any purpose, can create various virtual serial port devices such as virtual pair, data splitter, Serial to TCP etc. Remark: x64 Version is not Free and 32bit version does not run on x64 systems.
  • HW VSP 3 - Free for personal use, can create a virtual serial port connected to some remote TCP port. Remote end can be socat.
  • HW VSP 2 - Free for personal use. No x64 support yet. (based on Eltima Virtual Serial Port ActiveX!).
  • XPort COM port splitter for Windows XP and Windows Vista - donations requested
  • WIZ VSP - Requires free registration code
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK