Network Stuff

From Wikifications
Revision as of 20:05, 30 December 2005 by Dre (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

AS / Routing Reserach

For instructions on how to find the discrete routes into a network, check out http://cybercon.com/backbone.html.

telnet://route-server.ip.att.net: Use this to find AS numbers.

Subnet Calculator

BGP Regexp (replace 714 in the URL with AS number)

ARIN whois

Networks I have researched:

The Planet

Apple Network Info

Speakeasy

Misc

TCP Timeouts

If your long / idle tcp connections are getting timed out by annoying network hardware, try the following. This should go in /etc/sysctl.conf. If necessary, create it and chown it to root.

net.inet.tcp.always_keepalive=1
net.inet.tcp.keepidle=18000
Xinetd, ssh and netcat

http://cg.scs.carleton.ca/~morin/misc/laptopmail/

service pop3 
{ 
        disable         = no 
        socket_type     = stream 
        protocol        = tcp 
        wait            = no 
        user            = mikeash 
        server          = /usr/bin/ssh 
        server_args     = -C -T mikeash.com nc mikeash.com 110 
        groups          = yes 
        bind            = 127.0.0.1 
}
Streaming your iTunes music remotely

There are several articles out there on ye ol' intarweb about this, but here's my solution. The executive overwiew:

Use Network Beacon on the client to advertise the music sharing service of your mac at home via Bonjour so that your local iTunes will see it, and use an SSH tunnel to make the client's request appear local to the server's subnet. WAP enabled first to market link farm TQM E2E OMGLOLWTFBBQ

The ingredients:

  • Two OS X machines, a client (where you listen to music) and a server (where the tunes are stored)
  • On the server, either a public IP or the ability to map inbound ports
  • Network Beacon on the client

Configure the server

  1. Launch iTunes and turn on music sharing
  2. Verify that Remote Login is enabled in the Sharing preference pane
  3. If you have a public IP, proceed to the next section. If not, map port 22 on your firewall to the server so that the SSH tunnel has somewhere to attach. It's probably possible to attach the SSH tunnel to another machine on the same lan / same IP subnet; as long as the iTunes server thinks you are local, it should be all good.

Configure the client

  1. Create the SSH tunnel as follows:
    ssh -L 4242:idio.dreness.com:3689 -f -N andre@idio.dreness.com

    The breakdown:

    • 4242 is the entry port of the local endpoint of the tunnel, implicitely created on localhost (i.e. where you go in)
    • idio.dreness.com:3689 is where the traffic goes AFTER EXITING the tunnel - 3689 is the daap port
    • andre@idio.dreness.com defines the remote endpoint of the tunnel.
  2. Verify that the local endpoint of the tunnel is up:
    netstat -na | grep LISTEN
    tcp4       0      0  127.0.0.1.4242         *.*                    LISTEN
    ...

    If it's not, please proceed to my document on SSH tunnels

  3. Launch Network Beacon and configure as follows:
    • Create a new beacon
    • Beacon Enabled = checked
    • Service Name = whatever (will be displayed in the iTunes sources list)
    • Service type = _daap._tcp. (note the trailing period)
    • Port Number = 4242
    • Enable Host Proxy = checked
    • Host Name = localhost
    • IP Address = 127.0.0.1
  4. Launch iTunes and bask in the glory of hearing your tunes from afar. Or don't and curse your inability to press buttons properly.

Extra Credit (tiger only):

Configure an additional SSH listener on the server to which you attach the SSH tunnel, then use ipfw / dummynet to do basic rate limiting on this port (which is only used by iTunes streaming) to keep from saturating your server's upstream.

Useful if:

  • you also have regular SSH sessions over the same link that's carrying your tunes
  • your server has enough upstream to make this work, but not enough that the stream won't burst to saturate it occasionally