Serial transport over raw sockets
Serial transport over raw sockets provides the capability of transporting serial data, in the form of characters, over an IP transport service within a Layer 3 IP/MPLS VPRN service. A raw socket allows direct sending and receiving of IP packets without any protocol-specific transport layer formatting. For information about raw socket IP transport services, see "Raw socket IP transport service" in the 7705 SAR-Hm and SAR-Hmc Main Configuration Guide.
The feature provides the functionality for a local host to listen to and open raw socket sessions from remote hosts, and for a remote host to initiate and open raw socket sessions to local hosts. The local and remote host functions support TCP or UDP sessions (but not both concurrently) over the IP transport service.
Raw sockets are supported for RS-232 ports on the node.
Serial transport over raw socket application shows an example of a raw socket application, where serial data is transferred between RTUs and a utility's SCADA management system using an IP transport service across a Layer 3 VPRN service that includes 7705 SAR-Hm and 7705 SAR-8/7705 SAR-18 nodes.
A raw socket local host (acting as a server) at the 7705 SAR-Hm substation listens to TCP sessions that originate at the 7705 SAR-8 or 7705 SAR-18 central location network operations center (NOC). The 7705 SAR-8 or 7705 SAR-18 at the NOC is connected to two front-end processors (FEPs), one via a serial port and another via an Ethernet port. The serial port on the 7705 SAR-8 or 7705 SAR-18 is configured as a remote host (acting as a client) that initiates TCP/UDP sessions toward the RTU at the 7705 SAR-Hm substation when traffic is received from the FEP over the serial port. These TCP/UDP sessions are transported over the IP/MPLS network using IP transport service over a VPRN service. The serial data transported over the TCP/UDP session and received at the 7705 SAR-Hm is then sent over the serial link toward the RTU. TCP/UDP sessions received from the FEP over the Ethernet port are transported over a VPRN service (that is, there is no need for serial port remote host configuration in this case).
Multiple FEPs can poll a single RTU. If multiple sessions attempt to transmit serial data on the serial port simultaneously, the 7705 SAR-Hm queues packets per session and ensures that all data for one session is sent out before processing another session's data, ensuring that sessions do not overlap one another.
![](graphics/ti028013.png)
Raw socket configuration
A raw socket IP transport interface can be configured for each RS-232 serial port on a node. This allows the serial port to receive TCP connections or UDP session packets from multiple remote hosts, or to create new sessions to remote hosts in order to send and receive serial data to and from those remote hosts.
There are port-level and service-level configuration requirements for a raw socket serial port to send and receive serial data in either server mode, client mode, or both modes.
Raw socket port-level configuration includes defining the end of packet checking parameters (idle time, length, special character) and the inter-session delay for transmitting session data over the serial link.
At the service level, an IP transport subservice is created within a VPRN service to associate the serial port with the VPRN service. TCP/UDP encapsulated serial data is routed within the corresponding Layer 3 VPRN service. The required configuration includes IP transport subservice local host and remote host configuration, TCP timers, and session control.
See Serial raw socket interface configuration commands for information about the required port-level configuration. For information about how the IP transport subservice operates within a VPRN service, as well as information about the required system-level configuration, see "Raw socket IP transport service" in the 7705 SAR-Hm and SAR-Hmc Main Configuration Guide.
Raw socket packet processing
Raw socket packet processing illustrates how raw socket packets are processed over a serial link.
Session data attempting to access the serial port is queued. One queue is maintained per session. The purpose of the session queue is to prevent two different flows of packets from interleaving out the serial port and creating unreadable messages. When data is being transmitted over the serial link for a session, any other session's data is queued until the first session has emptied its queue. The next session's data is transmitted over the serial link only after the inter-session-delay timer expires. Each session's data is sent out in round-robin fashion.
![](graphics/ti028011.png)
Raw socket processing for UDP sessions
When the local host receives a UDP packet from a remote host, it queues the packet and sends it over the serial link. The local host remembers the UDP session while there is still data to send from the serial link. If further packets are received for the same session, they are queued behind the already queued packet. After all the queued data has been sent over the serial link, the session is removed from the system. An associated UDP remote host for the serial link must be configured to have serial data sent back to the remote host from the serial port.
When a packet is received from the serial link based on end-of-packet (EOP) requirements, the data is copied and sent in a UDP packet to each configured remote host.
Raw socket processing for TCP sessions
An open TCP session from a remote host to a raw socket's local host is kept open until either the remote host terminates the session or the TCP inactivity timer expires. When a TCP session is open, all packets received from the remote host are queued for the raw socket serial link and sent over the serial link until no packets remain in the queue. If multiple sessions are open toward the local host, and each is receiving data, then each session's data is queued and then sent over the serial link in round-robin fashion for each session until no packets remain. When a packet is received over the serial link, it is copied to each open TCP session and transmitted to the remote host.
Raw socket squelch functionality
A condition may occur where the end device connected to the serial port continues to send out a continuous stream of data after the normal response period has expired. This can prevent the far-end remote host or master equipment from receiving data from other end devices in the network. To resolve this condition, the squelch command can be used on the raw socket at the port level (it is disabled by default). This stops the socket from receiving any more data from the problematic device.
If the command is enabled, the node will monitor the serial port for a constant character stream. A configurable squelch delay period, using the squelch-delay command, is used to determine how long to measure the constant character stream before initiating the squelch function. If the squelch function is initiated, the port is considered locked up and an alarm is raised indicating the lock-up and that the squelching function has been triggered.
The serial port can be forced out of squelch and put back to normal, either manually using the squelch-reset command or automatically using the unsquelch-delay command. The unsquelch-delay command defines the time to wait after squelch is initiated before it is removed.