Responsive image
博碩士論文 etd-0710102-112353 詳細資訊
Title page for etd-0710102-112353
論文名稱
Title
在Linux 平台上針對代理伺服器實做TCP 連線的結合
Implementation of TCP Splicing for Proxy Servers on Linux Platform
系所名稱
Department
畢業學年期
Year, semester
語文別
Language
學位類別
Degree
頁數
Number of pages
62
研究生
Author
指導教授
Advisor
召集委員
Convenor
口試委員
Advisory Committee
口試日期
Date of Exam
2002-06-26
繳交日期
Date of Submission
2002-07-10
關鍵字
Keywords
Linux核心、代理伺服器
TCP Tap, TCP Splice, BSD Socket, Linux Kernel, Proxy Server
統計
Statistics
本論文已被瀏覽 5686 次,被下載 27
The thesis/dissertation has been browsed 5686 times, has been downloaded 27 times.
中文摘要
Proxy的效能,如轉送延遲(forwarding delay)與throughput,對整個網路通訊的品質有絕對的影響。一般而言,應用層proxy的轉送效能,比較低層的proxy差得多,因為在一般的作業系統下,應用層在讀寫資料時要通過完整的TCP/IP堆疊,而且還會受到user/kernel記憶體空間的限制。
TCP Splice可以將應用層的轉送動作,往下移到TCP層或IP層。我們針對TCP Splice的作法是在核心中,直接換掉封包標頭,來達到直接轉送的效果。因為越是下層的轉送動作,其轉送延遲就會越小,所以我們在核心中加入的TCP Splice,將會有效地減少應用層proxy所造成的轉送延遲。
為了維持某些proxy所具有的快取能力,我們進一步使用TCP Tap來輔助TCP Splice。其作法就是在TCP Splice直接轉送封包之前,先複製一份,並放到一個tap buffer之中,使得proxy可以透過這個tap buffer讀取已經被轉送的資料。我們巧妙地利用原有的TCP receive queue來當作tab buffer,使應用層proxy能用原來的方式來讀取資料。
本論文選擇Linux作為實驗平台,將TCP Splice與TCP Tap實做成Linux的模組。在完成TCP Splice與Tap模組之後,我們又實做了一個HTTP proxy,並使用新模組中的功能,用來驗證TCP Splice的理論與可行性。經由我們實際量測的結果顯示,使用TCP Splice之後,可以使應用層proxy的效能明顯增加。其中轉送封包的延遲時間與延遲的變化(delay jitter)大幅縮小,而且所佔用的CPU使用率也明顯變少,連帶使得throughput大量增加。

Abstract
The forwarding delay and throughput of a proxy server play significant role in the overall network performance. It is widely known that the forwarding delay of proxy’s application layer is much larger than that of lower layers. This is because for a general purpose operating system, the receiving or sending data in application layer needs to move data through the TCP/IP stack and also cross the user/kernel protection boundaries.
TCP Splice can forward data directly in TCP layer without going up to the application layer. This can be achieved by modifying the packet headers of one TCP connection from the original server to the proxy so that the TCP connection can be seamlessly connected to another TCP connection from the proxy to the client.
To maintain the caching ability of proxy, TCP Tap can duplicate packets before they are forwarded by TCP Splice. The duplicated packets are copied into a tap buffer, so the application layer can read data from the tap buffer. We fully utilize the original TCP receive queue as the tap buffer and allow application layer to read data as usual.
We chose Linux as the platform for experiment. The TCP Splice and Tap are implemented as Linux modules. Finally, we develop an HTTP proxy to test and verify our implementation. It is shown that the performance of proxy in terms of lower forwarding delay, higher throughput, and increased CPU utilization, can be improved significantly.

目次 Table of Contents
第一章 導論 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 1
1.1 研究動機 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 1
1.2 研究與與實做 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 1
1.3 章節安排 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 3

第二章 Proxy的基本架構與Linux實做 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 4
2.1 Proxy的運作原理 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 4
2.1.1 使用Proxy的網路架構 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 4
2.1.2 Proxy的各種應用 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 5
2.1.3 關於Proxy的研究 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 9
2.2 TCP/IP在Linux上的層級架構 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 10
2.2.1 Linux網路實作的分層模型 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 10
2.2.2建立連線 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 12
2.2.3傳送與讀取資料 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 14
2.2.4結束連線 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 16
2.3 TCP Splice的運作方式與發展 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 17
2.3.1 Layer 7 Proxy ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 17
2.3.2 TCP Splice ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 18
2.3.3 TCP Tap ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 20
2.3.4 Splicing/Unsplicing ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 20

第三章 TCP Splice在Linux上的實做 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 22
3.1 TCP Splice模組 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 22
3.2 Control與New Socket Call ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 24
3.2.1 TCP Splice應用程式介面 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 25
3.2.2 TCP Splice連線的狀態 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 26
3.3 Redirect ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 30
3.4 Forward ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 31
3.5 Queue ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 33
3.6 TCP Tap ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 35
3.7 Unsplice ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 38

第四章 TCP Splice對於Proxy的效能分析 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 40
4.1 HTTP Proxy的設計 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 40
4.2 效能量測與分析 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 43
4.2.1 client/server的量測 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 43
4.2.2 經由路由器的量測 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 49

第五章 結論與未來工作‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 51
5.1 結論‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 51
5.2 未來工作 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 52
5.2.1將TCP Splice模組移到IP層之下‥‥‥‥‥‥‥‥‥‥‥‥‥ 52
5.2.2 TCP Options ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 53
5.2.3 Asymmetric TCP Splice ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 53

參考文獻 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 55
索引 ‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥ 58
參考文獻 References
[1] O. Spatscheck, J.S. Hansen, J.H. Hartman, L.L. Peterson, “Optimizing TCP forwarder performance,” IEEE/ACM Transactions on Networking, Vol. 8, No. 2, April 2000, pp. 146 -157.
[2] M. Kobayashi and T. Murase, “Asymmetric TCP Splicing for Content-Based Switches,” in Proc IEEE ICC 2002, Vol. 2, pp.1321-1326.
[3] A.Cohen, S. Rangarajan, and H. Slye, “On the Performance of TCP Splicing for URL-aware Redirection,” In Proc. 2nd USENIX Symposium on Internet Technologies and Systems, October 1999.
[4] D. Maltz and P. Bhagwat, “MSOCKS: An architecture for transport layer mobility,” in Proc. IEEE INFOCOM, Apr. 1998, pp.1037–1045.
[5] D. Maltz and P. Bhagwat, “Application layer proxy performance using TCP Splice,’’ IBM technical report RC 21139, March 1998.
[6] D. Maltz and P. Bhagwat, “Improving HTTP caching proxy performance with TCP Tap,’’ in Proc. HIPPARCH, June 1998, pp. 98-103.
[7] H. Lim and D.H.C. Du, “Protocol considerations for video prefix-caching proxy in wide area networks,’’, Electronics Letters, Vol. 37, No. 6, March 2001, pp. 403 -404.
[8] C. M. Bowman, P. B. Danzig, D. R. Hardy, U. Manber and M. F. Schwartz, “The harvest information discovery and access system,” in Proceedings of the Second International World Wide Web Conference, October 1994, pp. 763-771.
[9] P. B. Danzig, R.S. Hall and M. F. Schwartz, “A case for caching file objects inside internetworks,” in Proc. ACM SIGCOMM, September 1993, pp. 239-248.
[10] H. W. Braun and K. Claffy, “Web traffic characterization: an assessment of the impact of caching documents form NCSA’s web server.” In Second international world wide web conference, October 1994.
[11] Proxy Client Autoconfig File Format, http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html
[12] Cache Array Routing Protocol(CARP) – Mcrosoft ISN, http://www.microsoft.com/TechNet/prodtechnol/isa/proddocs/isadocs/m_c_c_arrayrouting.asp
[13] D. Wessels, K. Claffy, “Application of Internet Cache Protocol(ICP), version 2.” RFC 2187.
[14] G. Apostolopoulos, D. Aubespin, V. Peris, P. Pradhan and D. Saha. “Design, Implementation and Performance of a Content-Based Switch,” In Proc. IEEE Infocom 2000, March 2000.
[15] Squid Web Proxy Cache, http://www.squid-cache.org/
[16] Linux IP Firewalling Chains, http://netfilter.samba.org/ipchains/
[17] M. Leech, D. Koblas, et al. “SOCKS protocol version 5,” RFC 1928, April 1996.
[18] Egevang, K. and P. Francis, “The IP Network Address Translator (NAT),” RFC 1631, May 1994.
[19] T. Berners-Lee, R. Fielding, and H. Frystyk, “Hypertext Transfer Protocol – HTTP/1.0,” RFC 1945, May 1996.
[20] R. Fielding, J. Gettys, J. Mogul, H. Frystyk, and T. Berners-Lee, “Hypertext Transfer Protocol – HTTP/1.1,” RFC 2068, January 1997.
[21] Cisco Systems, Inc., “Content-Based Switch,” http://www.cisco.com/
[22] Alteon Websystems, Inc., “Alteon ACE Director,” http://www.alteonwebsystems.com/
[23] Foundry Networks – Products – ServerIron Internet Traffic Management Switch Datasheet, http://www.foundrynetworks.com/datasheets/serverironspec.html/

[24] K. Fall and J. Pasquale “Exploiting In-Kernel data Path to Improve I/O Throughput and CPU Availability,” In Proceedings of the Usenix Winter 1993, pp. 327-334.
[25] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, September 1981.
[26] M. Hamilton, A. Rousskov, and D. Wessels, “Cache Digest Specification – version 5,” http://www.squid-cache.org/CacheDigest/cache-digest-v5.txt
[27] David A Rusling, “The Linux Kernel,” pp. 119-137, http://www.tldp.org/LDP/tlk/tlk.html
[28] W. Richard Stevens, “TCP/IP Illustrated, The Protocols, volume I,” Addison-Wesley, 1994.
[29] A. Rijsinghani, “Computation of the Internet Checksum via Incremental Update,” RFC 1624, May 1994.
電子全文 Fulltext
本電子全文僅授權使用者為學術研究之目的,進行個人非營利性質之檢索、閱讀、列印。請遵守中華民國著作權法之相關規定,切勿任意重製、散佈、改作、轉貼、播送,以免觸法。
論文使用權限 Thesis access permission:校內一年後公開,校外永不公開 campus withheld
開放時間 Available:
校內 Campus: 已公開 available
校外 Off-campus:永不公開 not available

您的 IP(校外) 位址是 18.221.151.175
論文開放下載的時間是 校外不公開

Your IP address is 18.221.151.175
This thesis will be available to you on Indicate off-campus access is not available.

紙本論文 Printed copies
紙本論文的公開資訊在102學年度以後相對較為完整。如果需要查詢101學年度以前的紙本論文公開資訊,請聯繫圖資處紙本論文服務櫃台。如有不便之處敬請見諒。
開放時間 available 已公開 available

QR Code