How does skype send files directly?

3

I'm wondering how skype can send files directly to users that are usually behind a firewall? How does this work since I need to develop something similar where one local webserver (behind a firewall) needs to be able to send/stream files directly to another identical one?

I understand there needs to be some kind of publicly accessible central server through which both discover each other, and I plan to have that one, but how does the direct connection happen after that?

Thanks

Rok

Posted 2012-08-02T12:30:05.377

Reputation: 133

Question was closed 2012-08-02T20:16:26.410

2

See: How Skype & Co. get round firewalls - The H Security

– slhck – 2012-08-02T12:37:53.187

Thanks, that's great! Hopefully, i can find a Python library to simplify this. Cheers! – Rok – 2012-08-02T12:48:22.013

Answers

9

Skype does not rely on a server to send files per se. Skype uses a technique called hole punching to allow communication behind two restrictive firewalls. In essence, it will open a communication channel, thus "punching a hole" through the local firewall, which the other Skype client can use to transfer data.

Skype's communication is almost entirely based on peer-to-peer, therefore no centralized server is needed for the actual data transfer. It however needs a supernode to make the initial communication.

A NAT router therefore keeps tables of which internal computer has communicated with which external computer and which ports the two have used. The trick used by VoIP software consists of persuading the firewall that a connection has been established, to which it should allocate subsequent incoming data packets.

So, basically, the communication looks like this:

slhck

Posted 2012-08-02T12:30:05.377

Reputation: 182 472