Routers, Firewalls and multilayer servers
Archive - Originally posted on "The Horse's Mouth" - 2009-05-01 20:18:54 - Graham Ellis
Internally, all our machines are on 192.168.200.xxx network but the router re-writes those to our single IP address on output, and for traffic where the client is at our place (that's most traffic such as web browsers and FTP clients) it remembers who has opened which particular connection so that replies can be written back correctly.
Accesses to any servers that we run locally are slightly more problematic; incoming traffic of a particular type can only be routed to one machine ... and indeed we have one machine set up as the default destination for all types of traffic / ports (this machine is known as a DMZ or demilitarised zone) and care needs to be taken of the security on it. Then we make exceptions - the diagram showing how all traffic on TCP port 80 (web service) is routed to our web server, and traffic for printing is routed to a printer.

As well as allowing traffic to be sent to a single machine, this approach also means that the main servers - running Tomcat - can be hidden behind a firewall and the high level of protection only need be applied to the httpd machine.

There are a number of solutions to this issue, including the inclusion of a cookie in the initial response to instruct the user's browser to ask for the same machine next time (we do this in real life - "I was talking to Mavis about it ... can you put me through to her again please"). This diagram shows another approach - how the parallel machines can all co-ordinate via another machine behind them - perhaps running a database such as MySQL, or perhaps even another instance of Tomcat.