Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Peer-2-Peer program with IanM MatrixUtil? Is it possible?

Author
Message
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 12th May 2016 17:47
Hello everybody. I just wanted to know if it's possibleto create a P2P programs with IanM's MatrixUtils networking commands.

I just read this article on the theory of NAT-punchthrough, and had some idea for P2P. https://keithjohnston.wordpress.com/2014/02/17/nat-punch-through-for-multiplayer-games/
I wanted to avoid the host from having to port forward, so p2p and NAT-punchthrough might be the answer.
According to the article, 2 computers behind a router just need to send their packet to each other, the the sender router will recognize the target, so that packets from the target can be received back by the router sender. Then the infos can be exchanged after the 2 people are recognized by each other..
So all they need is to know the port and IP of one another (they dont need to port forward). This is usually a job for an 'intoducer' server.
But if the 2 people knows each other IP and port, they didnt need the 'intoducer' server. Or am I wrong?

So can MatrixUtils do this?
The usual Multisync and DBPro native multiplayer works as host-client model, so the host can't initiate the punchthrough.
But the IanM's MatrixUtils is more low-level. Is there a possibility that we can do this P2P NAT-punchthrough with it?
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 13th May 2016 15:37

I was reading up on NAT-punchthrough and it all makes good sense...

My question is who provides this service? I can't seem to find any free punchthrough servers, so if it comes down to paying for a service I may instead end up going with a VPN like cactus for personal use.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 13th May 2016 21:38
I both patties knows each other IP, then they shouldn't need the matchmaking server.
The host could make a 'whitelist' of possible clients, and try to connect to them.

But if there are a lot of clients, and they are not already known, then we might need the server,
I guess we need to write our own server.
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 14th May 2016 00:26 Edited at: 14th May 2016 00:45
Well according to the punchthrough article you posted, the only thing missing really is the initial connection, hence the need for the public server, because the client's router will not accept unsolicited connections, and thus needs to perform its own connection to get the ball rolling, as well as the host.

Thanks to this article, I now know that the client and host must both initiate connections for the others' router to allow access, after which each router will (supposedly) freely allow data to flow between them. So yeah, looking like we either use a pay service or get our own server going at home. I don't know if a static public IP alone on the host computer would remedy this (or is this actually the basic definition of a server?) but obviously that isn't free either.

Doesn't surprise me that hosting ain't free... heck why would an ISP give away such a handy thing when they can make money from it? $$

Cactus VPN is $8 a month and has great reviews and boasts fast gaming connections. That's about the cost of eating at McDonald's once. All I want for now is 8 or less players anyway (for testing not commercial purposes) so I'm leaning heavily this way, may even order tomorrow!
Send your parents to noisy sprite demo hell... enter the D-Zone
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 14th May 2016 09:29
According to IanM,
Quote: "If the port number and IP addresses are known at initiation of your code, this doesn't need any third party server to be involved. Otherwise the two hosts will need to communicate via a third party to agree the details - this is how Skype and P2P networks like limewire operate."


From this thread https://forum.thegamecreators.com/thread/132148

As long as the sender sends packet to an Ip address, then the sender will be able to get packets from that specific IP address. So the 2 people just need to know each other IP address, and they can connect.
Probably.
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 16th May 2016 15:18
Quote: "As long as the sender sends packet to an Ip address, then the sender will be able to get packets from that specific IP address. So the 2 people just need to know each other IP address, and they can connect.
Probably."


But how to get the initial connection to go through is the trick... if you send a packet to my PC, i have not asked for it, rather you have solicited to me, so my router with block the un-asked for request.
Likewise, If I send a packet to your PC, you have not made the request, I have...so your router will block me as well.
Send your parents to noisy sprite demo hell... enter the D-Zone
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 17th May 2016 16:05 Edited at: 17th May 2016 16:09
Its doesn't matter if your router block my request in the beginning.
Because after I send something to you, my router will be open for your packets. Even if yours still didnt accept mine.
So, afterward you should just send a packets to me, and your router will be open too.
With this, both our router will be open to each other. Then we can exchange data.

The 3rd party server is nothing but an introducer. If Both parties knows each other IP, then they didn't need the introducer.
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 17th May 2016 17:23 Edited at: 17th May 2016 17:25
Quote: "Because after I send something to you, my router will be open for your packets."


Yes, but how are you going to get that first packet to me if my router blocks your data?
So far I have not been able to get an outsider to connect through my open port, have you?
Send your parents to noisy sprite demo hell... enter the D-Zone
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 17th May 2016 18:05 Edited at: 17th May 2016 18:06
You don't need to receive the packet from me. The purpose of me sending a packet to you is for 'my' router to open up for you.
Vice versa, You're sending your packet to me is not for me to receive it, but for your router to open up to me later.
When we attempt to send a packet to an IP address, our router will open up automatically for that IP to receive the reply.
So after we first attempt to send data to each other, it will not reach. It will only open up the routers for each other.
After the first attempt, our routers should be open, and the next data we send will reach.
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 18th May 2016 16:40
Is this a theory or something you have actually done? I don't see how 2 blocked communications will open up from either side.
Send your parents to noisy sprite demo hell... enter the D-Zone

Login to post a reply

Server time is: 2024-04-23 07:27:36
Your offset time is: 2024-04-23 07:27:36