what tcp ports can i use?
Ports 1024-49151 are the User Ports and are the ones to use for your own protocols. Ports 49152-65535 are the Dynamic ports and should not be prescribed to a protocol. The User Ports can be used for any protocol, but there are a finite number, so your use will clash with someone elses use on some network somewhere.