Answer: D
Correct answer: To control network traffic entering and leaving a system according to rules
A firewall controls traffic crossing a boundary, permitting or blocking it according to a set of rules based on addresses, ports and protocols. It may be hardware, software, or both. The kinds differ in how much they examine. A packet filter looks at each packet in isolation against static rules - fast but crude. A stateful firewall tracks connections, so it can tell a reply to an outgoing request from an unsolicited incoming packet, and is considerably more secure. An application-layer firewall or proxy inspects the content of the traffic itself. What a firewall does not do is remove malware - that is antivirus software, and the second option is the usual confusion. Nor does it help against a threat that arrives by an allowed route, such as a user downloading an infected attachment. It is one layer of defence, not a complete one.