ezequiel.is-a.dev
Open the demo

Personal 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.

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 a teammate and I designed in a 2021 course, open in Trenza.

Why I built it

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 and 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), so 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

Device positions are the ones Packet Tracer saved, so the diagram looks like the one its author built. Other 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.

The labels

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, which takes less room and comes out larger on the same screen.

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

Speed

How I test it

I tested it with real files saved in Packet Tracer 5.0, 5.3.3, 7.2.1, 7.2.2, 7.3.0, 7.3.1, 8.1.0, 8.2.1 and 9.0.1, from 2 to 71 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.