# topologia.app — creating network diagrams from an AI assistant topologia.app is a free, browser-based network diagram editor. An AI assistant can build a diagram for a user without drawing anything: describe the network as JSON and hand the user a link (or the JSON). The editor places the devices in clean rows (Internet → routers → firewalls → core → access → endpoints), groups each site/zone in a box, arranges several sites side by side or in a grid, draws the cables as straight lines and shows interfaces/IPs at each end of every cable. The user can then edit it and export PNG, SVG, PDF, CSV or Visio (.vsdx). ## 1. Simple format (recommended) ```json { "title": "Oficina con DMZ", "nodes": [ {"name": "Internet", "type": "internet"}, {"name": "FW-01", "type": "firewall", "sub": "FortiGate 100F", "notes": ["WAN 200.1.1.2/30"]}, {"name": "WEB-01", "type": "server", "sub": "Web server", "zone": "DMZ"}, {"name": "CORE-01", "type": "l3", "sub": "Core", "zone": "LAN", "ha": "Stack"}, {"name": "SW-P1", "type": "switch", "zone": "LAN"}, {"name": "SW-P2", "type": "switch", "zone": "LAN"}, {"name": "AP-01", "type": "ap", "zone": "LAN"}, {"name": "PCs floor 1", "type": "pc", "zone": "LAN"} ], "links": [ {"a": "Internet", "b": "FW-01", "pb": "wan1", "ip_b": "200.1.1.2/30"}, {"a": "FW-01", "b": "WEB-01", "pa": "port3", "ip_a": "172.16.0.1/24", "pb": "eth0", "ip_b": "172.16.0.10/24", "label": "DMZ"}, {"a": "FW-01", "b": "CORE-01", "pa": "port1", "ip_a": "10.0.0.1/30", "pb": "Te1/0/1", "ip_b": "10.0.0.2/30"}, {"a": "CORE-01", "b": "SW-P1", "pa": "Te1/0/10-11", "pb": "Te1/0/1-2", "label": "Po10", "kind": "port-channel"}, {"a": "CORE-01", "b": "SW-P2", "pa": "Te1/0/12", "pb": "Te1/0/1"}, {"a": "SW-P1", "b": "AP-01", "pa": "Gi1/0/1", "label": "VLAN 30"}, {"a": "SW-P1", "b": "PCs floor 1", "pa": "Gi1/0/2-24", "label": "VLAN 10"} ] } ``` ### nodes (devices) - `name` (required) — unique hostname; links refer to it. - `type` — device type (see list below). If missing, it is guessed from the name (FW-, SW-, AP-...). - `sub` — subtitle: model, role or short description. - `notes` — array of extra lines on the device (IPs, loopbacks, VLANs). - `zone` — devices with the same zone are drawn inside one labeled box (LAN, DMZ, Site Lima...). - `ha` — redundancy badge: `Stack`, `M-LAG`, `VRRP/HSRP`, `HA activo/pasivo`, `HA activo/activo`, `Clúster` or free text. - `layer` — optional row number (0 = top). If NO device has `layer`, rows are computed automatically from the Internet/WAN edge down to the users. Give `layer` only when you want a specific vertical order. - `x`, `y` — optional absolute position in px. Normally do not use them. ### links (cables) - `a`, `b` (required) — device names. - `pa`, `pb` — interface on A / on B (Gi0/1, port1, Te1/0/1-2, eth0). - `ip_a`, `ip_b` — IP on A / on B (10.0.0.1/30). - `label` — text in the middle of the cable (network, VLAN, Po10). - `detail` — extra detail (speed, circuit id). - `kind` — `port-channel` (LACP/EtherChannel, drawn with the PO oval), `dashed` (backup, VPN), `dotted`. Empty = normal cable. - A device that appears only in `links` is created automatically. ### zones (optional) - `[{"name": "DMZ", "color": "#c0392b"}]` — only to set a zone color. Zones are created from `nodes[].zone`. ### Device types - `router` — Router (also accepted: rtr, gateway, enrutador) - `l3` — Core / layer 3 switch (also accepted: core, core switch, multilayer, switch capa 3) - `switch` — Switch (also accepted: sw, access switch, l2) - `firewall` — Firewall (also accepted: fw, utm, ngfw, fortigate, asa) - `server` — Server (also accepted: srv, servidor, vm) - `pc` — PCs / users (also accepted: cli, client, user, users, host, laptop, phone, printer) - `ap` — Wi-Fi access point (also accepted: wifi, wi-fi, access point, wlan, wlc) - `internet` — Internet / WAN cloud (also accepted: cloud, wan, isp, mpls, nube) - `saas` — Cloud service (also accepted: cld, cloud service, aws, azure, gcp) - `app` — Application (also accepted: application, aplicacion) - `api` — Service / API (also accepted: svc, service, microservice) - `db` — Database (also accepted: database, base de datos, sql) - `lb` — Load balancer (also accepted: load balancer, balanceador, f5) - `vpn` — VPN / tunnel (also accepted: tunnel, vpn gateway) - `storage` — Storage (also accepted: stor, nas, san, backup) - `container` — Container / Kubernetes (also accepted: cont, k8s, kubernetes, docker) - `generic` — Generic device (also accepted: gen, device, equipo, other) Field names in Spanish are accepted too (nombre, tipo, zona, notas, desde/hasta, puerto_a/puerto_b, etiqueta). ## 2. Giving the diagram to the user Option A — link (opens the editor with the diagram loaded): - Compressed (short, recommended if you can run code): `https://topologia.app/#z=` - Plain: `https://topologia.app/#json=` - Base64: `https://topologia.app/#d=` - For the English interface use `https://topologia.app/en/#z=...` - Everything after `#` stays in the user's browser; it is never sent to the server. - If the link would be very long (hundreds of devices) or the chat breaks long URLs, give the JSON instead (option B). Python: ```python import json, zlib, base64, urllib.parse txt = json.dumps(diagram, ensure_ascii=False, separators=(",", ":")) c = zlib.compressobj(9, zlib.DEFLATED, -15) # raw deflate z = base64.urlsafe_b64encode(c.compress(txt.encode()) + c.flush()).decode().rstrip("=") print("https://topologia.app/#z=" + z) # short link (recommended) print("https://topologia.app/#json=" + urllib.parse.quote(txt, safe="")) # no compression ``` JavaScript (browser or Node 18+): ```js const txt = JSON.stringify(diagram); const buf = await new Response(new Blob([txt]).stream().pipeThrough(new CompressionStream("deflate-raw"))).arrayBuffer(); const z = btoa(String.fromCharCode(...new Uint8Array(buf))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); console.log("https://topologia.app/#z=" + z); ``` Option B — JSON: give the JSON in a code block and tell the user: open https://topologia.app/ → Archivo/File → Importar JSON / Import JSON → paste → Importar/Import. Option C — image: the editor renders in the browser, there is no image API. Give the link and tell the user to use Exportar/Export → PNG, SVG, PDF or Visio. An agent that controls a browser can open the link and use the same menu, or read/write the diagram with `window.topologia.json()`, `window.topologia.importar(obj)` and `await window.topologia.enlace()` (returns a #z= link of the current diagram). Example links for the diagram above: - https://topologia.app/#z=jVJdS8MwFP0rJc9rm6Si4Nuc2xB0K04sKEPSLqNhNSltdOjYfzfp1vamMJC-JPeej3t7ckBa6IKjW7TcikxI5mVKevdPb2iEpNrwGt2-H5BknxbyIDWvJNemp39KWxFt5TjqULPEx6SHbEXF96woTKX-Sm1fVVrMmeYewXjW-OjGByXjhUcxDoj5aBhhtAayyfTO0a159c2rTjXhqdeVfpW0ELsGUJgsn6eORBF19ImqeE98HC_MJWfmuNIs20GVVeLHcIy90FnuUgdo-m_0OHbmY-VFZDypvW2hVOUBfJkN8OsRKoTcnUJkboIpiKq0lz2T9izKD3tzcrDGDOBTmEdpO6UJNTqx7ZXc0IBcB0YipFetAdc57g16CD5hCpbyAqQ2NOzj6xwJcMQBbvwi3Pq9cBLiEOx0xjgr9aopCLdxOPOxT8hA0qdg3lgRa7kTcnMey89yJqVpXjahAxM6HLqlthOl4Hk0xLlot2sHeTWZe2A1SHXfCxCgvvPzGw2zz3F9_AM - https://topologia.app/#json=%7B%22title%22%3A%22Oficina%20con%20DMZ%22%2C%22nodes%22%3A%5B%7B%22name%22%3A%22Internet%22%2C%22type%22%3A%22internet%22%7D%2C%7B%22name%22%3A%22FW-01%22%2C%22type%22%3A%22firewall%22%2C%22sub%22%3A%22FortiGate%20100F%22%2C%22notes%22%3A%5B%22WAN%20200.1.1.2%2F30%22%5D%7D%2C%7B%22name%22%3A%22WEB-01%22%2C%22type%22%3A%22server%22%2C%22sub%22%3A%22Web%20server%22%2C%22zone%22%3A%22DMZ%22%7D%2C%7B%22name%22%3A%22CORE-01%22%2C%22type%22%3A%22l3%22%2C%22sub%22%3A%22Core%22%2C%22zone%22%3A%22LAN%22%2C%22ha%22%3A%22Stack%22%7D%2C%7B%22name%22%3A%22SW-P1%22%2C%22type%22%3A%22switch%22%2C%22zone%22%3A%22LAN%22%7D%2C%7B%22name%22%3A%22SW-P2%22%2C%22type%22%3A%22switch%22%2C%22zone%22%3A%22LAN%22%7D%2C%7B%22name%22%3A%22AP-01%22%2C%22type%22%3A%22ap%22%2C%22zone%22%3A%22LAN%22%7D%2C%7B%22name%22%3A%22PCs%20floor%201%22%2C%22type%22%3A%22pc%22%2C%22zone%22%3A%22LAN%22%7D%5D%2C%22links%22%3A%5B%7B%22a%22%3A%22Internet%22%2C%22b%22%3A%22FW-01%22%2C%22pb%22%3A%22wan1%22%2C%22ip_b%22%3A%22200.1.1.2%2F30%22%7D%2C%7B%22a%22%3A%22FW-01%22%2C%22b%22%3A%22WEB-01%22%2C%22pa%22%3A%22port3%22%2C%22ip_a%22%3A%22172.16.0.1%2F24%22%2C%22pb%22%3A%22eth0%22%2C%22ip_b%22%3A%22172.16.0.10%2F24%22%2C%22label%22%3A%22DMZ%22%7D%2C%7B%22a%22%3A%22FW-01%22%2C%22b%22%3A%22CORE-01%22%2C%22pa%22%3A%22port1%22%2C%22ip_a%22%3A%2210.0.0.1%2F30%22%2C%22pb%22%3A%22Te1%2F0%2F1%22%2C%22ip_b%22%3A%2210.0.0.2%2F30%22%7D%2C%7B%22a%22%3A%22CORE-01%22%2C%22b%22%3A%22SW-P1%22%2C%22pa%22%3A%22Te1%2F0%2F10-11%22%2C%22pb%22%3A%22Te1%2F0%2F1-2%22%2C%22label%22%3A%22Po10%22%2C%22kind%22%3A%22port-channel%22%7D%2C%7B%22a%22%3A%22CORE-01%22%2C%22b%22%3A%22SW-P2%22%2C%22pa%22%3A%22Te1%2F0%2F12%22%2C%22pb%22%3A%22Te1%2F0%2F1%22%7D%2C%7B%22a%22%3A%22SW-P1%22%2C%22b%22%3A%22AP-01%22%2C%22pa%22%3A%22Gi1%2F0%2F1%22%2C%22label%22%3A%22VLAN%2030%22%7D%2C%7B%22a%22%3A%22SW-P1%22%2C%22b%22%3A%22PCs%20floor%201%22%2C%22pa%22%3A%22Gi1%2F0%2F2-24%22%2C%22label%22%3A%22VLAN%2010%22%7D%5D%7D ## 3. Tips for good diagrams - Keep the user's names, interfaces and IPs exactly as given; never invent addresses they did not ask for. - One node per physical/logical device; group users or phones in one node ("PCs floor 1"). - Use `zone` for sites, DMZ, LAN, VLAN groups; keep each device in one zone. - Use `kind: "port-channel"` for LACP/EtherChannel bundles and put the bundle in `label` (Po10). - Let the editor do the layout; add `layer` only to force an order (0 = Internet/WAN, 1 = edge, 2 = core, 3 = access, 4 = endpoints). - Put IPs on the cable ends (`ip_a`, `ip_b`) and loopbacks/management IPs in `notes`. - Give every node a `type`: the rows of the drawing come from it (internet, router, firewall, l3, switch, server, pc...). - Multi-site designs (site-to-site VPN, SD-WAN, HQ + branches): put each site's devices, including its own ISP/Internet clouds, in one `zone` per site (e.g. "SITE A", "REMOTO A"), or use a separate zone like "WAN SITE A" for the ISPs. Name the clouds per site ("SITE A ISP1") — repeated names in different zones also work. - Several tunnels between the same two firewalls: one link per tunnel, each with its own `label`, `pa`/`pb` and IPs. - Keep `label` short (e.g. "IPsec 1 | eBGP 65001-65002"); put long explanations in `notes` or `detail`. ## 4. Full editor format Files saved by the editor (File > Save / Export JSON) use the full format: `nodes[]` with `id`, `t`, `x`, `y`, `links[]` with `a`/`b` ids. Example: https://topologia.app/ccna/json/router-on-a-stick.en.json — it is also accepted by `#json=`, `#z=` and Import JSON. For new diagrams, prefer the simple format.