A learning project/fun experiment in internet protocol

Overview

Piper

a learning project/fun experiment in internet protocol

Version 0.4.0 (SEMVER)

Goals

  • Piper is Simple. A page is a page. There are no secondary requests for more resources.
  • Piper is Small. The specification should be minimal, and not painful to implement in a language of choice.
  • Piper is Stateless. All requests can exist in a vacuum. The specification does not require any request/response to depend on a prior one.
  • Piper is Finite. The specification is not open-ended or extensible. This results in simplicity and ease of implementation.

Basic Tech Notes

  • Piper uses TCP for data transfer, as TCP is reliable and battle-tested.
  • Piper's default port is port 60
  • Piper is Little Endian. To maintain simplicity, this is spec-defined, and not controllable by the server or the client.

Piper Requests

A Piper request is simple. Once a TCP connection with the server has been established, the target URI is then sent. The client then waits for a response. Once a response is received, the TCP connection is closed.

The request structure is detailed below:

Num Bytes Purpose
2 URI Length Specifier
Remaining URI (encoded in UTF8)

Piper Responses

A response entails slightly more complexity than a request, as it contains first a header data structure, and then the contents of the response, if they exist.

the below table lays out the fields of the header:

Num Bytes Purpose
1 Content-Type (u8)
8 Content-Length (u64)
Remaining Content

This header design meets the criterion of Piper well. Its static nature (and the lack of any sort of header length field) keeps it Finite, whereas its small size helps keep it Simple and Small. There are no fields present that would help one evade Piper's promise to keep things Stateless.

Everything after the header is assumed to be body content. The Content-Length field is present solely to help clients with ease of allocation while reading a response.

The below table lays out the pre-allocated Content-Type field values. Any value not present is not part of the specification and is considered invalid.

Content Type Table

Code (Hex) Purpose
0x00 Text (UTF8, no formatting)
0x01 Text (UTF8, gemtext)
0x02 Text (ASCII)
0x10 File - UTF8
0x11 File - ASCII
0x1F File - raw bytes, no encoding
0x20 Redirect to other Piper URI. URI is supplied in contents.
0x21 Redirect to non-Piper URI. URI is supplied in contents
0x22 Error - resource not found
0x23 Error - internal server error

Note that Content Types are laid out in "ranges":

  • 0x0X is text
  • 0x1X is file transfer
  • 0x2X is Status-code like things. (Piper has no formal concept of status codes, as the required functionality can be reimplemented here.)
You might also like...
A repo for learning rust

learnrust A repo for learning rust Topics: print basic print function. datatypes get to know what is datatypes. variables variables!!!. consts consts

Bril: A Compiler Intermediate Representation for Learning

Bril: A Compiler Intermediate Representation for Learning Bril (the Big Red Intermediate Language) is a compiler IR made for teaching CS 6120, a grad

Rust Language Learning material

RustMaterial Rust Language Learning material Rust Rust is blazingly fast systems programming language that prevents segfaults and guarantees thread sa

An embedded key-value storage for learning purpose, which is based on the idea of SSTable / LSM-tree.

Nouzdb An embedded key-value storage for learning purpose, which is based on the idea of SSTable / LSM-tree. Plan Implement a memtable. Implement the

Rust language from simple to deep, and then to strengthen learning in multiple module

Rust Library This project is used to learn rust language from simple to deep, and then to strengthen learning in multiple module. It is used to help n

Rust implementation of Andrej Karpathy's micrograd for purposes of learning both ML and Rust.

micrograd_rs Rust implementation of Andrej Karpathy's micrograd for purposes of learning both ML and Rust. Main takeaways Basically the same takeaways

CloudLLM is a Rust library designed to seamlessly bridge applications with remote Language Learning Models (LLMs) across various platforms.
CloudLLM is a Rust library designed to seamlessly bridge applications with remote Language Learning Models (LLMs) across various platforms.

CloudLLM CloudLLM is a Rust library designed to seamlessly bridge applications with remote Language Learning Models (LLMs) across various platforms. W

Rust bindings to the Wolfram Symbolic Transport Protocol (WSTP)

wstp Bindings to the Wolfram Symbolic Transfer Protocol (WSTP) library. This crate provides a set of safe and ergonomic bindings to the WSTP library,

Rust lib for fetching official protoc (Protocol Buffer compiler) releases

protoc-fetcher Rust library for fetching official Protocol Buffer compiler (protoc) releases, pegged to a specific version. protoc-fetcher downloads a

Comments
  • [Suggestion] Basic usage instruction

    [Suggestion] Basic usage instruction

    Hi luminoso, nobody is holding me hostage in his basement and is forcing me to make a client for your internet protocol. Could you maybe add to the README a basic example usage for the protocol? Thanks!

    opened by NoozSBC 6
  • Unsure how to use multiple queries in URLs

    Unsure how to use multiple queries in URLs

    The spec says

    [piper://]hostname[:port][/path[?query[=...]]]
    

    But it doesn't say how to make more than one query would I use[piper://]hostname[:port][/path[?queryOne[=...]?queryTwo[=...]]] or [piper://]hostname[:port][/path[?queryOne[=...]&queryTwo[=...]]]?

    opened by Bigjango13 1
Owner
null
This experiment shows connecting wasm-bindgen generated code to a good-web-game application.

GWG + wasm-bindgen example This experiment shows connecting wasm-bindgen generated code to a good-web-game application. It uses simple_logger crate to

Tomasz Sterna 1 May 12, 2021
Manas project aims to create a modular framework and ecosystem to create robust storage servers adhering to Solid protocol in rust.

मनस् | Manas Solid is a web native protocol to enable interoperable, read-write, collaborative, and decentralized web, truer to web's original vision.

Manomayam 17 Oct 5, 2023
An i386 operation system written in pure rust for fun and no profit.

OrustS An i386 operation system written in pure rust (for fun and no profit). This operation system is under active developing. Checklist implement a

M4tsuri 10 Aug 12, 2022
(Ab)using technology for fun & profit.

(Ab)using technology for fun & profit. Code accompanying my blog

Sylvain Kerkour 357 Dec 30, 2022
Mewl, program in cats' language; A just-for-fun language

Mewl The programming language of cats' with the taste of lisp ?? What,Why? Well, 2 years ago in 2020, I created a esoteric programming language called

Palash Bauri 14 Oct 23, 2022
Extending mincaml with "fun" PL ideas.

wowcaml This is a fork of this Rust implementation of mincaml - a compiler for a call-by-value ML-like language, updated to recent versions of craneli

McCoy R. Becker 4 Jul 14, 2022
📱️🚫️🌝️💾️ 3FakeIM is a joke program meant to imitate various fictional characters, and the "[CHARACTER] CALLED ME AT 3:00 AM" clickbait trend, while poking fun.

3FakeIM ??️??️??️??️ 3FakeIM is a joke program meant to imitate various fictional characters, and the "[CHARACTER] CALLED ME AT 3:00 AM" clickbait tre

Sean P. Myrick V19.1.7.2 2 Jul 3, 2023
A bunch of links to blog posts, articles, videos, etc for learning Rust

rust-learning A bunch of links to blog posts, articles, videos, etc for learning Rust. Feel free to submit a pull request if you have some links/resou

Camille TJHOA 9k Jan 4, 2023
The source code that accompanies Hands-on Rust: Effective Learning through 2D Game Development and Play by Herbert Wolverson

Hands-on Rust Source Code This repository contains the source code for the examples found in Hands-on Rust. These are also available from my publisher

Herbert 261 Dec 14, 2022
My journey of learning rust as a web developer.

My journey of learning rust Low-level languages seem very interesting to me. I always wanted to learn a low-level language but never had the chance. T

null 1 Oct 21, 2021