This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| network_stuff:linux_network_internals [2018/10/28 18:38] – created jotasandoku | network_stuff:linux_network_internals [2023/11/02 14:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ---- | + | LINUX KERNEL NETWORKING: |
| - | **LINUX INTERFACES**\\ | + | \\ |
| - | Always use the -d flag when deailing with the netlink api: | + | Linux has Two main APIs for networking: |
| - | | + | |
| - | | + | |
| + | * **[[https:// | ||
| + | * Netlink in python: [[https:// | ||
| - | NETLINK (successor of ioctl): api (no restapi), system call. Is the way ip route talks to the kernel. socket family is a Linux kernel interface used for inter-process communication (IPC) between both the kernel and userspace processes, and between different userspace processes, in a way similar to the Unix domain sockets. NETLINK_ROUTE , NETLINK_ARPD , NETLINK_NETFILTER ... | + | {{ :network_stuff: |
| + | * Do not confuse it with NETFILTER (~iptables). | ||
| + | * iproute2 is more a set of **utililities** (arpd, bridge, devlink, ip, nstat, routef, rtacct, rtmon, | ||
| + | |||
| + | |||
| + | ---- | ||
| Place to find all information about interface is this, they are netdev, not just dev: | Place to find all information about interface is this, they are netdev, not just dev: | ||
| Line 16: | Line 23: | ||
| TODO\\ | TODO\\ | ||
| ... kernel objects and udev, and details of implementing logical interfaces that are associated with ASIC front-panel physical ports. From this discussion: [[http:// | ... kernel objects and udev, and details of implementing logical interfaces that are associated with ASIC front-panel physical ports. From this discussion: [[http:// | ||
| + | |||
| + | \\ | ||
| + | |||
| Interface can or cannot be related to physical port.\\ | Interface can or cannot be related to physical port.\\ | ||
| Linux labels them according to the PCI name, UUID can be used to rename them. udev, driver..\\ | Linux labels them according to the PCI name, UUID can be used to rename them. udev, driver..\\ | ||
| CPU-PCI BUS (unique) driver enumerates > port1,2,3 ... | CPU-PCI BUS (unique) driver enumerates > port1,2,3 ... | ||
| - | |||
| Then udev/uuid is used to map the name/rename the port name on boot time | Then udev/uuid is used to map the name/rename the port name on boot time | ||
| - | \\ | ||
| + | ---- | ||
| + | |||
| + | Always use the -d flag when dealing with the netlink api: | ||
| + | ip -d link show wlp2s0 | ||
| + | ip add show | egrep " | ||
| + | |||
| + | * Interaction user-space >> kernel | ||
| + | * Existing system call | ||
| + | * ioctl | ||
| + | * /proc file | ||
| + | * NETLINK socket? | ||
| + | |||
| + | ---- | ||
| + | |||
| + | * **eBPF [[https:// | ||
| + | * BPF is the in-kernel bytecode machine that can be used for tracing, virtual networks, and more. Alexei Starovoitov is the lead developer (he's now at Facebook), and there are developers from several companies contributing, | ||
| + | * P4 is very similar but needs compiling | ||
| + | |||
| + | ---- | ||
| + | |||
| + | OVS (Open VSwitch):\\ | ||
| + | [[https:// | ||
| + | |||
| + | ovs-vswitchd --help | ||
| + | | ||
| + | |||
| + | ---- | ||
| + | Kernel structs | ||
| + | \\ | ||
| + | * '' | ||
| + | * '' | ||