The Linux Networking Stack Exposed
Posted by
CmdrTaco
on Mon Aug 13, 2007 11:02 AM
from the august-rules dept.
from the august-rules dept.
An anonymous reader writes "The Linux source code is a great way to learn about the design of device drivers for a multitude of device types, including network device drivers. This article will show you the basic architecture of the Linux networking stack and dig into its interfaces for system calls, protocols, and device drivers."
Related Stories
Firehose:The Linux networking stack exposed by Anonymous Coward
This discussion has been archived.
No new comments can be posted.
The Linux Networking Stack Exposed
|
Log In/Create an Account
| Top
| 69 comments
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.

well (Score:5, Funny)
Re:well (Score:5, Funny)
(http://www.sancairodicopenhagen.com/tbpmd.html)
Oh yeah?
So, a UDP connection walks into a bar and it goes up to the bartender.
"Hi bartender, " it says to the bartender.
"Howdy, UDP connection. What'll it be?" the bartender asks.
"I'll have a beer please. Here's a dollar," says the UDP connection.
The bartender takes the dollar, looks at the UDP connection, and continues wiping glasses.
"So, what'll it be?" the bartender asks the UDP connection.
The UDP connection forks over another dollar and orders a beer again. The bartender takes the dollar and stares expectantly at the UDP connection as he continues to wipe glasses.
"So, what are you gonna drink, little UDP connection?" the bartender asks.
"I would like a beer please," and the UDP connection gives the bartender yet another dollar. The bartender takes the dollar and promptly starts wiping the counter. He looks thatthe UDP connection and asks,
"Oh, hello there. Can I get you anything?"
"Yes please," responds the UDP connection, "I'd like a beer. Here is a dollar." And the UDP connection gives the bartender yet another dollar.
And so on...
Re:well (Score:5, Funny)
And when TCP walks into the bar and asks for beer bartender opens the tap and lets beer stream... But before that they have to shake hands three times.
Re:well (Score:4, Informative)
TCP : Can i get a beer ?
Bartender : You asked for a beer ?
TCP : Yes i did .
Bartender : Ok , here's the beer , that will be
TCP : did you just tell me how much to pay you ?
Bartender : yes i did .
TCP : ok , here's
and say the bartender has bad hearing ;
TCP : Can i get a beer ?
Bartender : You asked for a lemonade ?
TCP : no i didn't .
TCP : Can i get a beer ?
Bartender : Ok , here's the beer , that will be
TCP : did you just tell me how much to pay you ?
Bartender : yes i did .
TCP : ok , here's
TCP constantly verifies that the data was received , while udp only verifies that the data was correct . udp would end up with a lemonade , drink it , and just order a beer again .
Re:well (Score:4, Funny)
(Last Journal: Wednesday October 03, @08:46AM)
So, a UDP connection walks into a bar and it goes up to the bartender.
"Hi bartender, " it says to the bartender.
"Howdy, UDP connection. What'll it be?" the bartender asks.
"I'll have a beer please. Here's a dollar," says the UDP connection.
The bartender takes the dollar, looks at the UDP connection, and continues wiping glasses.
"So, what'll it be?" the bartender asks the UDP connection.
The UDP connection forks over another dollar and orders a beer again. The bartender takes the dollar and stares expectantly at the UDP connection as he continues to wipe glasses.
"So, what are you gonna drink, little UDP connection?" the bartender asks.
"I would like a beer please," and the UDP connection gives the bartender yet another dollar. The bartender takes the dollar and promptly starts wiping the counter. He looks thatthe UDP connection and asks,
"Oh, hello there. Can I get you anything?"
"Yes please," responds the UDP connection, "I'd like a beer. Here is a dollar." And the UDP connection gives the bartender yet another dollar.
And so on...
So I guess writing stuff down on it's arms would turn the UDP connection into a TFTP session.
Where's the NetBIOS? (Score:2, Funny)
(http://www.perfectreign.com/)
Expose it, babe! (Score:2, Funny)
What about Minix? (Score:5, Interesting)
(http://www.midnight-labs.org/)
I've tried digging around the Linux source code, but find a lot of it fairly confusing simply because of the amount of time and effort you have to invest in understanding the rest of it and general architecture.
With Minix, you can pretty much jump in at any place (being very organized and well separated you can find what you're looking for fast), in 3.0 the core syscalls are separated into different files and the core kernel is only around 5000 lines which you can scan through fairly quickly.
Re:What about Minix? (Score:5, Funny)
(Last Journal: Wednesday October 24, @03:50AM)
Perhaps you should send a link to the kernel devs and suggest they emulate it...
Beg to differ (Score:3, Interesting)
Re:Beg to differ (Score:5, Funny)
Yes, the Linux network stack has always been constrained by the fact that it has to handle networking.
I contributed a series of highly innovative patches that added 3D Graphics and AJAX support to the Linux TCP/IP stack. Were those kernel developers interested? Were they fuck.
Just another reason why Linux will continue to lag behind Windows and OSX in the innovation stakes.
Broken link (Score:1)
(http://beamsport.com/ | Last Journal: Wednesday August 15, @06:03PM)
When I saw this headline.... (Score:5, Funny)
Need som real info? (Score:2)
(Last Journal: Sunday September 16, @03:39PM)
1. the book: TCP/IP Illustrated, Volume 1 by W. Richard Stevens
2.
from netinet/ip.h
struct ip {
uint8_t ip_hl:4,
ip_v:4;
uint8_t ip_tos;
uint16_t ip_len;
uint16_t ip_id;
uint16_t ip_off;
uint8_t ip_ttl;
uint8_t ip_p;
uint16_t ip_sum;
struct in_addr ip_src,ip_dst;
};
from netinet/tcp.h:
struct tcphdr {
uint16_t th_sport;
uint16_t th_dport;
tcp_seq th_seq;
tcp_seq th_ack;
uint8_t th_x2:4,
th_off:4;
uint8_t th_flags;
uint16_t th_win;
uint16_t th_sum;
uint16_t th_urp;
};
Better unexpose the stack code.... (Score:3, Funny)
SCO: How do we get our hands on the code for Linux?
Lawyer: Pay me $$$ and I will get the courts to order it handed over.
SCO: You are such a bargain!
I want those (Score:1)
Re:OOOOhhh (Score:5, Funny)