Console #154 - An Interview with Giuliano of Sniffnet - Rust app to easily monitor network traffic
Featuring bloop, highlight, and Sniffnet
🤝 Sponsor - Deel
Compliantly hire anyone, anywhere, in 5 minutes with Deel
Deel is your one-stop shop for hiring, paying, and managing your remote team. We stay on top of local labor laws across the world to ensure compliance and mitigate risk so that you don't have to.
Browse through open source projects on OpenSourceHub.io, add your project to get more exposure and connect with other maintainers and contributors!
bloop is a fast code search engine written in Rust.
language: TypeScript stars: 4024 last commit: 2 days
The open source, full-stack monitoring platform. Error monitoring, session replay, logging and more.
language: TypeScript stars: 3289 last commit: 2 days
Application to comfortably monitor your network traffic.
language: Rust stars: 4884 last commit: yesterday
Join thousands of other open-source enthusiasts and developers in the Open Source Hub Discord server to continue the discussion on the projects in this week's email!
🎙️ Interview With Giuliano of Sniffnet - Rust app to easily monitor network traffic
Hey Giuliano! Thanks for joining us! Let us start with your background.
Hi! My name’s Giuliano and I’m a Cybersecurity Master student from Polytechnic University of Turin in Italy.
As a student in his last semester of Master’s Degree, I don’t have past working experiences.
I learnt programming at University, where we are given solid and general basics about a variety of programming concepts: from advanced algorithms to OOP, databases, data science, architectures and so on.
I had the luck of getting introduced to Rust during a course last year. I liked it a lot and started learning it into detail while developing Sniffnet.
Who or what are your biggest influences as a developer?
Open source developers in general are one of my biggest inspirations.
It’s amazing to see how those people give most of their free time to the community, often without asking for anything back.
I think that passion is the most important thing to put in what we do, and OSS developers are a really good example for that.
What's an opinion you have that most people don't agree with?
I don’t like music. I prefer silence or the sound of nature.
People always look at me like I was crazy when I say I don’t listen to music ahaha.
What’s your most controversial programming opinion?
Graphical User Interfaces in Rust are the future.
I don’t know if it’s really controversial, but of course it’s not really popular.
What are you currently learning?
I’m currently following the last course of my degree, digging into Kotlin, Spring Boot, and Docker for the development of web applications.
Why was Sniffnet started?
Sniffnet was born as an academic project in the scope of the course of System and Device Programming of Polytechnic University of Turin.
It was originally just a command line interface to save the observed network traffic to an output file.
After the delivery of the project, I kept working on it, developing a GUI and adding more and more functionalities to it.
How does Sniffnet work?
Sniffnet is a software network monitoring tool to analyze network traffic.
Sniffnet works by configuring a network interface in promiscuous mode, capturing in this way all the traffic flowing through it.
Sniffnet analyzes the header of all the received network packets, gathering the relevant information and logging it in real-time.
Information is then elaborated and represented in a user-friendly way, to be immediately consulted and understood by the users.
What information does it log?
Packets number, size, IP addresses, transport protocol, transport ports, start and final timestamps.
Packets are then grouped by connection (represented by source and destination IP addresses, source and destination transport ports and transport protocol) and each connection is then shown with the aggregate statistics.
Sniffnet also infers other data from the collected information, such as the country which is inferred from the remote IP address of a connection.
Why did you pick Rust for this?
Rust is the programming language used to develop Sniffnet in its entirety, from its business logic aspects to its graphical user interface.
It’s not so common to use Rust also for frontend development: GUI libraries written in Rust are not many and most of the existing ones are not in their stable release yet (including Iced, the library I decided to use).
I decided to pick Rust because of its guarantees in terms of memory safety, its ability to provide programmers with zero-cost abstractions, and because I wanted to be able to code a multithreading application without incurring in weird undefined behaviors: many concurrency issues in Rust are compile-time errors rather than run-time faults and as a result, programmers can fix their programs while developing rather than after they have already been shipped to production.
What are some issues/disadvantages you are facing due to Rust GUI libraries?
Iced does't currently support advanced text handling, and as a consequence it doesn't let me use emoji (I used tiny PNGs for the country flags) and it doesn't make it possible to select text with the cursor. Moreover, some widget must be built manually (e.g., the table and the overlays). Finally, I'd say that another small issue is the lack of animation support, which makes some transitions not so smooth. However, they are currently working hard to support these and more feature, so it'll be fun to grow together with their improvements.
Where did the name for Sniffnet come from?
Network monitoring tools are commonly known as packet sniffers because of their ability to capture network packets.
Sniffnet is the fusion of two words: sniffer + network.
I chose this name because it’s able to convey in one word the aim of the application.
Who, or what was the biggest inspiration for Sniffnet?
Wireshark is without a doubt my biggest inspiration.
Wireshark is the de-facto standard when speaking about network monitoring tools, and I couldn’t avoid being influenced by it.
Are there any overarching goals of Sniffnet that drive design or implementation? If so, what trade-offs have been made in Sniffnet as a consequence of these goals?
The main goal of Sniffnet is to be simple and easy to use.
As a consequence, I had to sacrifice more advanced aspects of network monitoring, such as deep packet inspection.
What is the most challenging problem that’s been solved in Sniffnet, so far?
One of the most annoying problems was to support many languages (Sniffnet now supports 13 different languages) without making the binary size too high.
The problem resided in the fact that iced, the Rust library I use for the GUI, doesn’t yet support font fallback, and therefore a font file with the used characters must be supplied.
Introducing languages with not common glyphs such as Chinese, Korean, and Russian put me in front of the problem of having a font file for each of those languages, but it wasn’t affordable since the binary size would have been raised too much just to support new translations.
As a solution, I figured out that I could grep only the used characters and match the original, complete font files against them.
In this way, I don’t need to have, for example, all the 80k+ chinese glyphs but I keep only the ones that are actually appearing in the translation.
Are there any competitors or projects similar to Sniffnet? If so, what were they lacking that made you consider building something new?
The vast majority of network monitoring tools available are in the form of CLI that are not so pleasing/easy to use.
Even Wireshark, despite having a GUI, is not usable without pain by non-technical people.
Existing packet sniffers have lots of functionalities, far more than Sniffnet which is in its early stages, but they lack the ability of being immediate to be understood and accessible to everyone.
Sniffnet was born from the need of having a tool able to display the relevant information at a glance, in a straightforward way.
What is your typical approach to debugging issues filed in the Sniffnet repo?
Being Sniffnet a cross-platform app, the first thing to do is to be sure to understand which is the operating system on which the problem occurred. After that, I must say that most of the problems reported so far were due to the users missing some required dependency to run Sniffnet, which does not require debugging because they are known problems.
When problems of other kinds are raised, it’s always been pretty easy to understand the cause since I’m the only maintainer of the code and this helps in knowing the possible root causes of the issues.
What is the release process like for Sniffnet?
Before every release, I take care of building the app bundles for macOS, Windows and Linux.
I update the CHANGELOG file including new features, improvements and fixes.
I make sure that dependencies are up to date thanks to github dependabot and I ensure that all the tests and semantic checks are on point.
I update github milestones with the solved issue or move the unsolved issues to a new milestone.
Finally, I publish the release draft including the binaries, publish the app on crates.io (the Rust package manager), and share the new version with the community.
Is Sniffnet intended to eventually be monetized if it isn’t monetized already?
Sniffnet is not currently monetized yet. To be completely honest, I have one individual sponsor on GitHub but you can understand that 2$ per month is not enough to call it a source of revenue.
However, I’ve recently got selected with Sniffnet for the GitHub accelerator Program, getting a one-time important sponsorship from GitHub itself.
The main goal of the Accelerator is to help us to build durable streams of funding, so I truly hope that Sniffnet will be constantly monetized soon, e.g. by corporate sponsors or enterprise partners sharing my vision of a more accessible internet traffic monitoring.
What are you most proud of?
One of the things I’m most proud of is Sniffnet's rapidity in getting traction on GitHub compared with other popular network analyzers, and in an era which seems only dominated by the interest in AI.
Although I’m aware that GitHub stars are not the only/most reliable metric to evaluate a project’s goodness, this result makes me extremely proud and happy!
How did it get popular in such a short time?
The fact that it is developed in Rust played a great role in my opinion. Another key ingredient is that it's simple to learn/use and it can be appreciated by anyone.
Furthermore, after v1.0.0 was published, Sniffnet got featured in heise.de (a popular German IT online newspaper) From that point on, Sniffnet get more and more traction, being also tweeted by GitHub itself
How do you balance your work on open-source with your university and other responsibilities?
It’s been hard to balance the University routine with Sniffnet programming during the past months. I often ended up coding at night or skipping lectures.
With the GH Accelerator, and thanks to the fact that I just have one more university course to follow, I can now dedicate more time to Sniffnet development.
Have you ever experienced burnout? How did you deal with it?
I’ve taken Sniffnet as a hobby until the election for GH Accelerator.
I sacrificed a lot of my time but I cannot say I’ve experienced burnout: if you consider it as a passion rather than a job, you enjoy it, no matter what.
If you plan to continue developing Sniffnet, where do you see the project heading next?
I want to continue developing Sniffnet, adding more in-depth functionalities without sacrificing its ease of use.
I’m working to introduce reverse DNS lookups, autonomous system names of the remote addresses, support for ICMP, and more.
What motivates you to continue contributing to Sniffnet?
The main driver is seeing the community showing its appreciation for Sniffnet, this is what pushes me to improve it every day.
Furthermore, it’s my dream to be able to keep working on Sniffnet full-time even after the end of the GH Accelerator, so I’ll do my best to make it happen.
Where do you see open-source heading next?
I wish open source will benefit from more initiatives like the GH Accelerator.
As previously said, OSS developers often do it for free, but I think it’s not sustainable in the long run.
I hope that in the future we’ll be able to make a living out of full-time open sourcing as we do with any other job.
Do you have any suggestions for someone trying to make their first contribution to an open-source project?
Just don’t be afraid of doing something wrong.
Maintainers will appreciate your efforts and the time you put into their projects regardless of the outcome!
Want to join the conversation about one of the projects featured this week? Drop a comment, or see what others are saying!
Interested in sponsoring the newsletter or know of any cool projects or interesting developers you want us to interview? Reach out at firstname.lastname@example.org or mention us @ConsoleWeekly!