Firewall on iPhone/iOS (ipfw or pf)
It seems "simple", but ipfw (or pf) require support directly within the kernel. That means Apple has to compile the iOS kernel to support those particular utilities and their required protocols (ipfw is a front end for ipfw and dummynet, the latter of which does the bandwidth shaping).

Firewall software (like ipfw) in Unix based systems run at the kernel layer (deep) and cannot be added unless the kernel itself supports them. OS X supports ipfw/pf but iOS does not. Apple has gone through great lengths to secure the OS and likely feels it an unnecessary addition (it's not that Apple has turned them off, they simply do not exist so no conf configurations will aid you). This is why you receive the protocol error. While iOS can run the program, ipfw cannot negotiate the required protocols because they simply do not exist. 

At best, your only option is to find a firewall that runs atop the kernel, so in userspace (like Little Snitch on OS X for example).