What is a firewall



A firewall is a barrier to keep destructive forces away from your network.It is simply a program or hardware device
that filters the information coming through the Internet connection into your private network or computer system.

Firewalls use one or more of three methods to control traffic flowing in and out of the network:

1-Packet filtering

-Packets (small chunks of data) are analyzed against a set of filters. Packets that make it through the filters
are sent to the requesting system and all others are discarded.



How Packet Filters Work



2-Proxy service

- When a client issues a request from the untrusted network, a connection is established with the application
gateway/proxy.The proxy determines if the request is valid (by comparing it to any rules or filters) and then
sends a new request on behalf of the client to the destination.
By using this method, a direct connection is never made from the trusted network to the untrusted network
and the request appears to have originated from the application gateway/proxy.The request is answered in
the same manner

How Proxy Firewalls Work



3-Stateful inspection

-A newer method that doesn't examine the contents of each packet but instead compares certain key parts of the packet
to a database of trusted information.
Information traveling from inside the firewall to the outside is monitored for specific defining characteristics,then incoming
information is compared to these characteristics.
If the comparison yields a reasonable match,the information is allowed through. Otherwise it is discarded.
This method can make decisions based on one or more of the following:
-Source IP address
-Destination IP address
-Protocol type (TCP/UDP)
-Source port
-Destination port
-Connection state

How Stateful Firewalls Work



What a firewall Protects You From  

Resources:

http://www.howstuffworks.com/firewall.htm
http://www.more.net/technical/netserv/tcpip/firewalls/index.html
http://www.syngress.com/solutions
Book : Configuring Checkpoint NGX VPN-1/FIREWALL-1
by Robert Stephens ,Barry J. Stiefel ,Stephen Watkins,Simon Desmeules,Eli Faskha