banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận mạng và thiết bị mạng Nhờ phân tích nguyên nhân "Duplicate ACKs" và "Retransmission"?  XML
  [Question]   Nhờ phân tích nguyên nhân "Duplicate ACKs" và "Retransmission"? 07/03/2008 01:09:32 (+0700) | #1 | 118196
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Chào mọi người.

Tôi dùng ADSL của Viettel, vài ngày hôm nay xảy ra hiện tượng: Rất nhiều (có thể nói là tất cả) các website khác (mà tôi thử) đều duyệt bình thường. Riêng với HVA xảy ra tình trạng: ngay lúc vào hoặc cứ duyệt được một lúc thì khi truy cập một link nào đó lại bị treo (status bar hiển thị waiting for ...). Tôi thử sniff một ít packets thì thấy:
+ Có hiện tượng Duplicate ACK
+ Các gói tin bị retransmission
Code:
No.     Time        Source                Destination           Protocol Info
      3 3.504788    192.168.1.2           219.160.161.58        TCP      56194 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=789328 TSER=0 WS=6

Frame 3 (74 bytes on wire, 74 bytes captured)
Ethernet II, Src: Sony_4f:84:44 (00:13:a9:4f:84:44), Dst: 00:73:07:17:5e:49 (00:73:07:17:5e:49)
Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 219.160.161.58 (219.160.161.58)
Transmission Control Protocol, Src Port: 56194 (56194), Dst Port: http (80), Seq: 0, Len: 0

No.     Time        Source                Destination           Protocol Info
      4 3.810983    219.160.161.58        192.168.1.2           TCP      http > 56194 [SYN, ACK] Seq=0 Ack=1 Win=5608 Len=0 MSS=1414 TSV=1337276948 TSER=789328 WS=5

Frame 4 (74 bytes on wire, 74 bytes captured)
Ethernet II, Src: 00:73:07:17:5e:49 (00:73:07:17:5e:49), Dst: Sony_4f:84:44 (00:13:a9:4f:84:44)
Internet Protocol, Src: 219.160.161.58 (219.160.161.58), Dst: 192.168.1.2 (192.168.1.2)
Transmission Control Protocol, Src Port: http (80), Dst Port: 56194 (56194), Seq: 0, Ack: 1, Len: 0

No.     Time        Source                Destination           Protocol Info
      5 3.811062    192.168.1.2           219.160.161.58        TCP      56194 > http [ACK] Seq=1 Ack=1 Win=5888 Len=0 TSV=789635 TSER=1337276948

Frame 5 (66 bytes on wire, 66 bytes captured)
Ethernet II, Src: Sony_4f:84:44 (00:13:a9:4f:84:44), Dst: 00:73:07:17:5e:49 (00:73:07:17:5e:49)
Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 219.160.161.58 (219.160.161.58)
Transmission Control Protocol, Src Port: 56194 (56194), Dst Port: http (80), Seq: 1, Ack: 1, Len: 0

No.     Time        Source                Destination           Protocol Info
      6 3.811160    192.168.1.2           219.160.161.58        HTTP     GET /hvaonline/posts/list/19794.html HTTP/1.1

Frame 6 (861 bytes on wire, 861 bytes captured)
Ethernet II, Src: Sony_4f:84:44 (00:13:a9:4f:84:44), Dst: 00:73:07:17:5e:49 (00:73:07:17:5e:49)
Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 219.160.161.58 (219.160.161.58)
Transmission Control Protocol, Src Port: 56194 (56194), Dst Port: http (80), Seq: 1, Ack: 1, Len: 795
Hypertext Transfer Protocol
    GET /hvaonline/posts/list/19794.html HTTP/1.1\r\n
    Host: www.hvaonline.net\r\n
    User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080208 Fedora/2.0.0.12-1.fc8 Firefox/2.0.0.12\r\n
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n
    Accept-Language: en-us,en;q=0.5\r\n
    Accept-Encoding: gzip,deflate\r\n
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
    Keep-Alive: 300\r\n
    Connection: keep-alive\r\n
    Referer: /hvaonline/recentTopics/list.html\r\n
    Cookie: HIM_ckspell=1; HIM_method=0; HIM_on_off=1; HIM_daucu=1; HIM_method=0; HIM_daucu=1; HIM_ckspell=1; HIM_on_off=1; JSESSIONID=56285D34894DBBD764298C0A102BE7BF; jforumAutoLogin=null; jforumUserId=128502; jforumUserHash=null; ComboHash=
    \r\n

No.     Time        Source                Destination           Protocol Info
      7 4.731884    192.168.1.2           219.160.161.58        HTTP     [TCP Retransmission] GET /hvaonline/posts/list/19794.html HTTP/1.1

Frame 7 (861 bytes on wire, 861 bytes captured)
Ethernet II, Src: Sony_4f:84:44 (00:13:a9:4f:84:44), Dst: 00:73:07:17:5e:49 (00:73:07:17:5e:49)
Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 219.160.161.58 (219.160.161.58)
Transmission Control Protocol, Src Port: 56194 (56194), Dst Port: http (80), Seq: 1, Ack: 1, Len: 795
Hypertext Transfer Protocol
    GET /hvaonline/posts/list/19794.html HTTP/1.1\r\n
    Host: www.hvaonline.net\r\n
    User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080208 Fedora/2.0.0.12-1.fc8 Firefox/2.0.0.12\r\n
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n
    Accept-Language: en-us,en;q=0.5\r\n
    Accept-Encoding: gzip,deflate\r\n
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
    Keep-Alive: 300\r\n
    Connection: keep-alive\r\n
    Referer: /hvaonline/recentTopics/list.html\r\n
    Cookie: HIM_ckspell=1; HIM_method=0; HIM_on_off=1; HIM_daucu=1; HIM_method=0; HIM_daucu=1; HIM_ckspell=1; HIM_on_off=1; JSESSIONID=56285D34894DBBD764298C0A102BE7BF; jforumAutoLogin=null; jforumUserId=128502; jforumUserHash=null; ComboHash=
    \r\n

No.     Time        Source                Destination           Protocol Info
      8 6.573898    192.168.1.2           219.160.161.58        HTTP     [TCP Retransmission] GET /hvaonline/posts/list/19794.html HTTP/1.1

Frame 8 (861 bytes on wire, 861 bytes captured)
Ethernet II, Src: Sony_4f:84:44 (00:13:a9:4f:84:44), Dst: 00:73:07:17:5e:49 (00:73:07:17:5e:49)
Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 219.160.161.58 (219.160.161.58)
Transmission Control Protocol, Src Port: 56194 (56194), Dst Port: http (80), Seq: 1, Ack: 1, Len: 795
Hypertext Transfer Protocol
    GET /hvaonline/posts/list/19794.html HTTP/1.1\r\n
    Host: www.hvaonline.net\r\n
    User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080208 Fedora/2.0.0.12-1.fc8 Firefox/2.0.0.12\r\n
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n
    Accept-Language: en-us,en;q=0.5\r\n
    Accept-Encoding: gzip,deflate\r\n
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
    Keep-Alive: 300\r\n
    Connection: keep-alive\r\n
    Referer: /hvaonline/recentTopics/list.html\r\n
    Cookie: HIM_ckspell=1; HIM_method=0; HIM_on_off=1; HIM_daucu=1; HIM_method=0; HIM_daucu=1; HIM_ckspell=1; HIM_on_off=1; JSESSIONID=56285D34894DBBD764298C0A102BE7BF; jforumAutoLogin=null; jforumUserId=128502; jforumUserHash=null; ComboHash=
    \r\n

Download (1 trong 2 links)
http://rapidshare.com/files/97396165/hvaretransmission.html
http://vnnshare.com/download.php?file=744003

Đọc trong cuốn TCP/IP, phần Fast Retransmit/Fast Recovery, có đoạn:

Before describing the change, realize that TCP may
generate an immediate acknowledgment (a duplicate ACK) when an out-
of-order segment is received (Section 4.2.2.21 of [1], with a note
that one reason for doing so was for the experimental fast-
retransmit algorithm). This duplicate ACK should not be delayed.
The purpose of this duplicate ACK is to let the other end know that a
segment was received out of order, and to tell it what sequence
number is expected.

Since TCP does not know whether a duplicate ACK is caused by a lost
segment or just a reordering of segments, it waits for a small number
of duplicate ACKs to be received. It is assumed that if there is
just a reordering of the segments, there will be only one or two
duplicate ACKs before the reordered segment is processed, which will
then generate a new ACK. If three or more duplicate ACKs are
received in a row, it is a strong indication that a segment has been
lost. TCP then performs a retransmission of what appears to be the
missing segment, without waiting for a retransmission timer to
expire.
 


Tôi muốn hỏi:
+ Khi nào môt segment nhận được bị out-of-order
+ Phân tích nguyên nhân và khắc phục hiện tượng trên

Cảm ơn mọi người.
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Nhờ phân tích nguyên nhân "Duplicate ACKs" và "Retransmission"? 15/11/2010 21:59:59 (+0700) | #2 | 224952
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Gần đây, mình duyệt HVA với Firefox trên Gentoo lại bị tình trạng này: sau khi login, duyệt một vài links thì không sao (mình đã chú ý chỉ mở từng tab một, đọc xong mới mở tab khác), nhưng được một lúc thì status bar cứ "Connecting..." mãi và timeout. Mình dump thử một ít packets thì thấy như sau:
1. gửi nhiều gói SYN
2. bị retransmission

Chất lượng đường truyền chỗ mình hoàn toàn bình thường vì mình không gặp khó khăn gì khi duyệt các websites khác cả. Hơn nữa, duyệt HVA với Firefox trên Windows cũng không gặp tình trạng này (mọi người có thể xem attach file). Vậy nhờ anh em bắt bệnh giúp mình xem nguyên nhân ở đâu. Cảm ơn mọi người.
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Nhờ phân tích nguyên nhân "Duplicate ACKs" và "Retransmission"? 16/11/2010 02:23:45 (+0700) | #3 | 224962
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]
Hello Quanta, anh có thắc mắc đầu tiên. Không biết IP "219.160.161.58" trong nội dung ở trên em đưa vô chỉ mang tính minh hoạ hay đó là IP thật mà em capture được?
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
  [Question]   Nhờ phân tích nguyên nhân "Duplicate ACKs" và "Retransmission"? 16/11/2010 08:40:27 (+0700) | #4 | 224969
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Dạ, ở cái post đầu tiên à anh? Bài đó em gửi cách đây gần 3 năm rồi, hì hì. Hồi đó thì em dùng Firefox trên Fedora. Mà lạ thật, thiếu gì người dùng Firefox trên Linux đâu, mỗi em gặp tình trạng này là sao ta?
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Nhờ phân tích nguyên nhân "Duplicate ACKs" và "Retransmission"? 16/11/2010 09:46:55 (+0700) | #5 | 224975
[Avatar]
conmale
Administrator

Joined: 07/05/2004 23:43:15
Messages: 9353
Location: down under
Offline
[Profile] [PM]

quanta wrote:
Dạ, ở cái post đầu tiên à anh? Bài đó em gửi cách đây gần 3 năm rồi, hì hì. Hồi đó thì em dùng Firefox trên Fedora. Mà lạ thật, thiếu gì người dùng Firefox trên Linux đâu, mỗi em gặp tình trạng này là sao ta? 


Theo thông tin em cung cấp (trong mấy cái dump file) thì có 2 chuyện:

1. Có thể network throughput của em có vấn đề vì có hiện tượng ACK được gởi nhiều lần (có lẽ do bị mất trong quá trình chuyển gởi thông tin).

2. Firefox vì lý do nào đó đã khiến cho quá nhiều SYN được tạo ra trong một khoảng thời gian ngắn.

Nên biết là HVA hoàn toàn dùng "relative URI" chớ không phải là "absolute URL" cho nên chỉ cần 1 connection đã được thiết lập thì thông tin giữa HVA và máy của em được gởi nhận rồi. Trường hợp Firefox tạo nhiều connections chỉ khi nào HVA dùng "absolute URL" cho nên mỗi .gif, .jpg, .css, .js... trên trang đều cần phải mở 1 connection mới và dẫn tới tình trạng tạo nhiều SYN trên socket level.

Em coi lại kỹ thử Firefox của em có cài thêm mấy cái plugin nào lạ có thể tạo ảnh hưởng hoặc coi lại "about:config" của Firefox thử có settings nào quá mức bình thưởng không. Nếu không phải là Firefox thì có lẽ là thằng squid đứng trước làm gì đó không bình thưởng rồi.
What bringing us together is stronger than what pulling us apart.
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|