LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   net/ipv4/tcp_input.c file (https://www.linuxquestions.org/questions/linux-general-1/net-ipv4-tcp_input-c-file-379192/)

CICA 11-02-2005 03:08 AM

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

nx5000 11-02-2005 03:15 AM

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.

CICA 11-02-2005 03:30 AM

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 :)

nx5000 11-02-2005 05:08 AM

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

CICA 11-02-2005 05:17 AM

This is much appreciated mate...

Thanks for you help.
Kind Regards
CICA

CICA 11-02-2005 05:34 AM

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

nx5000 11-02-2005 06:06 AM

Yes, the version v1.243 is used in kernel 2.6.12


All times are GMT -5. The time now is 12:26 PM.