Monitor Network Traffic using Microcontroller

Hello,
I am a PhD student working on Detection of sensor-based attacks using TinyML
I have a question If you please could help me with it:

I am planning to build a tiny security model on microcontroller that should detect cyber attacks, my model detects network attacks, my question is when I deploy my model on the microcontroller, how can I make my microcontroller access/monitor the network traffic to detect these attacks, which I think it can only sees sensor data.

Thank you in Advance.