Capturing the packets…

GSOC Week 1–2 @SCoRe Lab

Dhruvi Doshi
SCoRe Lab
2 min readJun 28, 2022

--

The coding period officially began on 13th June’22 with a lot of excitement. Here is an update from week 1 & week 2 ….

Survey6 is a fresh project. The initial push that I required was provided by mentor Ravindu De Silva (Thanks) by creating a GitHub issue. The task at hand was to create first function of the code base : to collect, annotate and store the captured IPv6 packets on the probe. Fairly easy! Scapy helped me with collection and storage. Guess what I did with annotation? After breaking my head all over, I made system calls to annotate file metadata which I later got to know is local to the file system. What a rookie!

When I was pretty much done writing the piece of code, It was a mere 20 line function! I knew something was missing then. Even though size of code that we write is secondary, I had missed big time error handling! Absolutely, feel free to judge me. The point of me writing this blog is not to show how stupid one can be, instead, I intend to help someone from averting such mistakes and maybe understand that this is how we grow by making mistakes and having mentors to guide you out. I learnt a lot from the elaborate reviews by my mentors Ravindu De Silva and Maanas Talwar.

I improved upon error handling, error logging, project structure management and of course metadata annotation. Good coding practices also including usage of environment variables whenever we use variables. At some point during development you will need to think about the environment in which your application will run and the potentially sensitive or environment specific information your application will need to perform its tasks. Where I am required to transfer the files, annotating file’s system meta data won’t help. I had to make something portable. On receiving some advice on the same, we finally stored the metadata in a .json file.

In the second week, I made changes corresponding to all the reviews and the resulting code was a lottt better!!! I was indeed happy with the final code. By then I had also improved upon my writing style and I started figuring out the best practices of writing a python code. But the feeling of my first PR being merged was🔥.

Resources

Here is a list of some good resources that had helped me (just in case) :
1. Robust Error Handling
2. Using environment variables with python
3. Use this .gitignore template by GitHub

--

--