리눅스에서 tcp slow start and congestion avoidance 동작에 관

swunk의 이미지

아래 코드는 tcp slow start와 congestion avoidance가 구현되어 있는 리눅스 코드 입니다. tcp_input.c에 정의 되어 있습니다.

   1699 static __inline__ void tcp_cong_avoid(struct tcp_opt *tp)
   1700 {
   1701         if (tp->snd_cwnd <= tp->snd_ssthresh) {
   1702                 /* In "safe" area, increase. */
   1703                 if (tp->snd_cwnd < tp->snd_cwnd_clamp)
   1704                         tp->snd_cwnd++;
   1705         } else {
   1706                 /* In dangerous area, increase slowly.
   1707                  * In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd
   1708                  */
   1709                 if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
   1710                         if (tp->snd_cwnd < tp->snd_cwnd_clamp)
   1711                                 tp->snd_cwnd++;
   1712                         tp->snd_cwnd_cnt=0;
   1713                 } else
   1714                         tp->snd_cwnd_cnt++;
   1715         }
   1716         tp->snd_cwnd_stamp = tcp_time_stamp;
   1717 }

그런데...

cwnd가 threshhold 보다 작을때는 exponential 증가가 되어야 하는데 코드에 보면은 리니어 하게 증가 시키고 있습니다.tp->snd_cwnd++ 어떻게 된거죠 ?

또한 ..

1707라인에 주석으로 처리되어 있는

1707 * In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd 이 내용이 의미하는 바는 무엇인가요? congestion avoidance phase에서 왜 cwnd 값을 하나씩 증가 시키지 않고 위와 같이 증가시키는 건가요 ?

제가 알고 있는대로 라면 위의 코드는 잡다한 거 다 빼고 아래와 같이 되어야 할것 같은데요

   1699 static __inline__ void tcp_cong_avoid(struct tcp_opt *tp) 
   1700 { 
   1701         if (tp->snd_cwnd <= tp->snd_ssthresh) { 
   1702                 /* slow start 상태 exponetial하게 증가 */ 
   1703                 if (tp->snd_cwnd < tp->snd_cwnd_clamp) 
   1704                         tp->snd_cwnd=tp->snd_cwnd*2; 
   1705         }
                    else //congestion avoidance 상태 리니어 하게 증가
                     { 
   1706                         tp->snd_cwnd++; 
   1712          } 
   1716         tp->snd_cwnd_stamp = tcp_time_stamp; 
   1717 }

이렇게 되어야 할것 같은데...

추가질문 하나 더 드리자면
2.4.20 커널에서 사용하는 TCP가 어느 버전 인가요?
RENO 인가요 ?
new reno 인가요 ?
vega 인가요 ?

아니면 ...

답변 부탁드립니다.

swunk의 이미지

너무 뒤로 밀려서 많은 분들이 못 보는것 같아서...
위에 질문에 대한 답변 부탁드립니다.

익명 사용자의 이미지

어제 산 Unix Network Programming 3판에 보면 Linux는 BSD 코드를 쓰는 것이 아니라 새로 작성했다고 되어 있던데요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.