Re: New Network stack!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 20, 2001 at 02:15:23PM -0300, Fernando Barreto wrote:
> 	Hi...
> 
> 	I'm working to do a new network stack... I can now receive my
> packets throught the wire without any problems, but: How can I transfer
> one packet that arrived to one process? And how can I block the process
> until the data arrive to the device driver, or until the data become
> already transmited?
> 	Is there anywhere in the kernel that can I find this
> implementation?


	net/core/dev.c
	net/ipv4/ -- lots --

	Follow the call of  netif_rx()  at the ethernet card RX path
	INSIDE THE INTERRUPT CONTEXT.   See how it puts things into some
	queue, and triggers a BH instance, and returns away.

	Triggered BH is actually  net_rx_action(),  which continues with
	processing of the packet -- doing diversions, fastroute,
	bridging, and finally looking up the Ethernet content TYPE
	field (first 2 bytes of the frame after the MAC addresses).
	When a matching one is found, associated protocol processing
	receiver function is called.

	See at first how IPv4 does init itself by registering different
	levels of protocols.  Then observe the processing path of for
	example  UDP frames.

	I wonder what "data already transmitted" means ?
	Shall the caller stop until the remote end acks having received
	the data ?  Or is there some flow-control and kernel side buffering ?
	(Ever heard of TCP of the IP suite ?)

	Whatever, the answer is most likely used deep inside the TCP, and
	UDP codes of IPv4 protocol family.


> 	I'm thinking to mask one sys_call of the system to do that... Is
> it the better way?

	Definitely.  Register your protocol as AF_XYZ with numeric value
	that is not presently in use.   Make it "just another socket
	protocol family."

> 	Thanks for any help...
> :-)

/Matti Aarnio
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux