- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
Magik6k
-
Content Count
32 -
Joined
-
Last visited
-
Days Won
16
Posts posted by Magik6k
-
-
Why MsgPack instead of CBOR(RFC 7049)?
-
OETF #10 - OHCP - simple DHCP/BOOTP like protocol for host auto configuration.
1. Protocol
This is specification for a binary data frame(a Lua string), sent over OETF #7 protocol with protocol number 0xCF.
BYTE 0 | BYTE 1 | DATA | BROADCAST --------------------|--------------------------|----------------------------|----------- 0x00 - ADDR REQUEST | NOT SET | NOT SET | ALLOWED 0x01 - CLIENT RESP | 0x00 IPv4 address assign | IPv4+subnet byte (4b + 1b) | NO 0x01 - CLIENT RESP | 0x02 IPv4 gateway | Gateway IPv4 (4b) | NO
2. Protocol Flow
When a new client is starting up, it SHOULD broadcast `ADDR REQUEST` once. In case of no response it may retry after at least 15 seconds. If server has free addresses in address pools it should respond with `CLIENT RESP` packets, setting the client up.
-
This is a repost, as the old post was removed for some reason..
Requirements
- OpenOS
- Lua 5.2 CPU
- T3 hard drive
- Internet Card
Installation
1. Install MPT
wget http://mpt.magik6k.net/api/file/mpt/usr/bin/mpt.lua /tmp/mpt.lua /tmp/mpt -S mpt rm /tmp/mpt.lua
2. Install craftos
mpt -S cc-installer craftos install
3. Enjoy
craftos
Issues
If something doesn't work/show up(like a peripheral), post about it here.
-
1. Purpose
OETF #9 - OC Host Discovery Protocol is a host discovery protocol for local OC networks specified by OETF #7.
2.Protocol
This is specification for a binary data frame(a Lua string), sent over OETF #7 protocol with protocol number 0x0C.
All frames are allowed to be sent as a broadcast or as a direct message.
Prefix byte | Action | Payload ------------|-------------------------------------|----------- 0x01 | Peer IPv4 Advertisement | 4 byte IPv4 0x02 | IPv4 Discovery request | Optional 4 byte IPv4 [reserved] | | 0x08 | Peer IPv6 Advertisement | 16 byte IPv6 0x09 | IPv6 Discovery request | Optional 16 byte IPv6
When a peer in a network receives a 'Discovery request', it MUST respond with a 'Peer Advertisement' massages with all addresses set on a given interface.
When a peer is assigned an address is SHOULD broadcast a 'Peer Advertisement' message. Some implementations may choose to broadcast those is some set periods, if they choose to do so, it's recommended to set the interval to at least 60 seconds to not stress the network.
Responses to 'Discovery request' frames SHOULD NOT be a broadcast messages.
When there is no payload in 'Discovery request' frame, all addresses set on a given interface should be advertised.
Implementations MAY choose to not implement filtering in 'Discovery request' frames, falling back to the no-payload behavior.
-
Port 1 is just a default that can be changed. Ports in this network stack are used as VLANs, If in your infrastructure something else is using that port, you are free to change it, and it's not that hard(that is, implementations shouldn't make it hard).
-
Goto
in Programming
I see no need for goto there:
local function timer() local seconds = 0 while true do if reactor.getActive() then seconds = seconds + 1 end center(2, "Time Running: "..math.floor(seconds / 60)..":"..(seconds % 60)) sleep(1) end end
-
Use
```
for line in io.lines("/home/file.txt") do
--line is a string
end
```
-
Also, it would be fancy if one could use big battery as power buffer, as internal 10MRF is way too small for 1MRF/t+ reactor.
-
-
The following document is still a DRAFT and a subject to change, though protocol and assigned numbers should not change.
1. Purpose
ON2 - OCNet L2 protocol - is a very simple standard is aimed at advanced network stacks. It provides protocol tagging and optional vlan separation for devices that support it.
2. Protocol
ON2 utilizes the fact that OpenComputers network message can have multiple parameters. When a message(data frame) is sent using ON2 layer, the implementation sets first data parameter to protocol number and passes the data via second data argument. Port number(if supported by device) can be used as VLAN tag allowing network separation. Default port number(vlan) is 1
Here is an example modem call for sending data frame with protocol 0x46 (IP frame):
component.invoke(modem, "send", dest, vlan, 0x46, ip_data)
3. Implementation recommendations
Each network stack implementation should default to listening and sending on port 1. If packet of with unknown protocol number is received is should be silently dropped. Implementations should pass local/remote address and interface information(modem ID, vlan or interface object) to higher layers.
4. Protocol numbers:
Protocols are identified by numbers assigned in table below.
|-------------------------------------------------------------| | PROTOCOL NUMBER | PROTOCOL NAME | DEFINING STANDARD | |-----------------X--------------------X----------------------| | 0x0C | OC HOST DISCOVERY | OETF #9 | |-----------------X--------------------X----------------------| | 0x46 | IPv4 or IPv6 Frame | RFC791 and RFC2460 | |-----------------X--------------------X----------------------| | 0xCF | OHCP CONFIG PROTO | OETF #10 | |-----------------X--------------------X----------------------| | 0x1000 | MultICE | ??? | |-----------------X--------------------X----------------------| | Above 0xFFFF | User defined | N/A | |-------------------------------------------------------------|
You can apply for assigning protocol number by a post in this thread.
-
If you're that worried about people you lot on your server there is the whitelist option in internet section of the settings.json, where you explicitly say what's allowed.
-
I was away from OC for pretty long now, and I haven't got time to play with it/fix existing errors. There is new version of mpt waiting in PR(https://github.com/MightyPirates/OpenComputers/pull/2094) which fixes mentioned bug. ssh and other network related programs are huge mess as of now because I'm in progress of rewriting network stack to real ipv4/v6(I have ipv4, udp, basic icmp, RIPv2 protocols implemented as of now, and ~30% of TCP implementation). Most network programs still need to be adjusted for this API(It's not hard, just needs to be done). I consider moving big chunk of Plan9k to GitHub(OPPM) to make contributions easier.
-
You probably just want to use
io.stderr:write()
for that
-
This seems doable in Plan9k with its multi-threading, you basically do `local pid = os.spawn(threadFunc)` and then optionally `require("pipes").joinThread(pid)` to wait for spawned thread(s).
-
Super nice, but:
* Scroll in license in installer is crashing
* You should really consider using some package manager like OPPM/MPT for that
* I have a strong feeling that this was ported from CC, structure of the files sort of doesn't fit OpenOS, have a look at this http://www.thebuzzmedia.com/wp-content/uploads/2007/09/linux_file_structure.jpg
* With package manager packages wouldn't create mess in root directory
* you REALLY, REALLY should use something like /home/[user]/Desktop/SomeApp.app, or at least /root/Desktop/some.app for app launchers, having all things inside the root (/) directory is not nice at all.
Other loose suggestion for you is that you could adapt plan9k kernel(pipes package on mpt), to get multitasking and more security due to sandboxing. Learning how to use it may be a bit hard, but if you'd have a go at it you can catch me on IRC. Your entrypoint would be /bin/init.lua and you wouldn't have to modify Full OS to plug your functionality into something above BIOS level
More on mpt: http://oc.cil.li/index.php?/topic/92-mpt-minecraft-packaging-toolbeta/
The whole system looks really nice. In case it'd stay on top of OpenOS, it only needs some work here-and-there, like translations of things, small bugfixes, and it would be even worth seeing it on loot disk.
And YAY, first(?) proper gui based shell/os in OC world.
-
The color value is just a integer, the way you obtain it is r*256*256 + g * 256 + b
-
About the network floppy - it works over wireless networks, but is in a way broken when you move between different access points(i.e. physical nodes aren't auto-discovered for now). Also the network has dedicated API - use `man network`. Sending data to custom bound addresses via bare components won't work.
-
Nah, at least for now consider this project dead and use the network floppy which gives way more flexibility and is easier to setup/use
-
Closing connections was broken. The channel is basicly identifier of tcp connection.
-
Hello, sorry for reponsing that late, but I'm not really into the forums, I'm reachable via IRC more.
anyways, looking at code of server A I see the
function incoming(origin, port, data)
it should be
function incoming(_, origin, port, data)
This seems to be 99% of the problem
-
tony1485, Thats what all this is meant for. The only thing I use github for here is secure authentication(secure even without using https). Repository are there to group packages, one repository can be used by more than one person. Packages are like file archieves, they also can say what other packages they'd like to be present in system(i.e. dependencies). You can develop your programs directly in the IDE, and after saving file instantly update it and test in OC computer
-
@EchoSeven Server is already released at https://github.com/magik6k/MPT2
-
@EchoSeven it was dead for a while, now I released testing version of MPTv2, see top post
-
DOMAIN NAME SYSTEM
Yep. This one works much like real one - but it's a little simpler.
Basic system setup/configuration/howto/whatever
The most important part of every global DNS system are root-server. In real life there are 13 of these, but for Minecraft one server should be enough(ofc. you can have more root-servers). To be able to use DNS system the client must know at least one root server. Now let's say we want few domains in our system:
- example.org.
- sub.example.org.
- populardomain.org.
Now we create example network of 3 servers, with addresses addr1, addr2, addr3
The first server will be root server, the second will operate .org. zone and last one .example.org.
Now you may wonder what are these dots after addresses - They are 'zones'. So for example address 'sub.example.org.' requires asking 3 zones to get address. Going from back, the first zone is the 'root zone' and is stored on root server. Root zone knows .org. zone and asks it about sub.example, then .org. asks .example.org. about sub.example.org.
In my implementation there are 2 types of fields:
a - address
ns - name server - address of other DNS server that may know more about zone it is contained in.
If requested record could not be found on server, the user will be directed to 'nearest' name server that may know something more.
This way we can configure our servers to contain following fields:
server 1(addr1) - root server ZONE org. NS -> addr2 ZONE net. NS -> otheraddr server 2(addr2) ZONE org. ZONE populardomain.com. A -> addresstohost1 ZONE example.org NS -> addr3 server 3(addr3) ZONE org. ZONE example.org. A -> exampleaddr1 ZONE sub.example.org. A -> exampleaddr2
Do the thing in
realminecraft lifeAll steps require servers with OSes on HDD!!
Server 3:
Put some floppy to server(or small hdd)
[Install dnsserver] # fddid
chose drive and set label 'example'
Do same thing with Server 2 and 1(root server), but set labels like 'org' and 'root', then
Root server(Server 1):
Put floppy/hdd labeled with 'org' or whatever
# nsctl setfdd ns orgDriveLabel org
Then on the .org server(Server 2) put example.org fdd/hdd
# nsctl setfdd ns exampleOrgDriveLabel example.org # nsctl set a addresstohost1 populardomain.com
And finally on the third server do:
# nsctl set a exampleaddr1 example.org # nsctl set a exampleaddr2 sub.example.org
After doing all that stuff on the client set the root dns using the fdd/hdd created earlier:
# resvctl setroot fdd rootFddOrHddLabel
Finally on the client you should be able to do:
# resolv sub.example.org
and see 'exampleaddr2' as a result
(Of course you can design the network in any way you want, you may create any TLD's you want, you may use TLS's as any other domain, and you can store the whole system on one server)
INSTALLATION(through MPT)
Both:
# pastebin run KaATrNkb # mpt ppa add m6koc
Then, for servers:
# mpt install dnsserver # reboot
reboot is required to get server running
Or clients:
# mpt install dns
API
The 'dns' package provides super-simple API for resolving, in fact only one function, returning requested computer card address
dns.resolv(hostname: string):string
TODO's
- Check this post for mistakes
- Create cache'ing servers to speed-up things
- find better way of carrying addresses than fdd/hdds(Ideas?)
Code?
New ultimate Gui
in Libraries & API's
Posted
THIS IS SO COOL
I really do wonder how well it would work with Plan9k as it has (IMO) better threading support, proper virtual component support and component/event sandboxing/namespaces (so a program can/can't see selected components, events can be filtered/translated(like mouse clicks)). Would you mind if I try to port this api there?
Oh, and why won't you put this on OpenPrograms/OPPM?