So what is a firewall?

In a building, a firewall is a specially-built wall that protects the rest of the building in the event of a fire, by preventing the fire from spreading. Network firewalls follow the same principle: they keep the 'flames' of the Internet out where they belong, protecting your assets (be they CPU cycles, disk space or next year's Nobel Prize-winning nuclear formulae). Firewalls act as a protective barrier between your private network and the rest of the world.

Why would I want a firewall?

One of the simplest reasons for wanting a firewall is this: you and your roommate have an apartment, and you decide to create a LAN (Local Area Network) with your computers so that you can play networked SimCity when the need strikes. Since you're already sharing everything else and you only have the one phone line, you get out your old 486, slap Linux on it, and use it to dial into the outside world. Unless you're a fortunate person, you won't have dedicated IP addresses for your machine, the dialup machine, and your roommate's machine, so you decide to use one of the unroutable address spaces[1]. Now that little dialup box has to translate every address on the way out, and since it does, you decide it would be handy to have it configured to keep other people out--wouldn't want them stealing your top secret SimCity designs!--and hey, presto! You now have a need for a firewall: a box that will deal with the outside Internet for you, and exchange your data in a safe manner with the rest of the world. Note that 'safe' here also means 'not broken'--that's where the address translation portion comes in.

OK, why wouldn't I want a firewall?

In short, if it's got nothing to do. If you have one machine, your workstation at home, that dials up to your ISP and that's the only machine connecting to the outside world at one time from your location, you probably don't need a firewall--you can implement all the security you need on that box directly without the need for adding an intermediary. That applies as well if you have a workstation on your desk in your office: you don't need a firewall in your cubicle between you and the rest of the network, but your network itself should have a firewall to protect all those hosts.

So you want to own a firewall

There are two basic kinds of firewalls: Packet-Filtering, and Proxying. They evolved from two slightly different, yet very similar ways of ways of approaching network security. Let's look at each one for a moment: