Can't send P2P message from real IP

Last Updated:

  1. DataSmith

    DataSmith Member


    I need to send messages through P2P on 3G connection.
    Sending and receiving works perfectly on lan ip addresses(on wi-fi) but not on 3g or 2g.
    On 3g I send a message but it never appears on the other end of the line.
    Can anyone tell me how to make a connection ?
    What port to use ?


  2. Xyro

    Xyro 4 8 15 16 23 42 Moderator

    Just a thought - Does your network provider block P2P traffic?
  3. DataSmith

    DataSmith Member

    Thanks for your quick reply !
    It seams that android can't download torrents (like a pc), so I can't verify if my provider is blocking p2p (I can't get in contact with my provider right now). Can you please tell me how can I check if p2p is blocked ?

  4. Bitbang3r

    Bitbang3r Well-Known Member

    It's a longshot, but you might be able to make it work if you try using STUN.

    The 30-second explanation of STUN:

    Take two phones: A and B. Add a server, C.

    A can see C. B can see C. A and B can't see each other directly.

    A registers its public IP address with C. So does B.

    A discovers B's public IP address from C. B discovers A's public IP address from C. Both are told to use port 6969

    A and B blindly open UDP streams to each other's public IP addresses on port 6969. A starts hurling data at B's IP address, a.b.c.d. B starts hurling data at A's IP address, w.x.y.z.

    Their first few bytes (or more) get silently lost, but then something magical happens. The carrier sees B sending outbound UDP to w.x.y.z:6969, and temporarily begins passing through inbound UDP arriving for a.b.c.d:6969. A's carrier does the same thing, in reverse.

    Voila! A and B both see each other, as long as they keep blasting packets at each other nonstop.

    It's something that's not guaranteed to work, and would probably stop working if carriers saw too many people abusing it, but occasionally you get lucky and it works. And if you can't do it between the public internet and a phone on some carrier's network, you might STILL be able to pull it off between two phones on the same carrier's network... especially if they're in the same metro area.

    The key concept: you're using UDP, not TCP, so you're responsible for your own bundling, flow-control, and error-handling. The main difference is that unlike NAT, you know your own IP address, and it happens to BE your public IP as well, because you're being firewalled by the carrier, not NAT'ed. The reason doesn't matter... this is basically how services like Skype are able to punch holes through firewalls and work in places where the network owners really, really don't want it to work. ;)

    Failing that, root your phones and try Tor. There's at least one client for it in Android Market.
  5. Demache

    Demache Well-Known Member

    Its quite possible they block torrent traffic. I believe Verizon does.

    I probably wouldn't want to anyway. EVDO is too slow, it sucks down your battery, and can easily rape your internet connection. But I suppse that's up to you.
  6. DataSmith

    DataSmith Member

    Thanks a lot guys, I hope I can make it work.

Share This Page