Giter Site home page Giter Site logo

veebrenet's Introduction

VeebreNet

Brand new network and website system for terminal. So yes, you are looking to a stupid re-invented internet. Damn.

About Domain Name System

There is a basic DNS system. But this is very, very basic.

  • Client connects to DNS Server with TCP/IP socket and sends domain name to server.
  • Server reads domain name, and sends IP address that found from DNSBase.ddb file as string.

About system:

If a browser(any VeebreNet client) wants to connect to an VeebreNet server, client does these in order:

  • Connects to server with TCP/IP socket.
  • Sends optV value to server.
    • optV: {version[0],version[1],dir[0],dir[1],dir[2]}
    • First 2 bytes defines client's VeebreNet version. If server not supports that version, we will see what happens next.
    • Last 3 bytes defines the directory id that client wants from server. In example 0,0,0 for index page. But it is not forced to index for 0,0,0. Server can reply with anything.
  • Server sends a preWeb value for response.
    • preWeb: {errorId,size}
    • First byte will be 0 if server sended a respond that represent a successful connection. Or server will send an errorId. errorIds listed below:
      • 0: successful connection.
      • 1: wrong or unsupported version.
      • 2: directory not found.
    • Second byte will represent size as 2 power of size. So if client gets 5 as size, client will read 32 (2 power of 5) bytes.
  • Client reads preWeb and if preWeb[0] is 0, clients sends optSize. That will represent option count that will be sended to server. Otherwise the connection cuts off and thrown into the ocean.
    • optSize : represents options's size for next operations.
  • And then, client sends optType as option's types as 1 byte for 1 type to server (like {'c','i','i','i'}). Represented chars for variable types is listed below:
    • optType : {type1,type2,.....,typen}
    • 'c' = Character Type (1 byte)
    • 'i' = Integer Type (4 byte)
  • And then, client sends opts as options. 4 byte for integers, 1 byte for characters. For integers, variable that sending to server will be seperated to 4 bytes with basic calculation. And then server will assamble them again. And with optType, server will know wich variable is integer and wich one is character (or chicken).
    • opts : {int1B1,int1B2,int1B3,int1B4,char1,int2B1, ......}
    • An integer value will be {intB1,intB2,intB3,intB4}
  • And finally, server sends page and client reads it with reading 2 power of preWeb[1] bytes.

If a visual description is required:

Client                     Server
------                     ------
optV          -----------> reads optV
reads preWeb  <----------- preWeb
if preWeb[0] not equals to 0 connection stops here.
optSize       -----------> reads optSize
optType       -----------> reads optSize byte for reading optType
opts          -----------> reads opts with looking to readed optType
reads page    <----------- sends page

veebrenet's People

Contributors

ammarozkan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.