Complete the sentence to define a firewall.
A firewall is a network security device that monitors and controls incoming and outgoing network traffic based on [1] rules.
The correct term is filtering rules because firewalls filter traffic to allow or block data packets.
Complete the sentence to explain packet filtering.
Packet filtering works by inspecting packets and deciding to allow or block them based on [1] such as IP addresses and ports.
Packet filtering uses criteria like IP addresses and ports to decide whether to allow or block packets.
Fix the error in the sentence about firewall types.
A [1] firewall filters traffic based on packet header information only, without inspecting the packet content.A stateless firewall filters packets only by header information and does not track connection state.
Fill both blanks to describe how a stateful firewall works.
A stateful firewall keeps track of [1] and uses this information to [2] packets more accurately.
Stateful firewalls track connection states and use this to filter packets more accurately than stateless firewalls.
Fill all three blanks to complete the dictionary comprehension filtering packets by port and protocol.
filtered_packets = {pkt[1]: pkt for pkt in packets if pkt['port'] [2] 80 and pkt['protocol'] == [3]The comprehension uses pkt['id'] as keys, filters packets where port == 80, and protocol is 'TCP'.