I want to run a custom TCP protocol over a 3G connection for a game. (Amazon server with mobile clients) I decided to use port 80 because hey, it's open. I'm aware that some paranoid ISPs will have stateful / application level firewalls that will reject TCP traffic based on some rules about non-http traffic or something.

How can I avoid firewall filtering on port 80? I know its probably not possible in all cases.

Is there some minimal fake headers I can use in my data stream to satisfy such a gateway?

Are there any other known protocols that the gateway will blindly forward and which I could masquerade as ?

  • To follow up in case it helps anyone: I ended up using a custom binary protocol over port 443. This seemed to satisfy most of the ISP traffic shapers - I haven't gotten any complaints about connectivity.
  • 1
    \$\begingroup\$ Not game dev related. \$\endgroup\$ – MichaelHouse May 14 '13 at 13:46
  • \$\begingroup\$ How is this not game dev related? I'm developing a networked game and this is a problem. \$\endgroup\$ – Chris May 14 '13 at 17:06
  • 4
    \$\begingroup\$ You could be developing a game and your computer won't turn on. That doesn't make it a gamedev related question. Game dev related means: "Would a professional game developer give me a better/different/more specific answer to this question than other programmers?". I don't believe that's the case with this question. You should ask it on Stackoverflow.com \$\endgroup\$ – MichaelHouse May 14 '13 at 17:09
  • 1
    \$\begingroup\$ @Byte56 In fact I did ask on Stackoverflow and haven't gotten any interest. I think a game developer would be more likely to have the answer since mobile games are very widespread and my question is specifically related to mobile networking. \$\endgroup\$ – Chris May 14 '13 at 17:25
  • \$\begingroup\$ OK Chris, it's just my opinion. I think mobile networking is just as common for non-games. \$\endgroup\$ – MichaelHouse May 14 '13 at 17:30

Or why not actually use HTTP as a communication protocol? You could make your application communicate with the server using SOAP.

When you do not want to do this, you could trick most deep packet inspection software by using port 443 (HTTPS, rarely blocked when normal HTTP is allowed) and pretend to do a HTTPS handshake. Whether or not you actually encrypt the traffic, any deep packet inspection software will likely assume that the traffic is securely encrypted and not attempt to analyze it further.

But keep in mind that traffic on port 80 or 443 which doesn't look like typical web browsing is a telltale sign of malware communicating with command&control servers (they use these ports for the same reason you want to). So your software might trigger intrusion detection systems.

  • \$\begingroup\$ I'd like to avoid the overhead of another layer on top of TCP and it's simpler for cross-platform code if I can just do everything with raw sockets. I'll try switching to 443. When you say 'trigger intrusion detection systems', I assume you mean the deep-packet-inspection on the gateway. In that case do you know how the process works? Would the traffic be suddenly blocked based on the red flag? Or would the server owner (My Amazon account) be somehow contacted to determine if it's legit or not? \$\endgroup\$ – Chris May 14 '13 at 17:17
  • \$\begingroup\$ @Chris that would depend on what software is used and how it is configured \$\endgroup\$ – Philipp May 14 '13 at 17:46
  • \$\begingroup\$ Right, I was hoping you had some inside information on those types of systems =) Thanks. \$\endgroup\$ – Chris May 14 '13 at 19:32

You can do as Phillip suggests and build your protocol over HTTP, or even use one of many existing protocols that work over HTTP such as SOAP.

However, if this is not enough for your needs, I recommend you consider making your game work on your custom protocol on the port of your choice. You can have your game have some basic requirements, such as a non-distopyan ISP. Think of this as just like making a game require only Windows XP and above. Yeah, some people are still running Windows ME, but support for such a minority may not be worth it in the big scale.

You should focus your efforts on making your game fun and exciting. And once your game is popular, if you see there is a large demand in that niche market, then you can add support for those specific networks at a later point in time.

  • \$\begingroup\$ I would love to ignore the problem, but I've already seen complaints about connectivity through Telstra - which appears to be the biggest ISP in Australia. \$\endgroup\$ – Chris May 14 '13 at 17:04
  • \$\begingroup\$ that's... not very good \$\endgroup\$ – Panda Pajama May 14 '13 at 17:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.