Put a link on standby; the routing metric stays per city pair (#122)
A backup-only link next to a normal one still carried traffic, because parallel links merge into one edge. The metric stays on the city pair (S.pairMet), and any link can go on standby: it adds capacity that fills only after the active links, so it idles as a backup, takes the overflow when they are full and carries the traffic when they are down. Build order no longer matters, and adding a link never idles the others. Old saves keep each pair's lowest metric with every link active, which is how they routed before. The panel says what a standby link is doing, the redundancy list tags it, the map draws it dashed while idle, and traceroute shows the active link.
This commit is contained in:
parent
da69c5d843
commit
b4f8d9c7f5
18 changed files with 217 additions and 18 deletions
|
|
@ -4,6 +4,8 @@ function landTrenches(a,b){const out=[];for(const l of pairLinks(a,b)){if(l.kind
|
|||
// Which route a new wave joins: null = a new diverse route. 'same' is the old two-way choice (the main route).
|
||||
function routeJoin(a,b){const ts=landTrenches(a,b),r=UI.route||'';if(r==='same')return ts[0]||null;if(r.startsWith('t:'))return ts.find(t=>t.k===r.slice(2))||null;return null;}
|
||||
function pairLinks(a,b){return S.links.filter(l=>(l.a===a&&l.b===b)||(l.a===b&&l.b===a));}
|
||||
// A city pair's metric goes with its last link, so a new link between the same cities starts on normal.
|
||||
function prunePairMet(){const m=S.pairMet;if(!m)return;const k=new Set(S.links.map(edgeKey));for(const x of Object.keys(m))if(!k.has(x))delete m[x];}
|
||||
// Short, busy subsea routes (London–Amsterdam, London–Paris) sell dark fiber pairs too.
|
||||
function subDfCable(a,b){return cablesOk(a,b).filter(c=>CAB[c.cid].df).sort((x,y)=>x.km-y.km)[0]||null;}
|
||||
function dfAllowed(a,b){if(isSub(a,b))return !!subDfCable(a,b);return cnCity(a)===cnCity(b)&&!uaePair(a,b)&&!landX(a,b);}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue