# Loopback

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Loopback
> Markdown URL: https://mediated.wiki/source/Loopback.md
> Source: https://en.wikipedia.org/wiki/Loopback
> Source revision: 1323243237
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Routing of signals back to their source

For other uses, see [Loop line](/source/Loop_line_(disambiguation)).

This article needs more citations. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Loopback" – news · newspapers · books · scholar · JSTOR (August 2020) (Learn how and when to remove this message)

**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. Any message transmitted by such a [channel](/source/Communication_channel) is immediately and only received by that same channel. In telecommunications, loopback devices perform [transmission](/source/Transmission_(telecommunications)) tests of [access](/source/Access_network) lines from the serving [switching center](/source/Switching_center), which usually does not require the assistance of personnel at the served [terminal](/source/Terminal_(telecommunication)). [Loop around](/source/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](/source/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](/source/Modem)) 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](/source/Telecommunications), 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](/source/Data_communication) 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](/source/Modem) or [transceiver](/source/Transceiver) 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](/source/Telecommunication_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](/source/X.21), this is typically done by simply connecting the pins together in the connector. Media such as [optical fiber](/source/Optical_fiber) or [coaxial cable](/source/Coaxial_cable), which have separate transmit and receive connectors, can simply be looped together with a single strand of the appropriate medium.

A [modem](/source/Modem) can be configured to loop incoming signals from either the remote modem or the local [terminal](/source/Terminal_(telecommunication)). This is referred to as loopback or software loop.

## Serial interfaces

A serial communications [transceiver](/source/Transceiver) 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](/source/Bit_Error_Rate_Test)*). 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](/source/RS-232) interface using [D-subminiature](/source/D-subminiature) DE-9 or DB-25 connectors.

## Virtual loopback interface

"Loopback address" redirects here. For reserved loopback hostname, see [localhost](/source/Localhost).

Implementations of the [Internet protocol suite](/source/Internet_protocol_suite) include a [virtual network interface](/source/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](/source/Network_interface_controller). 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](/source/Unix-like) systems usually name this loopback interface lo or lo0.

Various [Internet Engineering Task Force](/source/Internet_Engineering_Task_Force) (IETF) standards reserve the IPv4 address block *127.0.0.0/8*, in [CIDR notation](/source/CIDR_notation) and the IPv6 address *::1/128* for this purpose. The most common IPv4 address used is *127.0.0.1*. Commonly these loopback addresses are mapped to the hostnames *[localhost](/source/Localhost)* or *loopback*.

### MPLS

An exceptional (non-loopback) use of *127.0.0.0/8* network addresses is in [Multiprotocol Label Switching](/source/Multiprotocol_Label_Switching) (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](/source/Datagram) 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 packets](/source/Martian_packet).[1] As with other bogus packets, they may be malicious and any problems they might cause can be avoided by applying [bogon filtering](/source/Bogon_filtering).

### 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 protocols](/source/Routing_protocol), 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](/source/Open_Sound_System) (OSS), [Advanced Linux Sound Architecture](/source/Advanced_Linux_Sound_Architecture) (ALSA) and [PulseAudio](/source/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](/source/Feedback)

- [Loop device](/source/Loop_device)

- [Virtual network interface](/source/Virtual_network_interface)

## References

1. **[^](#cite_ref-1)** Raymond, Eric S. ["The Jargon File"](http://www.catb.org/~esr/jargon/html/M/martian.html). [Archived](https://web.archive.org/web/20201106220734/http://www.catb.org/~esr/jargon/html/M/martian.html) from the original on 2020-11-06. Retrieved 2004-06-23.

- This article incorporates [public domain material](/source/Copyright_status_of_works_by_the_federal_government_of_the_United_States) from [*Federal Standard 1037C*](https://web.archive.org/web/20220122224547/https://www.its.bldrdoc.gov/fs-1037/fs-1037c.htm). [General Services Administration](/source/General_Services_Administration). Archived from [the original](https://www.its.bldrdoc.gov/fs-1037/fs-1037c.htm) on 2022-01-22. (in support of [MIL-STD-188](/source/MIL-STD-188)).

## External links

- [National Instruments: Serial loopback testing](http://www.ni.com/white-paper/3450/en)

---
Adapted from the Wikipedia article [Loopback](https://en.wikipedia.org/wiki/Loopback) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Loopback?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
