ezequiel.is-a.dev
Open the demo

Project · 2026

Trenza

A web viewer for Packet Tracer files and network captures. I built it so someone outside networking can open a network and understand it without installing anything. This is how it reads a format nobody documented, and what I decided so the diagram makes sense.

Built with
JavaScript, no dependencies
Runs in
The browser, no backend
Opens
.pkt, .pka, .pkz, .pcap and .pcapng
Trenza with the sample network open: the device list, the network diagram and the summary.
The sample network is the supermarket I designed in 2023, open in Trenza.

The problem

A Packet Tracer file only opens in Packet Tracer: you have to install the program and sign in, even just to look at a network. If I send a network to someone outside the field, they can't see it. Trenza opens it in the browser, and the file is read on the visitor's own computer: it never gets uploaded to a server.

Four layers

The .pkt format is undocumented. Two projects worked it out before me, pka2xml and ptexplorer; I reimplemented the reading in JavaScript so it runs in the browser. Inside there is an XML file wrapped in four layers, which Trenza undoes in reverse order:

  1. An outer obfuscation: the file is reversed, and every byte goes through an XOR with a value that depends on its position and on the total length.
  2. Twofish in EAX mode, with a fixed key and nonce: 16 bytes of 0x89 and 16 bytes of 0x10.
  3. Another obfuscation, by position, over the decrypted text.
  4. zlib, with the uncompressed size in the first 4 bytes.

Browsers don't ship Twofish: WebCrypto doesn't include it. I wrote it by hand and test it against the vectors from the original paper. zlib is handled by DecompressionStream, which is what sets the supported browsers: Safari 16.4, Chrome 80 and Firefox 113 and up. Files from older versions only have the last two layers, and a .pkz is a ZIP with the .pkt inside; Trenza opens all three.

From XML to a network

With the XML in hand, a different job starts. Device positions are the ones Packet Tracer saved, so the diagram looks like the one its author built. Some data has to be cross-referenced: for VLANs, the XML stores the number and the name, but which port belongs to which comes from each switch's running-config. And up to version 5 devices have no identifier, so links refer to them by their place in the list.

Making it readable

In a network diagram the hard part is the labels. The widest one is almost always the IP address, and it decides how far apart the devices go. That's why it uses a condensed typeface: it takes less room and, on the same screen, comes out larger.

The drawing width is found by trying steps of 50 units until no label overlaps another. A binary search doesn't work, because the result isn't monotonic: widening also changes the vertical spacing. With steps of 300 the search skipped the right size and the text ended up 42% smaller. No label is ever hidden: the layout is decided once when the file opens, and zooming only scales it.

Making it fast

How I test it

I tested it with real files saved in Packet Tracer 5.3.3, 7.2.1, 7.3.0, 7.3.1, 8.1.0, 8.2.1 and 9.0.1, from 2 to 72 devices, and with the same files saved as .pkz. The automated tests, with node:test, cover decryption, reading captures and device configurations, and the diagram layout, and they run on every push.

What it doesn't do

It's only a viewer: editing or simulating a network still takes Packet Tracer.

Trenza is an independent project, not affiliated with the maker of Packet Tracer.