We are looking for a UDP NAT2NAT solution.? Similar to Skype.?
The application supplied will be composed of three programs:
1. Client 1
2. Client 2
The application will be composed of the following:
1. Client 1 will be run on Host 1 - H1
2. Client 2 will be run on Host 2 - H2
3. Server - will be run on the Server - S
4. Router 1 - R1
5. Router 2 - R2
6. Network 1 - N1
7. Network 2 - N2
Here is a diagram:
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? S
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
H1 - N1 - R1? - Internet - R2 - N2 - H2
The idea is that H1 will have a UDP tunnel directly to H2.
This is how skype works.
We are interested in a similar solution.
H1 is situated within N1.
H1 would contact S via R1.
S would actually know the IP and Port of R1 via which H1 contacted S.
H2 would then also contact S
But H2 would receive H1/R1's IP/Port.
S would take the contact info:
? the IP and Port of H1/R1 and give them to H2.
H2 would now access H1 directly.
H2 and H1 are now sending and receiving UDP packets to/from each other.
I am interested in a simple console based application.
There is no need for any user comple user input.
The application should have a main menu:
1. Run Server
2. Run Client1
3. Run Client2
If the user selects 1:
Then the app runs the server.?
The server awaits client 1 to contact it.?
Afer client 1 contacts it, the server awaits client 2 to contact it.
So the app would now ask the user on what port he wants to the server to listen.
Now the app awaits Client 2 would contact it.
Any data received from Client 2 would be displayed by the app.
It also awaits user input.
It would send the user input to Client 2 as soon as it contacts the app.
If the user selects 2:
Then the app runs client 1.?
Client 1 contacts the server.?
The server saves the ip/port by which client 1 contacted the Server.
If the user selects 3:
The the app runs Client 2.
Client 2 contacts the server.
It then requests from the server the ip/port of Client1.
Next, Client 2 contacts Client 1 using this ip/port.
Now the app requests user input and sends it to Client 1.
If Client 1 sends something, then the app displays it.
You may use the Berkley protocol or WinSock.