Layers of Security
There are various layers of a security system. First, there is the physical layer. This refers to the actual hardware. When a system is firewalled physically, there is no connection with outside networks. While this method can be very effective, it is limiting and not as flexible or fast as other methods. The second kind of firewall layer is the application type. This is at the software level where bits of code determine what kind of information is passing through. This filtering is done via a process known as packet filtering.
There are two types of Internet Protocol (IP) traffic: Transmission Control Protocol (TCP) & User Datagram Protocol (UDP). TCP is connection based, while UDP is connectionless. These protocols send information over the internet, and when they reach a computer, the protocol looks at the information and decides what to do with it. This is when the firewall filters the information packets that are at the right stage of the connection. Using something called stateful inspection, a firewall will determine if the information is appropriate for your computer or network to process.
Read more: need of firewall in network security