From 0378957e8aeef739408e7fa07709f82e4487fae9 Mon Sep 17 00:00:00 2001 From: ecktec Date: Tue, 10 Jan 2017 16:53:43 +0100 Subject: [PATCH 1/2] Create dns.md --- Protocols/dns.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Protocols/dns.md diff --git a/Protocols/dns.md b/Protocols/dns.md new file mode 100644 index 0000000..1dd23db --- /dev/null +++ b/Protocols/dns.md @@ -0,0 +1,41 @@ +# DNS + +## Quick Information + +| Information | | +| ----------- | -------------------------------------------------------------- | +| Version | 1.0.0 | +| Type | Protocol | + +## Technical Details + +DNS defines a method of looking up hostnames in the context of protocols. + +Any computer can broadcast a `lookup` for a hostname/protocol pair and will receive a `lookup response` from computers who identify themselves with the corresponding hostname/protocol pair. + +Because it's not just hostnames but hostname/protocol pairs, there can be several computers using the same hostname for serving different protocols. + +A computer can identify himself with every hostname/protocol pair he wants and with as many hostname/protocol pairs as he wants, as long as there are no duplicated hostname/protocol pairs in the world. The computer HAS TO lookup a hostname/protocol pair before identifying with it, if it is taken, the computer is NOT ALLOWED to identify with it. + +Packets are composed of 3 strings: +* the packet type +* the hostname +* the protocol + +These strings are combined in a table: + +``` + { + sType = "" + sHostname = "" + sProtocol = "" + } +``` + +### Looking up a hostname/protocol pair + +* The uplooking computer broadcasts a packet of type `lookup`, where the hostname and protocol string are the hostname/protocol pair to look up. +* If a computer identifies himself with that hostname/protocol pair, it responds directly to the uplooking computer with a packet of type `lookup response`, where the hostname and protocol strings are the hostname/protocol pair, the responding computer identifies himself with. + +## Aviable APIs +* [Rednet API](http://www.computercraft.info/wiki/Rednet_(API)) from CC 1.6 onward From 5b4079d0f84aed760cffa33ba65ba9af340e358a Mon Sep 17 00:00:00 2001 From: ecktec Date: Tue, 21 Mar 2017 16:02:24 +0100 Subject: [PATCH 2/2] changed packet to package --- Protocols/dns.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Protocols/dns.md b/Protocols/dns.md index 1dd23db..c134be4 100644 --- a/Protocols/dns.md +++ b/Protocols/dns.md @@ -18,7 +18,7 @@ Because it's not just hostnames but hostname/protocol pairs, there can be severa A computer can identify himself with every hostname/protocol pair he wants and with as many hostname/protocol pairs as he wants, as long as there are no duplicated hostname/protocol pairs in the world. The computer HAS TO lookup a hostname/protocol pair before identifying with it, if it is taken, the computer is NOT ALLOWED to identify with it. Packets are composed of 3 strings: -* the packet type +* the package type * the hostname * the protocol @@ -26,7 +26,7 @@ These strings are combined in a table: ``` { - sType = "" + sType = "" sHostname = "" sProtocol = "" } @@ -34,8 +34,8 @@ These strings are combined in a table: ### Looking up a hostname/protocol pair -* The uplooking computer broadcasts a packet of type `lookup`, where the hostname and protocol string are the hostname/protocol pair to look up. -* If a computer identifies himself with that hostname/protocol pair, it responds directly to the uplooking computer with a packet of type `lookup response`, where the hostname and protocol strings are the hostname/protocol pair, the responding computer identifies himself with. +* The uplooking computer broadcasts a package of type `lookup`, where the hostname and protocol string are the hostname/protocol pair to look up. +* If a computer identifies himself with that hostname/protocol pair, it responds directly to the uplooking computer with a package of type `lookup response`, where the hostname and protocol strings are the hostname/protocol pair, the responding computer identifies himself with. ## Aviable APIs * [Rednet API](http://www.computercraft.info/wiki/Rednet_(API)) from CC 1.6 onward