Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I wonder it it is tied to my NIC at all or if the OS or driver intercepts and immediately returns data sent to the loopback address?

Do the electrons actually travel to my NIC then the NIC returns them?

share|improve this question
4  
More trivia the entire 127 /8 is dedicated to loop back –  Jacob Feb 11 '11 at 11:33
2  
It would be interesting to see some real-world throughput and/or latency figures for the loopback if anyone has them. –  NPE Feb 11 '11 at 12:25
1  
Even if the electrons travel there, the NIC probably wouldn't return the same electrons :) –  Halil Özgür Oct 6 '11 at 20:31
    
:) yeah i should say signal.. –  user55029 Nov 25 '11 at 0:49
    
there's no place like 127.0.0.1 –  Eric DANNIELOU Dec 5 '12 at 21:08
add comment

7 Answers

up vote 18 down vote accepted

You don't mention a particular OS but for most all that happens is that the data travels down the stack until it gets to IP at which point it's pretty much sent back. That's a massive oversimplification but means that the entire process is usually CPU bound so its performance is therefore directly linked to CPU speed plus stack efficiency. In practical terms modern CPUs and OSs should be able to 'bounce' loopback traffic considerably faster than 40Gbps - which is the fastest NIC I think I'm capable of buying today. Hope this helps.

share|improve this answer
add comment

No all 127.0.0.1 traffic never hits the physical network, it gets processed by a loop back adapter in the kernel.

share|improve this answer
    
so that means super fast right :) –  user55029 Feb 11 '11 at 4:45
    
@Mrk Mnl yes you bet. For my ping 00ms using XAMP 1.7.4 –  Benny Feb 11 '11 at 11:17
8  
any local address never hits the physical network. 127.0.0.1 just one of them –  alvosu Feb 11 '11 at 11:27
    
"hitting the physical network" is a bit ambiguous as it could get to your NIC without being sent and not hit the physical network, anyway if it is returned by the kernel, i.e. the OS, obviously it doesnt get to the NIC. –  user55029 Feb 21 '11 at 7:46
add comment

You may be interested in the Loopback Fast Path feature we added in Windows 8 and Windows Server 2012. I've written a short blog about it here

http://blogs.technet.com/b/wincat/archive/2012/12/05/fast-tcp-loopback-performance-and-low-latency-with-windows-server-2012-tcp-loopback-fast-path.aspx

It also provides an illustration of the path taken by the loopback with and without the optimization

With Best Regards

Ed Briggs Microsoft Corporation

share|improve this answer
add comment

It depends on what OS you're running, but Windows 2000 had a bug in it where requests on the loopback adaptor would be slow. There's some useless trivia for you!

Please see this kb article for more information.

share|improve this answer
add comment

I'd rather say that you find your answer in it's name itself. The name says: "Local Loopback Address", which in itself means that the network never intervenes in the process and the request is in itself looped back locally.

share|improve this answer
    
I was about to post the same when I noticed you beat me to it. Indeed 'loopback address' should give a hint :) –  luis.espinal Feb 11 '11 at 12:35
    
the question was how fast, i know what it does –  user55029 Feb 12 '11 at 8:22
add comment

127.0.0.1 is no faster any other local ip. The local ip fast, because it doesn't use physical device and 2-layers.( It never hits your NIC)

iperf -c 109.191.109.xxx 1111 -t 5
iperf: ignoring extra argument -- 1111
------------------------------------------------------------
Client connecting to 109.191.109.241, TCP port 5001
TCP window size: 49.7 KByte (default)
------------------------------------------------------------
[  3] local 109.191.109.xxx port 32840 connected with 109.191.109.xxx port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 5.0 sec  4.72 GBytes  8.12 Gbits/sec

$ iperf -c 127.0.0.1 1111 -t 5
iperf: ignoring extra argument -- 1111
------------------------------------------------------------
Client connecting to 127.0.0.1, TCP port 5001
TCP window size: 49.7 KByte (default)
------------------------------------------------------------
[  3] local 127.0.0.1 port 56482 connected with 127.0.0.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 5.0 sec  4.62 GBytes  7.94 Gbits/sec
share|improve this answer
2  
There's an awful lot wrong with this answer. It is faster. If you aturate the collision window then the limiting factor will be driven by context switching. –  symcbean Feb 11 '11 at 13:02
add comment

If you are on Linux...

type in "ifconfig -a" as root...

Notice the "interrupt" line on all NICs...notice there is no "interrupt" line on "lo"...that means it does not even have an interrupt assigned to it, so pretty darn fast ;-)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.