Is the "trick" that the kernel makes packets destined *for* 127.0.0.0/8
appear to have come *from* 127.0.0.0/8??  I guess you couldn't
have sending and receiving ports be the same then because
then an app would be sending something to *itself* right??  That
wouldn't make sense right?

It doesn't have to be that way, but that usually depends on the client author, and sometimes (but RARELY) on some fancy routing table magic by an SA.


In almost all cases, the client binds to source address 0.0.0.0
This tells the kernel "I don't care what my source is, you pick one"
The kernel then usually picks the address of the NIC that the packet is about to go out on as the address to put in the source. So if you are sending to 127.0.0.1, you typically see the source as 127.0.0.1


Ping has a flag (-I IIRC) to tell it bind to a particular source address.

The other routing magic that an SA can do is either to use multiple routing tables (in case you didn't know, Linux has the ability to have 32k routing tables, but most people just use 1 :) and/or SNAT rules to force the source IP address to something other than what the kernel would normally decide.

I'm trying to understand what loopback interface is used for
and /how/ it is works.

Anyone got any examples of how an app uses loopback interface
effectively??

I vaguely know it acts like a remote node without
actually being one.  I'd like the details.

Think of it as a network card, where the TX ethernet pair "loopback" and connect to the RX ethernet pair. Then you can talk ethernet to yourself (and if you can talk ethernet, you can talk IP, TCP, UDP and so on and so forth)

Now instead of actually wasting a PCI slot and plugging in a real NIC and a
little RJ-45 adapter that does this wiring trick (which prolly would work
BTW), you have a fake device that does it all for you.

-- Michael O'Keefe | [EMAIL PROTECTED] Live on and Ride a 03 BMW F650GSDakar| [EMAIL PROTECTED] / | I like less more or less less than |Work:+1 858 845 3514 / | more. UNIX-live it,love it,fork() it |Fax :+1 858 845 2652 /_p_| My views are MINE ALONE, blah, blah, |Home:+1 760 788 1296 \`O'| blah, yackety yack - don't come back |Fax :+1 858 _/_\|_,

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to