Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can Teamviewer share images by using direct port behind a firewall

I found this: How does teamviewer find my computer but I could not understand and the answers are not what I am looking for. I'm looking for a solution in .net.

If I have an image-Sender-app and how can Teamviewer connect to image-Receiver-app? Is there any tunnelig system included? Or does Teamviewer only use Port 80?

Does Skype use same methode for voice chat?

* EXAMPLE *

I am on PC-A and I have an 50KB image here as Screenshot-Frame and would like to send it to my PC-B. Now, TV (teamviewer) looks on the whole portrange from 1 to 65,000 if any port could connect the SERVER-PC. I think minimum Port 80 will success, right? But on my computer also port 4001 is open, TV will use 4001 for the feature. On PC-B it checks also for open ports and founds port 80 and 6500 and will use 6500 for the feature. My question is now, where are data going to? Is my image first going to SERVER-PC by using port 4001 and the 50KB is stored for short time there and PC-B will download it on port 6500? I cannot believe that that is the truth because it would create too much TV-SERVER-PC traffic. But how can it work?

Image of Port switcher

Regards

like image 641
goldengel Avatar asked Feb 24 '23 00:02

goldengel


1 Answers

The other answer covers the essentials really.

This article (old, but still relevant) describes how Skype gets around firewalls - maybe it helps explain the method better.

As far as I know, TeamViewer employs the exact same method - both TeamViewer client apps connect actively to a central server, and then negotiate the connection as described in the article.

My question is now, where are data going to? Is my image first going to SERVER-PC by using port 4001 and the 50KB is stored for short time there and PC-B will download it on port 6500? I cannot believe that that is the truth because it would create too much TV-SERVER-PC traffic. But how can it work?

PC-A and PC-B communicate directly with each other. SERVER-PC is used only to establish communication between the two, to punch the hole into both computers' firewalls. The crucial trick in the article is this (Emphasis mine):

Bob's Skype program then punches a hole in its own network firewall: It sends a UDP packet to 1.1.1.1 port 1414. This is discarded by Alice's firewall, but Bob's firewall doesn't know that. It now thinks that anything which comes from 1.1.1.1 port 1414 and is addressed to Bob's IP address 2.2.2.2 and port 2828 is legitimate - it must be the response to the query which has just been sent.

like image 123
Pekka Avatar answered Mar 10 '23 10:03

Pekka