LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-17-2016, 08:05 AM   #1
Yu Watanabe
LQ Newbie
 
Registered: Jul 2016
Posts: 2

Rep: Reputation: Disabled
How is MAC address information loaded to the kernel?


Hello !

It is my first time posting a question and I appreciate if someone can help me about with my questions.

I am now trying to find out how MAC address of network device is loaded to kernel.

OS I am using is Cent OS 6.8 64 bit .

I see that whenever device is inserted , kernel automatically recognizes the device and stores information under

/sys/class/net/xxx


Questions I would like to ask are,

Q1 Is

/sys/class/net/xxx

created by udevd when the device is inserted to the server?

Q2 ip link command shows that Layer 2 information is automatically loaded. Below is the example of usb network device.

[root@base ~]# ip link show enp0s20u1
33: enp0s20u1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
link/ether 74:03:bd:3d:ac:84 brd ff:ff:ff:ff:ff:ff
How is above information loaded into kernel? Is there a process that loads it from the /sys/class/net/xxx through udev database?

Thank you for reading.
 
Old 07-17-2016, 09:24 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,508
Blog Entries: 4

Rep: Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954Reputation: 2954
If it is a USB device (of any sort ...) then the "hotplug" mechanism that will be activated first. Upon receipt of a "device inserted" notification, it queries the manufacturer and device-type information signature to determine what sort of device it is, then executes appropriate scripts to fully configure it.

If you poke around a bit, you can find the exact script that is executed.

Most likely, a kernel module is selected and loaded, and it actually communicates with the device to retrieve the MAC address and so forth. Hotplug is a user side utility that runs with root privileges.

Last edited by sundialsvcs; 07-22-2016 at 07:39 AM.
 
1 members found this post helpful.
Old 07-21-2016, 07:30 PM   #3
Yu Watanabe
LQ Newbie
 
Registered: Jul 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
If it is a USB device (of any sort ...) then the "hotplug" mechanism that will be activated first. Upon receipt of a "device inserted" notification, it queries the manufacturer and device-type information signature to determine what sort of device it is, then executes appropriate scripts to fully configure it.

Thank you for the reply!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using arp for converting ip address to mac address in kernel module programing in c karan2386 Linux - Kernel 1 03-31-2012 05:02 AM
information dynamic MAC address assignment data link layer ( patent holder qualcomm ) aux General 1 05-07-2008 02:22 AM
How to get MAC address information on RedHat using nmap command Uday123 Linux - Networking 1 02-09-2006 11:33 PM
Mac Address information alltime Linux - General 1 10-02-2005 07:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration