A firewall acts as an intermediary between the protected network and the unsecure network (usually the internet). It takes requests from the computers on the protected side, remembers which computer asked for what, then moves those requests to the 'net. When the replies come form the 'net, the firewall redirects those to the requesting computers.
While doing this, it can scan the data for malware, filter out undesirable content, and even regulate bandwidth, depending on the software used and options set.
Firewalls can handle UDP.
I use Smoothwall Express 3.0
running on a P4 with 768MB RAM, running CLAMAV and Dansguardian content filtering.