How does airdrop/bluetooth work?

710 views

growing up in a technological world, modern devices and machines just became a norm. no one really questions how stuff works, just that it does and it helps make life a little easier to live. but the concept of airdrop/bluetooth just absolutely fascinates me. i just cant wrap my head around how different devices can share digital information to one another. how do the mechanisms for it work? like when sending files or videos, does computer one send a sequence of codes unique to a particular file/vid that computer two then translates to create a copy of said file/vid?

In: Technology

2 Answers

Anonymous 0 Comments

So, Bluetooth itself is based on short-range radio waves, other devices can just listen in if someone around them is broadcasting something (in bluetooth you usually have a 1 to 1 connection protected by a code or something).

Once a connection is established there’s a certain protocol for how the two devices talk to each other (which I’m not familiar with) but they usually are a series of acknowledgements.

If all that is out of the way, one device will simply notify the other that it would like to send a file, the other device accepts and the first one starts transmitting the binary data of said file.

Anonymous 0 Comments

In the beginning, bluetooth was completely broken. There was a written document that said how to connect everything, but the example program used to certify devices was broken and didn’t work how the document said so everyone had to use the example program in all of their actual products. Bluetooth devices used to require little pairing codes to be used, but they never worked because of this and were abandoned since everything started using 0000 as its code. The fact bluetooth still exists is kind of a surprise for me because of how horrible it used to be.

Bluetooth is a standardized specification that dictates specific radio frequencies for the devices to talk on just like wifi. Airdrop is a protocol for applications that use bluetooth and wifi.

Most wifi devices, including bluetooth, use similar approaches with only the fine specifics being different like frequencies and encryption methods and how to package the information. If you’re trying to find a nearby device on your phone, your phone sends out a call on the frequency asking if anybody can hear it. Devices that can show up in the list by replying “I can hear you buddy”. Sometimes it’s the other way around and the other devices are going “I’m here if you need me” which is called broadcasting and how wifi access points work.

When you’re connecting to a device, the conversation pretty much goes like this:

Device A: “Hey, you there B?”
Device B: “I’m here. Who are you?”
A: “I’m A”
B: “Ok, you’re A”
A: “Yes, I’m A”
B: “What do you want?”
A: “I want to send a file”
B: “Ok, you may proceed”
A: <breaks the file into many many small parts and sends parts 1,2,3,4>
B: <receives part 1 and sends a receipt for part 1>
A: <receives receipt for part 1 and sends part 5>
B: <receives part 4 and sends a receipt for part 4>
A: <receives receipt for part 4 and sends part 6>
B: <receives parts 5 and 6 and sends receipts for parts 5 and 6>
A: <receives receipts for parts 5 and 6 and sends parts 7 and 8; hasn’t heard from parts 2 or 3 in a while so resends parts 2 and 3>
B: <receives part 3 and sends receipts for part 3>
A: <hasn’t heard from parts 2 or 3 in a while so resends parts 2 and 3>
B: <receives parts 2 and 3 and sends receipts for parts 2 and 3>
A: <receives receipts for parts 2 and 3 and sends parts 9 and 10>

A: “Hey, I’m done sending the file. You sent me receipts for every part”
B: “Ok, so we’re good?”
A: “Yeah, we’re done”
B: “Ok, I’m signing off now”
A: “Ok, bye”
B: “Bye”

Each part is a packet of information that has a to and from computer address along with information for whatever you’re trying to do. For the actual network information, it’ll have stuff like “this packet is <x> bits big” so the program listening on the antenna can count how many bits to use to form a packet and send to the program putting the pieces together. The order of the zeros and ones making up the binary data is all explained in the specification for whatever you’re using. Those documents say stuff like “the first 4 bytes you see tell you what kind of action you’re doing, what the size of the action is, what kind of data you have, and where it came from. The bits following up to the size defined as the size of the action is the raw data of what’s being sent”. The programs are written and designed to speak specific languages. When things are encrypted, the programs jumble the information with a locking key and then read the information with an unlocking key.

The interesting thing is when you’re wanting to make sure the content is 100% sent like transferring a file you have to send a lot more data than just the file information. In order to verify everything was sent, you have to send a bunch of receipts. If you’re just streaming something instead like a video call, then you don’t need 100% transfer so you just send everything as fast as possible. If some of the information doesn’t make it, then you just skip it and move on.

When NASA is dealing with deep space probes sending back images and other data, they use very VERY slow wifi. They can’t send a lot of data back and forth so include a lot of data correcting information that lets you rebuild lost information. This data correcting information is over 1/3 of the data sent. On top of that, they send the data multiple times because you can’t correct broken data you never receive.