When two computers communicate over the Internet they do so using a protocol called TCP/IP. Even a fairly simple web page consists of a number of elements and if you want to see just what makes up the page then open up Safari and go to the Window menu and choose Activity. Opening http://www.apple.com/startpage shows 58 separate elements today coming from a variety of servers, depending on when you are reading this it could be more or less. For your Mac to download all of those elements one at a time the net result would be that the page could take a long time to load, especially if it included a large graphic or movie. It would be better if the Mac could download some, if not all, of those elements at the same time but it needs a way of telling the server which bit to send for each request.
When a Mac talks to a normal web server it does so using TCP port 80 but it requests that the server reply on a different port so that both ends can keep track of the conversation. The return leg will use a randomly selected port number between 49152 and 65535. By tracking which bit of data should be coming back on which port the Mac can request lots of page elements at the same time and make sure that they all go in the right place.
That’s all well and good for traffic going out of your network but what about traffic coming in? If you are running a web server on one of your Macs it will be listening for someone trying to connect to it on port 80. If you are fortunate your router will have a static IP address but the majority of ISPs use dynamic addresses, which will change over time. So the first problem is how will the person wanting to view your web server find you? That can be solved by using a Dynamic DNS service like No-IP (http://www.no-ip.com/ ) or DynDNS ( http://www.dyndns.com/ ) who can provide you with a domain name that gets regularly updated with your router’s current IP address.
The next problem is that whilst your router has an IP address that the rest of the world can see traffic cannot get beyond it because the rest of the world knows nothing about the IP addresses that you actually have on your network so any requests for http://www.example.com will actually be sent to the router, which is probably set up to ignore any requests on port 80 from the outside world for security’s sake.
What we need to do is to tell our router to accept any requests on port 80 and forward them on to the actual computer, which is running our web server. This is done using something that your router may call port mapping, port forwarding or a virtual server.
Setting port forwarding up on the router can be daunting but there are two applications which make life a lot easier Port Map ( http://www.codingmonkeys.de/portmap/index.html ) and Lighthouse ( http://codelaide.com/blog/products/lighthouse ) both of which handle the router configuration for you.
Find similar articles: TCP/IP, Safari, web server, TCP port 80, network, traffic, Apple, router, static IP address, dynamic, DNS, IP address, port map, guided by a guru
![]()