Hybrid peer to peer implementation difficulties

This is a discussion on Hybrid peer to peer implementation difficulties within the C Programming forums, part of the General Programming Boards category; Hi, I'm trying to realize a hybrid peer to peer network into practice. While I do have theoretical knowledge about ...

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    6

    Hybrid peer to peer implementation difficulties

    Hi,

    I'm trying to realize a hybrid peer to peer network into practice.
    While I do have theoretical knowledge about this matter, I lack
    practical knowledge. The solutions I thought of all feel like hacks
    to me, so I present this issue in order to receive feedback.

    Consider the given network-model below:
    Name:  P2P_Hybrid.png
Views: 586
Size:  23.5 KB

    We thus have a set of clients (Bob, Alice, Frank) and a Server singleton.
    Assume that in the initial state, Server has no knowledge of the clients (their IP might chance),
    while all the clients do know the Server's IP (as it is static). Further we assume
    the usage of IPv4.

    In order for arbitrary client to discover other clients a query must occur to the server. This is straight-forward.
    For clients to be able to listen to eachother, a listening port is used, say 6700.

    Now for the two problems, and the solutions I thought of:

    1. Intra-subnet communication
    Bob wants to communicate with Frank. As we are past the initialisation stage,
    all clients know eachother's IP addresses. The listening ports are known aswel (6700).

    (!!!)However as both clients are behind a router, NAT will most likely assign a different port.
    How is this port of the NAT table discovered?

    My solution:
    Since all clients perform a query to the main server, the main server will receive a structure with
    ip-address and port to send a message back to. Assuming the client does not close the socket, this port will
    always be available for receiving packets, even from other clients?

    I am aware TCP uses sequence numbers, and the receiving client might expect a certain number and not accept
    packets from other clients all together...

    2. Inter-subnet communication
    Bob wants to communicate with Alice. Assume the issues of (1) are resolved, and NAT maps Alice's listening port
    of 6700 (internal) to 55555(external). Is Bob able to send a packet to 142.128.1.100:55555 and expect it to
    arrive at Alice (assuming reliable packet transfer)?

  2. #2
    Registered User
    Join Date
    Feb 2013
    Posts
    6
    Bump: I found solution to this issue; for people interested please read into UPnP. Regards, zoom

  3. #3
    Registered User
    Join Date
    Feb 2013
    Posts
    3
    What was the solution for that issue.

    And as I was interested in this I read more about UPnP and especially read about UPnP accepting WAN requests. And found that it allows portmapping requests to external IP addresses from the device and internal IP addresses behind the NAT. So I tried to sketch up how it works by finding the external IP of mine using IP lookup sites like Ip-Details.com , Google's search bar etc., also found my physical address by ipconfig cmd command.

    My issue is,

    How come the server recognize me as my external IP changes ( I have a dynamic IP ).
    Last edited by Void_space; 03-07-2013 at 09:40 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Peer to Peer Network
    By DeanWinchester in forum Networking/Device Communication
    Replies: 3
    Last Post: 12-21-2012, 05:03 AM
  2. peer to peer wifi communication
    By odysseus.lost in forum Networking/Device Communication
    Replies: 2
    Last Post: 07-20-2006, 04:51 AM
  3. OOP for DirectPlay Peer to Peer program
    By curlious in forum Networking/Device Communication
    Replies: 0
    Last Post: 11-03-2003, 11:21 PM
  4. Peer-2-Peer spam filter for Outlook!?!?
    By gicio in forum Tech Board
    Replies: 7
    Last Post: 09-23-2003, 12:26 PM
  5. Problem with Peer-Peer Networking with XP Pro
    By Davros in forum Tech Board
    Replies: 14
    Last Post: 10-03-2002, 09:09 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21