added even/odd check to generete protocol based upon incoming port number