Sponsored Content
Special Forums IP Networking Network interface layer in Linux kernel Post 302967185 by nick_kd on Saturday 20th of February 2016 04:40:41 PM
Old 02-20-2016
Network interface layer in Linux kernel

Dear all,

lets say a linux based computer(debian) with ethernet,wifi, usb modem connected to the, linux kernel version is 3.3

Question:
  1. for each network device the network driver builds its own net_device struct and register itself with the network interface layer of the kernel.

    Code:
    struct net_device net_dev[3] = {
        {init: ethernet_init,},
        {init: wifi_init,},
        {init: usbnet_init,},
    };
    
    register_netdev(net_dev[0]);
    register_netdev(net_dev[1]);
    register_netdev(net_dev[2]);

    so in total there are 3 network devices as seen by the kernel
    now how does the kernel decide to which network interface. to use while forwarding IP packet.

    can some one please specify any link or document which answers the above question ?

Last edited by Scrutinizer; 02-20-2016 at 05:45 PM.. Reason: code tags
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Network Interface

Hi ! Does anyone know how can i get information about my network interface ... if it works in half or full duplex mode !! Thx in adivance ! Witt (4 Replies)
Discussion started by: witt
4 Replies

2. UNIX for Advanced & Expert Users

Network interface in Linux kernel

Hi, I wrote some network modules to 2.6.x Linux kernel. Im useing sock_recvmsg / sock_sendmsg (linuxsrc/include/linux/net.h ) interface to receiving and sending data in TCP mode. Im cooperating with HTTP protocol and I have a question. Supose that I have buffer I have connection client -... (2 Replies)
Discussion started by: marcintom
2 Replies

3. Solaris

What are the kernel parameter of network interface in Solaris?

Hi gurus Could anybody tell me that what are the kernal parameter of network interface in solaris Regards (3 Replies)
Discussion started by: girish.batra
3 Replies

4. Solaris

configure zones to have different network interface and network

i need to configure a zone to use different interface (bge2) than global and have connected to completely different network switch & to use its own defaultrouter and hosts file .. is it possible ..if so ..how ? Thanks (9 Replies)
Discussion started by: skamal4u
9 Replies

5. UNIX and Linux Applications

Access to network interface (Mac-network)

Hi, I'm a italian student. For my thesis I develop a gateway with protocol 6lowpan. For that I must access to network interface to develope my personal stack based on standard 802.15.4. Can you help me? I need an explanation for that. (0 Replies)
Discussion started by: berny88
0 Replies

6. IP Networking

Network interface-

Hello, Please what's the difference between: AND Thank you so much (3 Replies)
Discussion started by: chercheur857
3 Replies

7. IP Networking

network interface -

Hello, Please, how can i create a network interface with a routable IP address on linux (ubuntu) ? AND How can i desactivate an interface? Thank you so much for help. (1 Reply)
Discussion started by: chercheur857
1 Replies

8. Solaris

No network cable But Network interface is UP and Running

I've one Netra 240 After changing main board and system configuration card reader, Network is not accessible any more, Network interfaces are always UP and Running even when there is no cable connected to Network interfaces. I tried to restart and plumb/unplumb with no luck. ifconfig -a... (7 Replies)
Discussion started by: samer.odeh
7 Replies

9. UNIX for Dummies Questions & Answers

Adding a network interface to a bonded interface

I have a RHEL 5 system with a bonded interface configure using only one network port (eth0). So I have config file for ifcfg-bond0 and ifcfg-eth. I'd like to configure eth5 to be the second SLAVE in the bond. My question is, after I modify ifcfg-eth5, can I add eth5 to the bond0 interface without... (1 Reply)
Discussion started by: westmoreland
1 Replies
veth(4) 						     Linux Programmer's Manual							   veth(4)

NAME
veth - Virtual Ethernet Device DESCRIPTION
The veth devices are virtual Ethernet devices. They can act as tunnels between network namespaces to create a bridge to a physical network device in another namespace, but can also be used as standalone network devices. veth devices are always created in interconnected pairs. A pair can be created using the command: # ip link add <p1-name> type veth peer name <p2-name> In the above, p1-name and p2-name are the names assigned to the two connected end points. Packets transmitted on one device in the pair are immediately received on the other device. When either devices is down the link state of the pair is down. veth device pairs are useful for combining the network facilities of the kernel together in interesting ways. A particularly interesting use case is to place one end of a veth pair in one network namespace and the other end in another network namespace, thus allowing communi- cation between network namespaces. To do this, one first creates the veth device as above and then moves one side of the pair to the other namespace: # ip link set <p2-name> netns <p2-namespace> ethtool(8) can be used to find the peer of a veth network interface, using commands something like: # ip link add ve_A type veth peer name ve_B # Create veth pair # ethtool -S ve_A # Discover interface index of peer NIC statistics: peer_ifindex: 16 # ip link | grep '^16:' # Look up interface 16: ve_B@ve_A: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc ... SEE ALSO
clone(2), network_namespaces(7), ip(8), ip-link(8), ip-netns(8) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2018-02-02 veth(4)
All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy