this invention relates to a method and apparatus for filtering network packets . the method comprises a method of filtering a packet in a packet switched network in which two complementary packets are transmitted in opposite directions between a particular source and a particular destination comprising the steps of : a ) selecting a complementary portion of the source and destination address of said packet ; b ) performing a commutative operation on said complementary portion ; and c ) processing or discarding the packet in dependence upon the results of said commutative operation .