LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-02-2005, 03:08 AM   #1
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Rep: Reputation: 15
net/ipv4/tcp_input.c file


Hi Guys...

I was just wondering if anyone can help me out with this one. I have to view the net/ipv4/tcp_input.c file within the kernel source tree, but being fairly new to Linux I finding this pretty difficult and technicial. Can anyone please suggest how I can go about viewing the contents of this file?

Many thanks
Kind Regards
CICA

PS: please accept my apologies if I have posted this in the incorrect forum
 
Old 11-02-2005, 03:15 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
I'm not sure I understand your problem but if you want to see the contents of this file , you can have it here:

http://lxr.linux.no/source/net/ipv4/tcp_input.c

Then if you want to understand what's inside, I would advice first to read a simpler tcp interface , for an embended OS for example, because the Linux one uses a lot of optimizations. It's better to understand first the core of TCP than going into deep details..

You also should read this : http://www.faqs.org/rfcs/rfc793.html and you can have a look at the book tcp/ip illustrated.
 
Old 11-02-2005, 03:30 AM   #3
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
How'ya nx5000,

Thanks very much for you're reply this (http://lxr.linux.no/source/net/ipv4/tcp_input.c) was exactly what I was looking for. I'll try to explain (as best I can) the reason I was looking for this file. I have been trying to determine an answer to the following problem:

When using the default settings in /proc/sys/net*/ipv4 and having tcp_bic = 1. Does this (tcp_bic) have to be change to 0 if I wanted to set tcp_vegas_cong_avoid = 1. What I meaning is, does setting tcp_vegas_cong_avoid or tcp_westwood to 1 (i.e. to use either of these algorithms) automatically over ride the tcp_bic setting, or would vegas/westwood be used in conjunction with tcp_bic?

So by locating the "tcp_ca_init" function this has kinda helped to answer my question. The code for the function is listed below:

560 * When starting a new connection, pin down the current choice of
561 * congestion algorithm.
562 */
563 void tcp_ca_init(struct tcp_sock *tp)
564 {
565 if (sysctl_tcp_westwood)
566 tp->adv_cong = TCP_WESTWOOD;
567 else if (sysctl_tcp_bic)
568 tp->adv_cong = TCP_BIC;
569 else if (sysctl_tcp_vegas_cong_avoid) {
570 tp->adv_cong = TCP_VEGAS;
571 tp->vegas.baseRTT = 0x7fffffff;
572 tcp_vegas_enable(tp);
573 }
574 }


I just trying to determine what the code is stating. Would I be correct in saying that:

if tcp_bic = 1 then it will over ride whatever the setting is for tcp_vegas_cong_avoid (0 or 1). I am making this assumption because it comes before tcp Vegas in the above code. Can anyone verify if this assumption correct?

Many thanks
CICA

PS: I hope the way I have wrote this isn't too confusing
 
Old 11-02-2005, 05:08 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Code:
if (sysctl_tcp_westwood)
tp->adv_cong = TCP_WESTWOOD;
else if (sysctl_tcp_bic)
tp->adv_cong = TCP_BIC;
else if (sysctl_tcp_vegas_cong_avoid) {
tp->adv_cong = TCP_VEGAS;
tp->vegas.baseRTT = 0x7fffffff;
tcp_vegas_enable(tp);
 }

Yes, your right, if you enter in an IF block, you can't enter in an ELSE IF block ; which means
if tcp_bic is non null then vegas_cong_avoid is not checked.

Have fun
 
Old 11-02-2005, 05:17 AM   #5
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
This is much appreciated mate...

Thanks for you help.
Kind Regards
CICA
 
Old 11-02-2005, 05:34 AM   #6
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Just one final question.

My kernel type is as follows:
kernel-2.6.12-1.1447_FC4

Will the code specified in: http://lxr.linux.no/source/net/ipv4/tcp_input.c also match the code in my kernel?

Thanks
CICA
 
Old 11-02-2005, 06:06 AM   #7
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Yes, the version v1.243 is used in kernel 2.6.12
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't create file using echo: /proc/sys/net/ipv4/ip_local_port_change rsumbeling Linux - General 4 07-17-2013 04:20 AM
net.ipv4.tcp_syn_retries - how to make change permanent syx Linux - Networking 1 01-05-2005 10:54 AM
/proc/sys/net/ipv4/ip_local_port_range wetwet Linux - Networking 0 07-06-2004 08:47 AM
net.ipv4.ip_forward=1 How define it on boot ? sergiodemoura Linux - Newbie 5 12-04-2003 04:52 AM
default values for /proc/sys/net/ipv4 robeb Linux - Networking 0 06-07-2002 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration