Wireshark dissector for the Cafu Engine network protocol

News about the Cafu Engine. Subscribe to the related ImageCafu News feed to stay informed.
User avatar
Carsten
Site Admin
Posts: 2007
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Wireshark dissector for the Cafu Engine network protocol

Postby Carsten » 2012-06-02, 12:13

My recent work for improving the game and entity code turned out to have a large effect on the networking layer in the Cafu Engine as well: Moving the serialization and deserialization of entity state from the management code into the entities themselves is the first key step to achieve the desired improvements in code design, as it cleanly separates entity from network implementation details.

During my work in this regard, I found it highly useful to employ Wireshark for analyzing the network packets that a Cafu client and server actually exchange. In the past, when the Cafu network protocol was initially developed, we used Wireshark only for capturing the network traffic, optionally prefiltering it, and to save it to disk. Then we used our own, hand-written C++ program "ReadDump" for analyzing the resulting dump file.

However, it turned out that both maintaining and even using the "ReadDump" program was very inconvenient and in fact rather painful - and it took not long until it became outdated: not able to read the latest version of the Cafu network messages, and thus useless.

As a result, last week I dug myself into Wireshark again, and much to my joy found that they have a (relatively) new feature that allows to write dissectors for analyzing any given protocol in our favorite scripting language Lua.

As a result, we can have the Cafu Engine network protocol dissected and analyzed directly in Wireshark. Even though my first attempt at such a dissector is probably somewhat clumsy and certainly still incomplete, it already turned out to be a lot more convenient to use than our previous tool, leads to insights much faster, and as a result, is a lot more helpful.

Here is an example screenshot from one of my sessions:
wireshark-session.png


If you would like to see the related Wireshark dissector itself, here is the script file (which also has additional links if you're interesting in further technical details):
http://trac.cafu.de/browser/cafu/trunk/ ... k-cafu.lua

In summary, a Cafu-specific dissector for Wireshark helped me a lot with making the changes to the network protocol that we need to advance our game code. I've finished many of these changes already, and will commit them to our code repository in the next few days.
Best regards,
Carsten
HWGuy
Posts: 95
Joined: 2011-05-31, 07:37

Re: Wireshark dissector for the Cafu Engine network protocol

Postby HWGuy » 2012-06-02, 16:37

It's great Cafu's netcode is getting updated and cleaned up, especially since everyone who's interested in Cafu is interested in networked games/sims.
User avatar
Carsten
Site Admin
Posts: 2007
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Wireshark dissector for the Cafu Engine network protocol

Postby Carsten » 2012-06-03, 22:27

HWGuy wrote:It's great Cafu's netcode is getting updated and cleaned up, especially since everyone who's interested in Cafu is interested in networked games/sims.


Yes, and it seems that every new developer first looks into the game and entity code, which is very understandable, but - so far - gave no good initial impression.
:cheesy:

All the more important are these changes.
Best regards,
Carsten

Return to “News and Announcements”

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests