LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 04-06-2009, 11:36 PM   #1
Mr.J
Member
 
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.
James
 
Old 04-07-2009, 09:09 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
The usual way for application code to send and receive TCP/IP data is via the socket() interface.
--- rod.
 
Old 04-07-2009, 11:16 PM   #3
Mr.J
Member
 
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, 02:50 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,537

Rep: Reputation: 149Reputation: 149
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.
 
  


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


All times are GMT -5. The time now is 08:18 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration