Showing posts with label Networking. Show all posts

From Pirate Darling To Dropbox Alternative: BitTorrent Sync Lets You Keep Your Files Synchronized Across Machines


The days of having to shuttle files between machines on USB sticks seem like a distant memory from a simpler time. Today, it’s all about the cloud. Want to access your files from more than one machine? Nothing could be simpler: Just stick them in Dropbox (and hope there isn’t anotherauthentication bug), or Drive (courtesy of our corporate overlords at Google), or SkyDrive(developed by the benevolent behemoth that is Microsoft). To put it differently, cloud-based file sync services are easy to use and work well, but your privacy may or may not be their first priority. Not to mention the fact that these services always come with a storage quota. You can try to maximize the free storage space, but a quota is a quota. If you’re longing for an alternative, you should check out BitTorrent Sync.
This new service from BitTorrent harnesses the power of the distributed file-sharing network to keep your own private files in sync. It’s not like torrenting your files, though: BitTorrent Sync works with secret keys that let you selectively choose what to share with whom, and even supports expiring, temporary keys. Let’s walk through installing the service and sharing a folder.

Installation: Next. Next, Done!

Installation couldn’t be simpler. It’s not even a next-next-next affair, really, as it only has two steps. Two things are worth noting: BitTorrent Sync is utterly clean of any ads or any other dubious content (and it does not come with a BitTorrent client), and the only sort of special treatment it asks for is making a hole in the Windows firewall:
bittorrent sync

Initial Configuration

Once installed, run BitTorrent sync to begin the configuration process:
bittorrent sync review
We’ll get to secrets in a moment. For now, pick Standard Setup (the default), and click Next. BitTorrent Sync will then ask you for a folder to sync:
bittorrent sync review
It’s worth noting that you can use BitTorrent Sync to synchronize any folder, not just its own special folder.
Once you pick a folder, BitTorrent Sync will produce a secret for it:
bittorrent sync review
This is a long string of characters which you can then use to connect to this folder from any other device. This is a key difference between BitTorrent Sync and other file-sync solutions: There are no user accounts, and you won’t be asked to create a password for yourself at any point in the process. Rather, each folder has one or more secrets, and that’s what you use to connect to it.

The Tour

Once you pick your first folder to sync and get a password, BitTorrent Sync will show a quick three-step tour:
bittorrent syncapp
The first step of the tour shows the control panel, while the next explains you can sync an unlimited number of folders, and files of any size. Finally, BitTorrent Sync shows how you can quickly copy the secret for any shared folder, to share it with family or friends:
bittorrent syncapp
Once you finish the tour, you’ll find yourself in the BitTorrent Sync interface proper.

Adding Folders For Sharing

One of BitTorrent Sync’s cool features is that you can add new folders from anywhere on your computer. The Shared Folders tab has an Add button which you can click for this dialog:
bittorrent syncapp
Once you add a folder that already contains files, BitTorrent Sync will take a few moments to index its contents. You will already be able to copy its secret and share it with other BitTorrent Sync users. Once I entered the secret for this folder on another computer running BitTorrent Sync, the other computer’s name showed up in the BitTorrent Sync window, and files started going through instantly (they were on the same LAN, but this should work over the Internet as well, assuming you’ve let the installer configure your Windows firewall).

Your Secret: It Really Is a Secret

One thing really bears another mention here: When BitTorrent Sync gives you a secret, it means it. It is a secret. Anyone who possesses this magic string of letters will be able to gain access to the folder you’ve shared, no questions asked. Yes, you will see an unexpected device name in the Devices tab, but that will be too late: By then, the hostile party may already be in possession of your files.

Advanced Secret Tactics

What if you want to allow access to a folder, but not risk anyone deleting or modifying its contents? And what if you only want to share a folder for a limited time? BitTorrent Sync has you covered: Double-click the folder, switch to the Advanced tab, and you’ll get the following:
bittorrent sync
Here you can see the folder’s existing secret, its read-only secret (for allowing permanent read-only access), and generate one-time secrets. A one-time secret can only be used once, and expires after 24 hours. That’s pretty awesome.

A Very Promising Start

BitTorrent Sync gets a lot of the basics right. Setup is a snap; you can share any folder; you don’t have to create user accounts; and the underlying file-transfer technology is, shall we say, extensively field-tested and proven. Whether or not it catches on as a mainstream means of synchronizing files — only time will tell. But this initial test shows that there’s a lot going for it.

The DNS Protocol

The DNS PROTOCOL
The Domain Name System protocol translates domain names into IP addresses (Wikibooks page). When a client wants to open a webpage at www.google.com, a query is sent to a DNS server (a.k.a. name server) to fetch the corresponding IP address. The IP returned by the name server is used to contact the Google web server – the server that hosts the actual website contents. In this post we explain the DNS protocol and the packets involved.



Usually, a client will know the IP address of one or more DNS servers after the DHCP boot process is completed. In order to resolve a hostname, a DNS query packet is sent. All DNS traffic between clients and name servers is encapsulated in UDP, and name servers always run on UDP port 53.


The DNS PACKET STRUCTURE

The structure of DNS packets looks like this:


The flags field (16 bits) has the following structure:

a)  The first (0th)bit indicates query(0) or response(1)
    b) Next three bits (1-4) indicates ‘Standard Query (0)’,
       ‘Inverse Query (1)’ and ‘Server Status Request (2)’.
    c) The 5th bit field indicates Authoritative answer. The
       name server is authoritative for the domain in the
       question section.
    d) The 6th bit field is set if message was truncated. With
       UDP this means that the total size of the reply exceeded
       512 bytes and only the first 512 bytes of reply were
       returned.
    e) The 7th bit field indicates Recursion Desired. This bit
       can be set in a query and is returned in the response.
    f) The 8th bit field indicates Recursion Available or not.
    g) The next 3 bits (9-11) have to be 0.
    h) The next 4 bits (12-15) give a return code where
       0 signifies No Error and 3 signifies Name Error.


QUERY PACKET


When a client sends a query to a name server, the Resource Record fields are empty. The Number of Questions field contains the amount of entries in the Questions field, usually 1. Each question consists of:

Name: A string containing the Internet address being queried
Class: The query class, normally the value 1 for Internet (“IN”).
Type: The record type to be queried, the most common types are:






RESPONSE PACKET

A response sent by a name server to a client will contain the original questions in the Questions fields. Additionally the Resource Record fields contain one or more entries. A resource record entry has the following structure:


  • Name: Contains the object, domain or zone name that is the subject of the resource record.
  • Type: One of the available record types.
  • Class: Again, this is normally 1 .
  • TTL: Specifies the number of seconds that the record should be retained in the cache of the device reading the record.
  • RData Length: Indicates the size of the RData field, in bytes.
  • Resource Data: The data portion of the resource record.

The Name Server

 A client that wants to translate a name to an IP address sends a question to the name server(s) on its network. The name server provides an answer to the question, but it might have to contact several other servers to obtain the answer. A lot goes on behind the scenes that the client is blissfully unaware of. A typical scenario where a client looks up abc.company.com looks like this:





  1. The client formulates a question and sends it to the name server, expecting an unambiguous answer. The name server will first search its cache (5), and immediately answer the client if the answer is found.
  2. If the name server does not know the answer itself, it contacts the root name server. The root name server finds out that it does not know the IP for abc.company.com, but it contains an NS type resource record delegating the .com domain to a subordinate name server. So it returns the IP’s for the authoritative name servers for the .com Top Level Domain (TLD).
  3. The name server contacts the authoritative server for the .com domain, which contains an NS type resource record for the company.com domain. It will receive the IP addresses for the authoritative servers for the company.com domain.
  4. Then, the authoritative name server for the company.com domain is contacted, again asking for the IP of abc.company.com. This server then solves the query (or not), and transmits the result back to the name server. Finally, the name server sends the answer to the client.
  5. The name server also caches the information it obtains during the lookup process for future reference.
  6. This process is called iterative lookup, and it the most common approach for name servers that serve clients.






DNS

Blog Archive

Powered by Blogger.

- Copyright © 2013 Taqi Shah Blogspot -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -