OT RE: [aprssig] Loopback 127.0.0.1

Dave Baxter dave at emv.co.uk
Wed Apr 2 04:15:54 EDT 2008


But take care with port assignments!

Often if you open a port to listen on, it'll accept a connection from
outside the PC, not just via the local loopback address.

Depending on the programming package you use, it should have functions
available to "Bind" what you're doing, to one or many of the machines
available IP addresses...   If not, there should be tools available on
the web, often for free.

For example, this PC, as well as the 127.0.0.1 "localhost" address, also
has 192.168.16.x, assigned by the local DHCP server on the LAN, a
similar address for the WiFi adapter, also assigned by the local DHCP.
And a 5.x.x.x address, as part of the Hamachi VPN software I use.

Just creating a listening port, will by default accept incoming
connections from all of them if you are not careful about what interface
you bind it to.

On a PC (and most Linux machines) use the command line command "ipconfig
-all" (no quotes) to see what active interfaces and addresses your
machine has, and "net stat -an" (again, no quotes) to see what ports are
active, open, waiting etc, and what addresses they are present on.

For users of WinXP (and maybe Vista?)  You can use "netstat -anb" and
also find what process is using what port, but it takes quite a time to
run, thoug is *Very* useful to track down errant processes hogging your
network....

For an application or client to connect to a listening port, all you
need is the destination IP address, as well as the port and protocol, so
long as it's reachable, and able to accept connections, it'll connect.
What happens after that, is down to what the software at each end of the
link does, so long as there are no content filtering proxy/firewall's
etc in the way....

As Scott says, there are lots of common applications that communicate
between various parts of themselves, via the "Localhost" address and
TCP/IP.

This site http://www.iana.org/assignments/port-numbers has a
comprehensive list of known port numbers and typical usage.  Avoid the
common ones at least, and preferably (unless you are for example making
a Telnet or web server type of thing, but note the "alternative" ports
for some common apps' and protocols) use a unique port at or above
49152, then you can to what you want and be much less likely to "P" off
anyone if your stuff "gets out" past your router.  Also, you'll be much
less likely to get any "unexpected vistors".  Sad to say, that the
common low port numbers are often agressivly probed from the web, by who
knows how may script kiddies or spambots for whatever purpose.   If your
writing your own low level code, make sure you don't open up any buffer
overun problems..  Take care with those pointer types!!

All the best..

Dave G0WBX.





> -----Original Message-----
> From: Scott Miller [mailto:scott at opentrac.org] 
> Sent: Tuesday, April 01, 2008 2:49 PM
> To: TAPR APRS Mailing List
> Subject: Re: [aprssig] Loopback 127.0.0.1
> 
> You can talk to yourself on 127.0.0.1.  Lots of stuff does that.
> 
> Scott
> N1VG
> 
> Andrew Rich wrote:
> > Gudday
> >  
> > What happens if I aim data at 127.0.0.1 from a perl script.
> >  
> > Then fire up a service listening on 127.0.0.1
> >  
> > Can you use this address as a data multiplexer ?
> >  
> > Andrew Vk4TEC
This mail has been scanned by Palmer Cook Computer Services Limited.  www.palmercook.co.uk



More information about the aprssig mailing list