Hi guys , i just wanted to take a look inside special devices in the linux kernel , especially the loopback .
It’s a virtual device that comes with the network stack , as we talked in previous articles (https://medium.com/@garciaj.uk/the-network-stack-153c92e35b26) the network stack refers to “struct net” . To recap every time we create a new network namespace we are instantiating a struct net .
So that’s the first step , the second step is that the loopback device is implemented as a driver as far as i can see , so most of its methods are implemented in https://github.com/torvalds/linux/blob/master/drivers/net/loopback.c.
So let’s take a look at the transmit function:
In the next article I would like to investigate how packets and frames look in the kernel , we have talked about sk_buffs (skb) before so that’s the clue really. Let me know if you’d like to investigate other parts but I think it’s important to learn as much as we can about namepsaces and kernel isolation due to the popularity of containers etc.
What you think?