Loopback (also written loop-back) is the routing of electronic signals or digital data streams back to their source without intentional processing or modification. It is primarily a means of testing the communications infrastructure.
Loopback can take the form of communication channels with only one
communication endpoint
A communication endpoint is a type of Node (networking), communication network node. It is an interface exposed by a communicating party or by a communication channel. An example of the latter type of a communication endpoint is a publish–subscr ...
. Any message transmitted by such a
channel is immediately and only received by that same channel. In telecommunications, loopback devices perform
transmission tests of
access
Access may refer to:
Companies and organizations
* ACCESS (Australia), an Australian youth network
* Access (credit card), a former credit card in the United Kingdom
* Access Co., a Japanese software company
* Access International Advisors, a hed ...
lines from the serving
switching center, which usually does not require the assistance of personnel at the served
terminal.
Loop around is a method of testing between stations that are not necessarily adjacent, wherein two lines are used, with the test being done at one station and the two lines are interconnected at the distant station. A
patch cable may also function as loopback, when applied manually or automatically, remotely or locally, facilitating a loop-back test.
Where a system (such as a
modem
The Democratic Movement (, ; MoDem ) is a centre to centre-right political party in France, whose main ideological trends are liberalism and Christian democracy, and that is characterised by a strong pro-Europeanist stance. MoDem was establis ...
) involves round-trip analog-to-digital processing, a distinction is made between analog loopback, where the analog signal is looped back directly, and digital loopback, where the signal is processed in the digital domain before being re-converted to an analog signal and returned to the source.
Telecommunications
In
telecommunications
Telecommunication, often used in its plural form or abbreviated as telecom, is the transmission of information over a distance using electronic means, typically through cables, radio waves, or other communication technologies. These means of ...
, loopback, or a loop, is a hardware or software method which feeds a received signal or data back to the sender. It is used as an aid in debugging physical connection problems. As a test, many
data communication
Data communication, including data transmission and data reception, is the transfer of data, transmitted and received over a point-to-point or point-to-multipoint communication channel. Examples of such channels are copper wires, optic ...
devices can be configured to send specific patterns (such as ''all ones'') on an interface and can detect the reception of this signal on the same port. This is called a loopback test and can be performed within a
modem
The Democratic Movement (, ; MoDem ) is a centre to centre-right political party in France, whose main ideological trends are liberalism and Christian democracy, and that is characterised by a strong pro-Europeanist stance. MoDem was establis ...
or
transceiver
In radio communication, a transceiver is an electronic device which is a combination of a radio ''trans''mitter and a re''ceiver'', hence the name. It can both transmit and receive radio waves using an antenna, for communication purposes. The ...
by connecting its output to its own input. A circuit between two points in different locations may be tested by applying a test signal on the
circuit in one location, and having the network device at the other location send a signal back through the circuit. If this device receives its own signal back, this proves that the circuit is functioning.
A hardware loop is a simple device that physically connects the receiver channel to the transmitter channel. In the case of a network termination connector such as
X.21, this is typically done by simply connecting the pins together in the connector. Media such as
optical fiber
An optical fiber, or optical fibre, is a flexible glass or plastic fiber that can transmit light from one end to the other. Such fibers find wide usage in fiber-optic communications, where they permit transmission over longer distances and at ...
or
coaxial cable
Coaxial cable, or coax (pronounced ), is a type of electrical cable consisting of an inner Electrical conductor, conductor surrounded by a concentric conducting Electromagnetic shielding, shield, with the two separated by a dielectric (Insulat ...
, which have separate transmit and receive connectors, can simply be looped together with a single strand of the appropriate medium.
A
modem
The Democratic Movement (, ; MoDem ) is a centre to centre-right political party in France, whose main ideological trends are liberalism and Christian democracy, and that is characterised by a strong pro-Europeanist stance. MoDem was establis ...
can be configured to loop incoming signals from either the remote modem or the local
terminal. This is referred to as loopback or software loop.
Serial interfaces
A serial communications
transceiver
In radio communication, a transceiver is an electronic device which is a combination of a radio ''trans''mitter and a re''ceiver'', hence the name. It can both transmit and receive radio waves using an antenna, for communication purposes. The ...
can use loopback for testing its functionality. For example, a device's ''transmit'' pin connected to its ''receive'' pin will result in the device receiving exactly what it transmits. Moving this looping connection to the remote end of a cable adds the cable to this test. Moving it to the far end of a modem link extends the test further. This is a common troubleshooting technique and is often combined with a specialized test device that sends specific patterns and counts any errors that come back (see ''
Bit Error Rate Test
In digital transmission, the number of bit errors is the number of received bits of a data stream over a communication channel that have been altered due to noise, interference, distortion or bit synchronization errors.
The bit error rate (B ...
''). Some devices include built-in loopback capability.
A simple serial interface loopback test, called ''paperclip test'', is sometimes used to identify serial ports of a computer and verify operation. It utilizes a terminal emulator application to send characters, with flow control set to off, to the serial port and receive the same back. For this purpose, a paperclip is used to short pin 2 to pin 3 (the receive and transmit pins) on a standard
RS-232 interface using
D-subminiature
The D-subminiature or D-sub is a common type of electrical connector. They are named for their characteristic D-shaped metal shield. When they were introduced, D-subs were among the smallest connectors used on computer systems.
Description ...
DE-9 or DB-25 connectors.
Virtual loopback interface
Implementations of the
Internet protocol suite
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suite are ...
include a
virtual network interface through which network applications can communicate when executing on the same machine. It is implemented entirely within the operating system's networking software and passes no packets to any
network interface controller
A network interface controller (NIC, also known as a network interface card, network adapter, LAN adapter and physical network interface) is a computer hardware component that connects a computer to a computer network.
Early network interface ...
. Any traffic that a computer program sends to a loopback IP address is simply and immediately passed back up the network software stack as if it had been received from another device.
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
systems usually name this loopback interface
lo
or
lo0
.
Various
Internet Engineering Task Force
The Internet Engineering Task Force (IETF) is a standards organization for the Internet standard, Internet and is responsible for the technical standards that make up the Internet protocol suite (TCP/IP). It has no formal membership roster ...
(IETF) standards reserve the IPv4 address block , in
CIDR notation
Classless Inter-Domain Routing (CIDR ) is a method for allocating IP addresses for IP routing. The Internet Engineering Task Force introduced CIDR in 1993 to replace the previous classful network addressing architecture on the Internet. Its goal ...
and the IPv6 address for this purpose. The most common IPv4 address used is . Commonly these loopback addresses are mapped to the hostnames ''
localhost
In computer networking, localhost is a hostname that refers to the current computer used to access it. The name ''localhost'' is reserved for loopback purposes.
It is used to access the network services that are running on the host via t ...
'' or ''loopback''.
MPLS
An exceptional (non-loopback) use of network addresses is in
Multiprotocol Label Switching
Multiprotocol Label Switching (MPLS) is a routing technique in telecommunications networks that directs data from one node to the next based on labels rather than network addresses. Whereas network addresses identify endpoints, the labels iden ...
(MPLS) traceroute error detection, in which their property of not being routable provides a convenient means to avoid delivery of faulty packets to end users.
Martian packets
Any IP
datagram
A datagram is a basic transfer unit associated with a packet-switched network. Datagrams are typically structured in header and payload sections. Datagrams provide a connectionless communication service across a packet-switched network. The de ...
with a source or destination address set to a loopback address must not appear outside of a computing system, or be routed by any routing device. Packets received on an interface with a loopback destination address must be dropped. Such packets are sometimes referred to as
Martian packet
A Martian packet is an IP packet seen on the public Internet that contains a source or destination address that is reserved for special use by the Internet Assigned Numbers Authority (IANA) as defined in , Appendix B Glossary (Martian Address F ...
s.
As with other bogus packets, they may be malicious and any problems they might cause can be avoided by applying
bogon filtering
Bogon filtering is the practice of blocking packets known as bogons, which are ones sent to a computer network claiming to originate from invalid or bogus IP addresses, known as bogon addresses.
Etymology
The term ''bogon'' stems from hacker jarg ...
.
Management interface
Some computer network equipment use the term "loopback" for a virtual interface used for management purposes. Unlike a proper loopback interface, this type of loopback device is not used to talk with itself.
Such an interface is assigned an address that can be accessed from management equipment over a network but is not assigned to any of the physical interfaces on the device. Such a loopback device is also used for management datagrams, such as alarms, originating from the equipment. The property that makes this virtual interface special is that applications that use it will send or receive traffic using the address assigned to the virtual interface as opposed to the address on the physical interface through which the traffic passes.
Loopback interfaces of this sort are often used in the operation of
routing protocol
A routing protocol specifies how routers communicate with each other to distribute information that enables them to select paths between nodes on a computer network. Routers perform the traffic directing functions on the Internet; data packet ...
s, because they have the useful property that, unlike real physical interfaces, they will not go down when a physical port fails.
Other applications
The audio systems
Open Sound System
The Open Sound System (OSS) is an interface for making and capturing sound in Unix and Unix-like operating systems. It is based on standard Unix devices system calls (i.e. POSIX read, write, ioctl, etc.). The term also sometimes refers to ...
(OSS),
Advanced Linux Sound Architecture
Advanced Linux Sound Architecture (ALSA) is a software framework and part of the Linux kernel that provides an application programming interface (API) for sound card device drivers.
Some of the goals of the ALSA project at its inception were ...
(ALSA) and
PulseAudio have loopback modules for recording the audio output of applications for testing purposes. Unlike physical loopbacks, this does not involve double analog/digital conversion and no disruption is caused by hardware malfunctions.
See also
*
Feedback
Feedback occurs when outputs of a system are routed back as inputs as part of a chain of cause and effect that forms a circuit or loop. The system can then be said to ''feed back'' into itself. The notion of cause-and-effect has to be handle ...
*
Loop device
*
Virtual network interface
References
* {{FS1037C MS188
External links
National Instruments: Serial loopback testing
Communication circuits
Internet architecture