IPv6-only broadband: 464XLAT city by city, a NAT64 pool next to CGNAT
A broadband city can swap its home routers for ones with a CLAT (ip6Go / ip6Stop, from the city panel's Home broadband). Over 30 to 180 days an even share of the homes moves each day, paid as the routers go in ($4 a home), waiting while cash is short; starting needs only the first day's share. New homes in a swapping or finished city get the new router at the same price. The panel says how many addresses it frees and what it does to the monthly IPv4 bill. ip4Use splits homes into public, behind CGNAT and IPv6-only: the NAT64 pool (ceil(IPv6-only homes / NAT64 ratio), 64/128/256, default 128) comes right after business blocks, before dual-stack homes. NAT64 gateways cost the same per Gbps of IPv4 as CGNAT boxes; NAT64 refunds sit under CGNAT's at the same ratio and never reach zero. The IPv4 share of home traffic is now a curve: 0.55 on day 0, two points less a year, floor 0.2. Out-of-space advice names the sharing left to stretch. Everything is under rule ip4; old saves load unchanged (no field means dual stack).
This commit is contained in:
parent
3bc1641a46
commit
69328ce257
25 changed files with 812 additions and 54 deletions
|
|
@ -269,7 +269,7 @@ test('the address space says what its numbers mean: free counts homes behind CGN
|
|||
|
||||
test('the AS box on the dashboard lists the blocks you announce, not a made-up count', (t) => {
|
||||
const { ev, dom, errors } = game(t);
|
||||
const asBox = () => { ev("ACT.dash({});ACT.dashTab({k:'infra'})"); const k = [...dom.window.document.querySelectorAll('.kv')].map(e => e.textContent).find(x => /IPv6/.test(x)); ev('ACT.dashClose()'); return k; };
|
||||
const asBox = () => { ev("ACT.dash({});ACT.dashTab({k:'infra'})"); const k = [...dom.window.document.querySelectorAll('#dashCard .kv')].map(e => e.textContent).find(x => /IPv6/.test(x)); ev('ACT.dashClose()'); return k; };
|
||||
assert.match(asBox(), /1 × \/21 IPv4, 1 × \/32 IPv6/, 'the starting allocation');
|
||||
ev("ACT.ip4Lease({len:22});ACT.ip4Buy({len:24})");
|
||||
assert.match(asBox(), /1 × \/21, 1 × \/22, 1 × \/24 IPv4/, 'bought and leased-in blocks are announced too');
|
||||
|
|
@ -405,7 +405,7 @@ test('saves: garbage is repaired, and the state round-trips', (t) => {
|
|||
ev('S=sanitize(JSON.parse(JSON.stringify(S)))');
|
||||
assert.equal(ev('JSON.stringify(S.ip4)'), before);
|
||||
ev(`S.ip4={b:[{id:'a',len:12,k:'rir',d:0},{id:'b',len:24,k:'stolen',d:0},{id:'c',len:24,k:'buy',d:-5,out:'yes',mo:5},{id:'d',len:23,k:'in',d:1e9,mo:-3},null,{id:'e',len:24,k:'rir',d:0,out:true,mo:'x'}],nat:7,w:99};S=sanitize(JSON.parse(JSON.stringify(S)))`);
|
||||
assert.deepEqual(J(ev, 'S.ip4'), { b: [{ id: 'c', len: 24, k: 'buy', d: 0 }, { id: 'd', len: 23, k: 'in', d: ev('S.day'), mo: 0 }, { id: 'e', len: 24, k: 'rir', d: 0, out: true, mo: 0 }], nat: 16, w: 3 });
|
||||
assert.deepEqual(J(ev, 'S.ip4'), { b: [{ id: 'c', len: 24, k: 'buy', d: 0 }, { id: 'd', len: 23, k: 'in', d: ev('S.day'), mo: 0 }, { id: 'e', len: 24, k: 'rir', d: 0, out: true, mo: 0 }], nat: 16, n64: 128, w: 3 });
|
||||
ev("S.ip4='nope';S=sanitize(JSON.parse(JSON.stringify(S)))");
|
||||
assert.ok(J(ev, 'S.ip4.b.length') >= 1, 'a broken field is granted afresh');
|
||||
assert.deepEqual(errors, []);
|
||||
|
|
@ -416,7 +416,7 @@ test('the address space works on a phone: one column, wrapping buttons, the drop
|
|||
ev("window.innerWidth=360;window.innerHeight=740;S.pops.fra.bb.d=250;compute();ACT.ip4Lease({len:24});ACT.ip4Open()");
|
||||
const sec = dom.window.document.querySelector('#bankCard .bank-ip4');
|
||||
assert.ok(sec, 'the section is in the bank');
|
||||
assert.equal(sec.querySelectorAll('select').length, 2, 'the CGNAT ratio and the block size');
|
||||
assert.equal(sec.querySelectorAll('select').length, 3, 'the CGNAT ratio, the NAT64 ratio and the block size');
|
||||
for (const s of sec.querySelectorAll('select')) assert.ok(s.closest('.ops-sel'), 'each dropdown in a stacking label');
|
||||
for (const b of sec.querySelectorAll('button')) assert.ok(b.closest('.btns'), 'every button in a wrapping row: ' + b.textContent);
|
||||
assert.match(sec.textContent, /2,500, \d+% behind CGNAT/);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue