Skip to contentSkip to conversation

Question about net subsystem

DISCUSSION zhanglx 2 participants 2 messages Jul 22, 2010 – Jul 23, 2010

lore
Share & tools
lore

zhanglx

author
#0 lore raw

hello,

I have some questions about net subsystem.

Does the kernel code store the IP address of local machine, in which variable?

If there are two net cards, then there will be two IP and MAC address, how will the kernel store them? When there are two net cards, which card will the PC use to connect to net.

Does the webbrowser such as Firefox also use the series of functions( sock(), connect(), send(),receive()...) to connect to internet?

Thanks, zhanglx�翳簕.n�+壏煯壄�+%娝�遍荻w�簕.n�+壏{炳G珴�妠ay�蕠跈�,jf"穐殢飦�戧鐉_璁(殠娸"濟�m���G珴�⒏?櫒璀�&x忈秈O曟瑉窔v豝�m��� �鹅�⒏?朓�

#1 lore raw
Quoted 5 lines · zhanglx

hello,

I have some questions about net subsystem.

Does the kernel code store the IP address of local machine, in which variable?

Yes, it is in a per-interface struct, you must be interested in how SIOCGIFADDR is handled.

Quoted 3 lines

If there are two net cards, then there will be two IP and MAC address, how will the kernel store them? When there are two net cards, which card will the PC use to connect to net.

This depends on your route table. :)

Quoted 2 lines

Does the webbrowser such as Firefox also use the series of functions( sock(), connect(), send(),receive()...) to connect to internet?

Sure.

Hope this helps.