dns-chord

command module
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 13 Imported by: 0

README

dns-chord

Implementing DNS functionality using chord framework

🚀 Problem description

🚀 Documentation

🚀 Report

System Architecture

DNS on Chord

Our DNS system builds on top of the Chord protocol, where multiple nodes store DNS records in their storage or local cache. When a user initiates a DNS query, the queried node retrieves the record from its local storage or cache if available. If the record is not present, the system locates the node holding the requested DNS record in the network. If found, that node returns the requested DNS record. Otherwise, a traditional DNS query is performed to obtain the record, which is then inserted into our network for future lookups.

Setup

Local setup
  1. Install Go. If you haven't already, you may install it from here.

  2. Clone the repository

    git clone https://github.com/fauzxan/dns-chord.git
    
  3. Navigate to the cloned repository

    cd dns-chord
    
  4. Open a terminal for each node you want in the network.

  5. Build the project and run the dns-chord executable to start a node.

    go build && ./dns-chord
    
  6. Upon running the command, you will be prompted to input the following information:

    • Your current port number: Enter the port number that you want the Chord node to use. This should be a valid port number (e.g., 3000).

    • Full IP address of the node you're using to join the network:

      • If you are creating a new network, simply press ENTER or RETURN

      • If you are joining an existing network, provide the full IP address of the node you want to connect to.

  7. We also designed a user-friendly interface to interact with the Chord node and gather information about its state, routing, storage, and cache.

    • Press 1 to display the fingertable of the current node.

    • Press 2 to view the successor and predecessor of the current node in the Chord network.

    • Press 5 to query a website using the DNS functionality implemented in the Chord protocol.

    • Press 3 to see the contents stored at the current node. This includes information about the DNS records or any data stored by the node.

    • Press 4 to see the cache - Includes cached results from previous DNS queries.

    • Press m to see the menu

Docker setup

Docker images are still in development phase! To run docker container, just build docker image using

    docker build --tag dns-chord-node .

Build a docker volume called mydata (This is not needed anymore)

    docker volume create mydata

If successfully built, then run, as well as to bind the volume with the container, run

    docker run -v mydata:/app/data  -it dns-chord-node

Do note that the -it tag is important to enable interactivity and also see colored output. This mounts the "mydata" volume to the "/app/data" path inside the container.

If you kill the container, then to restart it simply run:

docker start -ai <container_name>

You may close the terminal, and the container will still keep running in the background. You can confirm this behaviour via the log output of the container on docker desktop.

Documentation

Overview

Implementation of a subnet-based DNS that uses Chord as it's underlying protocol. The implementation introduced in this repository significantly improves query times and reduces message complexity as compared to legacy DNS systems that are currently in use.

Directories

Path Synopsis
Defines the structure for the Request and Response messages.
Defines the structure for the Request and Response messages.
This repository implements a simplified Chord protocol: a decentralized peer-to-peer (P2P) distributed hash table (DHT) for distributed data storage and lookup.
This repository implements a simplified Chord protocol: a decentralized peer-to-peer (P2P) distributed hash table (DHT) for distributed data storage and lookup.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL