To understand how a firewall works, you also need to
understand how a network connection works. Today most
computers use TCP/IP for network communications. TCP/IP is a
communications protocol for formatting and transferring data
within a network. As suggested by its name, TCP/IP is
comprised of two key technologies: Transmission Control
Protocol or TCP and Internet Protocol or IP. IP provides an
address for each network device that permits routing
communication between source and destination. Among other
things, TCP provides port numbers that specify what service
or program the communication is intended for. Port numbers
can be any number from 0 to 65535. Additionally, TCP breaks
up communication transmissions into data segments called
packets.
With each communication, the data package contains the
receiver's IP, the port number of the program or service,
and the status of the connection. This applies to both
incoming and outgoing communications. Although only one wire
connects your computer to the network, that connection can
carry of 65,536 different actions concurrently. Without a
firewall these ports are open, meaning other computers can
send information into any port on your computer and your
computer will respond.