Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DQDEV support (DNS in ITS) #2073

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion doc/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,61 @@ If you use Chaosnet, you may be interested in joining the Global
Chaosnet: read more about it at https://chaosnet.net.

## DNS
Check out this [external guide](https://its.victor.se/wiki/dqdev)
To make ITS use DNS like a modern netizen, you need to do the following. The result will be that the `H3TEXT` table mentioned above will be consulted first, but if it doesn't contain the info you need, DNS will be used.

1. Compile the handler for the DOMAIN: device, which interfaces to DNS.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain about DQ, DQX, and DOMAIN?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, somewhere. I'm not sure where to document what really, this file seems to be "user friendly" while explaining DQ/DQXDEV and DOMAIN/DQDEV might be more low-level info?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info can go in INFO. :-)

```
:midas device;jobdev domain,sysnet;dqdev
```
2. Initialize the database for DOMAIN:
```
:print domain:xyzzy;..new. (dat)
```
2. Compile NAME and SUPDUP with a switch to use RESOLV library routines (with DNS support) if the NETWRK library routines (which uses HOSTS3 tables) fail. (`^C` below is Control-C.)
```
:midas sysbin;name_sysen2;/t
DNSP==1
^C
:midas sysbin;supdup_sysnet;/t
DNSP==1
^C
```
3. Purify NAME. (`$` below is Escape.)
```
name$j
$l sysbin;name
debug[ 0
$g
```
4. Compile COMSAT (the mail daemon) with a switch to use DOMAIN instead of DQ. In this case, *only* DNS will be used, not the HOSTS3 tables. (The "Limit to KA-10 instructions" question should be responded with "y" if you are using a KA-10, of course.)
```
:midas .mail.;comsat_sysnet;/t
$$DQDQ==0
^C
Limit to KA-10 instructions: n
```
5. Make sure your ITS system can reach a DNS resolver which allows recursive queries.
If you don't use Chaosnet, the default resolver in DQDEV, 1.1.1.1, should work fine as long as packets from ITS reach it.
You might find the `iptables` incantation below useful:
```
iptables -I PREROUTING -t nat -s $YOUR_KLH10_ITS_IP -p udp --dport 53 -j DNAT --to-destination $YOUR_DNS_RESOLVER
```

If you use Chaosnet, you need a DNS resolver which knows how to find Chaosnet data, e.g. from the server at DNS.Chaosnet.NET (which does NOT allow recursion).
Get in touch and I'll help you (@bictorv)!
bictorv marked this conversation as resolved.
Show resolved Hide resolved
6. You may want to compile DIG, a test program:
```
:midas sysbin;dig_sysnet;
:link sys;ts dig,sysbin;dig bin
:dig in;a;hactrn.org
:dig ch;hinfo;up.update.uu.se
```

So far, you can configure some parameters by editing the code:
- The DNS server is hardcoded at `ROOHST`/`ROOADR` in `SYSNET;DQDEV`, but it might be more convenient to use the `iptables` trick above to redirect all DNS packets elsewhere.
- The domain search list is hardcoded at `DOMS` in `SYSNET;RESOLV`. When you change it, remember to recompile `NAME`, `SUPDUP`, `COMSAT` and perhaps `DIG` (see above).
- The Chaosnet address-to-name translation domain is hardcoded to `CH-ADDR.NET` in `SYSNET;DQDEV` and in `SYSNET;RESOLV`, but chances are that you want to keep it that way if you join the [Global Chaosnet](https://chaosnet.net).


## Mail
Check out this [external guide](https://its.victor.se/wiki/mail-setup)
Expand Down
123 changes: 108 additions & 15 deletions src/sysen2/name.558
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,17 @@ $$ANALYZ==1
.INSRT SYSTEM;CHSDEF
.INSRT SYSENG;NETWRK

;; default off. Compile with /T to input DNSP==:1
ifndef DNSP,DNSP==:0
ifn DNSP,[
RESOLV"$$DQDQ==:0 ;use DOMAIN:
RESOLV"$$DQCH==:1 ;handle Chaosnet
.INSRT SYSNET;RESOLV
]

;; Whether reagan.ai.mit.edu is used or not
ifndef $$dorgn, $$dorgn==0

putchr: .iot tyoc,t
popj p,

Expand Down Expand Up @@ -805,9 +816,7 @@ fjcl55: movem a,hstcur ;store # as current host.
push p,b
move b,a
pushj p,netwrk"hstsrc
jrst [ move a,hstcur
pushj p,typehn
jrst fjcl56 ]
pushj p,fjcl57
typz (a) ;type official name of site.
fjcl56: pop p,b
typi "]
Expand Down Expand Up @@ -903,6 +912,20 @@ fjcl70: pushj p,hicp ;try to perform ICP.
fjcl72: pushj p,netin ;go copy net input to TTY
jrst fjcl ;when done, go back for more sites.

fjcl57:
ifn DNSP,[
move a,[440700,,hanlst]
pushj p,resolv"hstsrc
jrst fjcl58
movei a,hanlst
popj p,
fjcl58:
]
move a,hstcur
pushj p,typehn
pop p,
jrst fjcl56

;initialize for a pass through JCL
jclbeg: push p,a
move a,ownhst ; initial "sticky site" is local.
Expand Down Expand Up @@ -1091,7 +1114,19 @@ hstlook:
tlnn b,-1 ;or if lh is 0, it is address of asciz string.
move a,b
pushj p,netwrk"hstlook ;convert to host number.
ifn DNSP,[
jrst [ move b,(p) ;netwrk"hstlook might have clobbered
movei a,(p)
tlnn b,-1
move a,b
hrli a,440700
pushj p,resolv"hstadr
setz a,
jrst .+1 ]
]
.else,[
setz a,
]
move b,a ;return that in B.
sub p,[1,,1]
pop p,e
Expand Down Expand Up @@ -1293,6 +1328,7 @@ ncvt63: sojge c,ncvt62
;Look through the host table to find all the Lisp machines,
;or all Lisp machines associated with the machine we are on.
;Contact them eight at a time using all 16 I/O channels.
;#### More efficiently, use a Chaosnet broadcast (BRD) and collect answers?
lmfing: pushae p,[a,b,c,d,e,t,tt]
.iopush ntsi,
.iopush tyoc,
Expand All @@ -1304,7 +1340,7 @@ lmfing: pushae p,[a,b,c,d,e,t,tt]
movem c,lmintb
.suset [.smsk2,,c]
setz c, ;C has index into LMADRS.
ife 1,[ ;now we have reagan this works differently...
ifn $$dorgn,[ ;now we have reagan this works differently...
trne f,%alllm
jrst [ movei b,hslm ;Find the table of all lisp machines, or
jrst lmfin2]
Expand Down Expand Up @@ -2521,6 +2557,25 @@ prthsc: push p,b
jrst [ ;6typ hstsix ;Print out its sixbit name.
pop p,b
jrst prths1 ]
ifn DNSP,[
;;; If TELSER only has numeric address (1.2.3.4), try resolving the FHOST
push p,a
move a,[440700,,hstnam]
prtc00: ildb b,a
skipn b
jrst prtc01 ;only numbers found
cain b,".
jrst prtc00
cail b,"0
caig b,"9
jrst prtc00 ;non-number found
jrst prtc09
prtc01: move a,[440700,,hstnam]
skipe b,fhost
pushj p,resolv"hstsrc
trn
prtc09: pop p,a
]
prthc0: move a,[440700,,hstnam] ;Scan name supplied by TELNET server.
irpc ch,,[MIT-]
ildb b,a
Expand Down Expand Up @@ -2566,6 +2621,25 @@ prthc3: ildb c,b
prthst: push p,b
push p,c
push p,d
ifn DNSP,[
;;; If TELSER only has numeric address (1.2.3.4), try resolving the FHOST
push p,a
move a,[440700,,hstnam]
prth00: ildb b,a
skipn b
jrst prth01 ;only numbers found
cain b,".
jrst prth00
cail b,"0
caig b,"9
jrst prth00 ;non-number found
jrst prth09
prth01: move a,[440700,,hstnam]
skipe b,fhost
pushj p,resolv"hstsrc
trn
prth09: pop p,a
]
;; Strip .ARPA, .EDU, etc from host name
domstp: move b,[440700,,hstnam]
push p,b ;save it too
Expand All @@ -2583,6 +2657,7 @@ domlo1: jumpe c,domeos ;null? Oh well.
jrst domlcs
cain c,"M ;.MIT.EDU?
jrst dommit
;; #### check for configured local domain here, and perhaps CHAOSNET.NET as well
jrst domlo1

domaxx: ildb c,b ;Check for "i.mit.edu" or "rpa"
Expand Down Expand Up @@ -3543,19 +3618,30 @@ HANLY0: ILDB T,B
HANLY1: IDPB D,C
MOVEI A,HANLST
PUSHJ P,NETWRK"HSTLOOK
JRST [ SKIPN ITBARF
JRST HANLY9
TYPZ CRLF
TYPI "[
TYPZ (A)
TYPZ [ASCIZ " is an unknown host]"]
TYPZ CRLF
TYPZ CRLF
JRST HANLY9 ]
AOS -6(P)
jrst hanlDQ
HANLY2: AOS -6(P)
HANLY9: POPAE P,[TT,T,E,D,C,B]
POPJ P,

hanlDQ:
ifn DNSP,[
move a,[440700,,hanlst] ;might be clobbered
pushj p,resolv"hstadr
skipa
jrst HANLY2
]
SKIPN ITBARF
JRST HANLY9
TYPZ CRLF
TYPI "[
movei a,hanlst ;might be clobbered
TYPZ (A)
TYPZ [ASCIZ " is an unknown host]"]
TYPZ CRLF
TYPZ CRLF
JRST HANLY9


;;; tcp support routines

tcplsn: syscal tcpopn,[movei 1(a) ? movei 2(a)
Expand Down Expand Up @@ -3636,6 +3722,7 @@ EVAR
;Match name of ITS system to list of names of lisp machines
;that should be considered automatically with that ITS system.
hs10lm: sixbit /mc/+hslmmc
sixbit /up/+hslmup
0

;Lisp machines associated with MC.
Expand All @@ -3644,6 +3731,12 @@ hslmmc: irps x,,sinatra bing avatar merlin lm20 lm19 mit-pi lm9 lm16 lm12 starli
termin
0

;; Lisp machines associated with UP.
hslmup: irps x,,cdr greek
[asciz/x/]
termin
0

; List of all Lisp machines.
; Now reagan has the all-lispm finger server, *lispm = Reagan
hslm: [asciz /reagan/]
Expand Down Expand Up @@ -3682,11 +3775,11 @@ hsvms: irps x,,pig corwin oberon vulcan golem
0

;MIT Twenex sites
;;#### should work like lispms - based on the ITS name, find its friends
hstnx: irps x,,xx oz speech ee
[asciz /x/]
termin
0

;List of Apiary machines.
hsapes: irps x,,ap1 ap2 ap3 ap4 ap5 ap6 ap7 ap8 ap9 ap10
[asciz /x/]
Expand Down
1 change: 1 addition & 0 deletions src/sysnet/comsat.584
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ $$DQ==1 ; Domain interface code in use (mostly for NETRTS)
$$DQRN==1 ; Use RENMWO hack to cut down on resolver overhead
;; These are IFNDEFs for now so that I can play with them without
;; editing the sources every time.
IFNDEF $$DQDQ,$$DQDQ==1 ; RESOLV uses "fake" DQ device instead of DOMAIN device
IFNDEF $$DQCH,$$DQCH==1 ; RESOLV is allowed to find Chaosnet addresses
IFNDEF $$DQIN,$$DQIN==1 ; RESOLV is allowed to find Internet addresses
;; $$DQIN should be turned off as soon as the NAMES > files etc can be
Expand Down
Loading