Recently my project need a lightweight network monitor tools to peek at the network activity, some basic requirements was list as following:
Provide basic network/interface SDK to the application.
The service need provide the report on activities on the network, like
interface modification, add/del/modify including ip changes, mac changes, new interface added, etc
network connectiong status, stale/reachable
Extensibility and decouple serive and client, easy to intergrate other service.
Lightweight, less CPU usage and memory usage.
After google some open source projects, I found it seems like no one can fit my requirement, but the iproute2 project was quite fit my requirement. So, why we don’t make iproute2 as a library?
I list the Pros and Cons if use iproute2 as library:
Pros:
No need to write the socket layer code.
More or even more information about network interfaces can be got. Same functionality with the iproute2 tools.