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


  Search this Thread
Old 04-07-2009, 12:36 AM   #1
Registered: Jun 2008
Posts: 82

Rep: Reputation: 15
Data communication between L4 (TCP) layer to application layer

In Linux,TTCP (L4), IP (L3) and L2 (MAC) are implemented in Linux Kernel. When packaet is received at NIC, NIC driver creates sk_buff and fill the data and passed to L3 (based on protocol registered with kernel for L3). and L3 passed sk_buff to L4 (TCP).
Can some body tell me how data from sk_buff from L4 is passed to Application or vice versa (how application delivers data to L4 and ad at what point sk_buff struct is created)

Please help.
Old 04-07-2009, 10:09 AM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
The usual way for application code to send and receive TCP/IP data is via the socket() interface.
--- rod.
Old 04-08-2009, 12:16 AM   #3
Registered: Jun 2008
Posts: 82

Original Poster
Rep: Reputation: 15
That I know... my question is how does it work... I'm looking for data path.
Old 04-12-2009, 03:50 PM   #4
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,575

Rep: Reputation: 181Reputation: 181
It depends slightly on the protocol. When you have a datagram protocol (UDP), socket buffer keeps packets as they were received. The data is copied to user space when requested using read(), readfrom() and such. When an application delivers data to a datagram socket, generally one write equals one packet, so the translation is simple.

The thing with stream-based sockets (TCP) is more complicated. User data may be buffered for some time and that buffer is used to create packets. The other way is similar.


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
Passing info from MAC to network layer (cross layer) tassadaque Programming 1 12-31-2008 03:22 PM
Passing the message/packet from layer to layer in OSI Or Unix. dina3e Linux - Networking 8 08-12-2008 05:15 PM
What DVD recorders/writers burn dual-layer/double-layer DVD's under Linux? bgoodr Linux - Hardware 5 02-06-2008 04:30 AM
simple way to make k9copy shrink dual layer to single layer DVD replica9000 Linux - Software 2 12-06-2007 03:41 PM
Dual Layer ISO onto 2 Single Layer Medias iammike SUSE / openSUSE 3 05-11-2005 06:15 PM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:13 AM.

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