Date: Wed, 2 Sep 2009 01:34:18 +0800 From: Fang Wang <wangfangcs@gmail.com> To: freebsd-net@freebsd.org Subject: TCP UTO (RFC 5482) patch calls for review Message-ID: <abd04180909011034p1e2fc211v126fff410fa032e5@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--0050450176f461d4580472878f74 Content-Type: text/plain; charset=ISO-8859-1 Hi, The attached patch implements TCP User Timeout Option(RFC 5482 [0]) in freebsd tcp stack. And this patch comes from my GSoC 2009 project -- Implement TCP UTO(mentor, Rui Paulo). I will be very grateful to any tips, suggestions and questions. Brief introduction about TCP UTO: The TCP user timeout controls how long transmitted data may remain unacknowledged before a connection is forcefully closed. It is a local, per-connection parameter. TCP User Timeout Option allows one end of a TCP connection to advertise it's current user timeout value. This information provides advice to the other end of the TCP connection to adapt it's user timeout accordingly. Increasing the user timeouts on both ends of a TCP connection allows it to survive extended periods without end-to-end connectivity. Decreasing the user timeouts allows busy servers to explicitly notify their clients that they will maintain the connection state only for a short time without connectivity. [0] - http://tools.ietf.org/html/rfc5482 Best Regards, Fang Wang --0050450176f461d4580472878f74 Content-Type: text/x-patch; charset=US-ASCII; name="tcputo.diff" Content-Disposition: attachment; filename="tcputo.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fz2w5egd0 SW5kZXg6IHN5cy9uZXRpbmV0L3RjcF9pbnB1dC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9uZXRpbmV0 L3RjcF9pbnB1dC5jCShyZXZpc2lvbiAxOTY0NTUpCisrKyBzeXMvbmV0aW5ldC90Y3BfaW5wdXQu Ywkod29ya2luZyBjb3B5KQpAQCAtMTE5Niw2ICsxMTk2LDE5IEBACiAJICAgICh0aGZsYWdzICYg VEhfU1lOKSA/IFRPX1NZTiA6IDApOwogCiAJLyoKKwkgKiBJZiB0aGUgVENQIHVzZXIgdGltZW91 dCBvcHRpb24gaXMgcHJlc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V0JXMgKCVsdSBieXRl JXMpIG9mIGRhdGEgYWZ0ZXIgd2luZG93XG4iKTsKKwlwKHRjcHNfcmN2dXRvLCAiXHRcdCVsdSB0 Y3AgdXRvIGVuYWJsZWQgcGFja2V0JXNcbiIpOwogCXAodGNwc19yY3Z3aW5wcm9iZSwgIlx0XHQl bHUgd2luZG93IHByb2JlJXNcbiIpOwogCXAodGNwc19yY3Z3aW51cGQsICJcdFx0JWx1IHdpbmRv dyB1cGRhdGUgcGFja2V0JXNcbiIpOwogCXAodGNwc19yY3ZhZnRlcmNsb3NlLCAiXHRcdCVsdSBw YWNrZXQlcyByZWNlaXZlZCBhZnRlciBjbG9zZVxuIik7CkluZGV4OiBjb250cmliL3RjcGR1bXAv cHJpbnQtdGNwLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PQotLS0gY29udHJpYi90Y3BkdW1wL3ByaW50LXRjcC5jCShy ZXZpc2lvbiAxOTY0NTUpCisrKyBjb250cmliL3RjcGR1bXAvcHJpbnQtdGNwLmMJKHdvcmtpbmcg Y29weSkKQEAgLTEyNCw2ICsxMjQsNyBAQAogICAgICAgICB7IFRDUE9QVF9DQ0VDSE8sICIiIH0s CiAgICAgICAgIHsgVENQT1BUX1NJR05BVFVSRSwgIm1kNSIgfSwKICAgICAgICAgeyBUQ1BPUFRf QVVUSCwgImVuaGFuY2VkIGF1dGgiIH0sCisgICAgICAgIHsgVENQT1BUX1VUTywgInV0byIgfSwK ICAgICAgICAgeyAwLCBOVUxMIH0KIH07CiAKQEAgLTYxMyw2ICs2MTQsMTcgQEAKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGJyZWFrOwogCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFRDUE9QVF9VVE86Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFsZW4gPSAyOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBMRU5DSEVDSyhkYXRhbGVuKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdWludCB1dG92YWwgPSBFWFRSQUNUXzE2QklUUyhjcCk7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1dG92YWwgJiAweDAwMDEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXRvdmFsID0gKHV0b3ZhbCA+PiAxKSAqIDYw OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdXRvdmFsID4+PSAxOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAodm9pZClwcmludGYoIiAldSIsIHV0b3ZhbCk7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgICAgICAgICAgICAgICAgICBkZWZh dWx0OgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhbGVuID0gbGVuIC0gMjsK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGRhdGFsZW47 ICsraSkgewpJbmRleDogY29udHJpYi90Y3BkdW1wL3RjcC5oCj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGNvbnRy aWIvdGNwZHVtcC90Y3AuaAkocmV2aXNpb24gMTk2NDU1KQorKysgY29udHJpYi90Y3BkdW1wL3Rj cC5oCSh3b3JraW5nIGNvcHkpCkBAIC04Myw2ICs4Myw4IEBACiAjZGVmaW5lICAgIFRDUE9MRU5f U0lHTkFUVVJFCQkxOAogI2RlZmluZSBUQ1BfU0lHTEVOIDE2CQkJLyogbGVuZ3RoIG9mIGFuIG9w dGlvbiAxOSBkaWdlc3QgKi8KICNkZWZpbmUgVEN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kJCQkJICAgIHJ4dHNbaV0udHMudHZf c2VjIC0KKwkJCQkJICAgIHJ4dHNbbGFzdF0udHMudHZfc2VjIC0gMSwKKwkJCQkJICAgIDEwMDAw MDAgKyByeHRzW2ldLnRzLnR2X3VzZWMgLQorCQkJCQkgICAgcnh0c1tsYXN0XS50cy50dl91c2Vj KTsKKwkJCQllbHNlCisJCQkJCXByaW50ZigiKCUydS4lLTZ1KSAiLAorCQkJCQkgICAgcnh0c1tp XS50cy50dl9zZWMgLQorCQkJCQkgICAgcnh0c1tsYXN0XS50cy50dl9zZWMsCisJCQkJCSAgICBy eHRzW2ldLnRzLnR2X3VzZWMgLQorCQkJCQkgICAgcnh0c1tsYXN0XS50cy50dl91c2VjKTsKKwkJ CX0KKwkJCXByaW50Zigic2VxICV1LCBhY2sgJXUsICIsCisJCQkgICAgcnh0c1tpXS50aF9zZXEs IHJ4dHNbaV0udGhfYWNrKTsKKwkJCXByaW50Zigid2luICV1XG4iLCByeHRzW2ldLnRoX3dpbik7 CisJCQlsYXN0ID0gaTsKKwkJCXJ4dF9ucisrOworCQl9CisJfQorfQorCitzdGF0aWMgaW50Citw cmludF91dG9fc3RhdHVzKGludCBzb2NrLCBpbnQgcHJpbnQpCit7CisJc3RhdGljIHN0cnVjdCB0 Y3B1dG8gdHUgPSB7MCwgMH07CisJaW50IGRlZmF1bHRfdXRvID0gMSArIDIgKyA0ICsgOCArIDE2 ICsgMzIgKyA2NCArCisJICAgIDY0ICsgNjQgKyA2NCArIDY0ICsgNjQgKyA2NDsKKwlpbnQgb3B0 bGVuOworCWludCB1dG92YWw7CisKKwlvcHRsZW4gPSBzaXplb2YodHUpOworCSh2b2lkKWdldHNv Y2tvcHQoc29jaywgSVBQUk9UT19UQ1AsIFRDUF9VVE8sICZ0dSwgJm9wdGxlbik7CisJaWYgKHBy aW50KSB7CisJCWlmICh0dS5mbGFncyAmIFRDUF9VVE9fRU5BQkxFKSB7CisJCQlwcmludGYoInRj cHV0bzogZW5hYmxlZC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GVlcCgxKTsKKwkJd2hpbGUocmVjdihzb2NrLCBidWYsIDgqMTAy NCwgTVNHX0RPTlRXQUlUKSA+IDApCisJCQk7CisJCSh2b2lkKXRjcHV0b190aW1lcigpOworCQkv KgorCQkgKiBTZW5kIG1vcmUgZGF0YSB0aGFuIHNvY2tldCBzZW5kIGJ1ZmZlciwKKwkJICogc28g dGhhdCBkYXRhIGFyZSBub3QgYnVmZmVyZWQuCisJCSAqLworCQlpZiAoc2VuZChzb2NrLCBidWYs IDgqMTAyNCwgTVNHX05PU0lHTkFMKSA+IDApIHsKKwkJCSh2b2lkKXRjcHV0b190aW1lcigpOwor CQkJKHZvaWQpcHJpbnRfdXRvX3N0YXR1cyhzb2NrLCAwKTsKKwkJCWNvbnRpbnVlOworCQl9CisJ CXVzZXJfdGltZW91dCA9IHRjcHV0b190aW1lcigpOworCQlwcmludGYoIkNvbm5lY3Rpb24gdGlt ZW91dCwgJWQgc2Vjb25kcy5cbiIsIHVzZXJfdGltZW91dCk7CisJCWJyZWFrOworCX0KKwkvKiB3 YWl0IGZvciB0aGUgcmVzZXQgcGFja2V0IHRvIGJlIGNhcHR1cmVkICovCisJc2xlZXAoMSk7CisJ KHZvaWQpcHRocmVhZF9raWxsKHRpZCwgU0lHVEVSTSk7CisKKwljbG9zZShzb2NrKTsKK30KKwor aW50CittYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCit7CisJaW50IHV0b3ZhbDsKKworCWlm IChhcmdjIDwgMikKKwkJdXNhZ2UoKTsKKworCWlmIChzdHJjbXAoYXJndlsxXSwgInNlcnZlciIp ID09IDApCisJCXRjcHV0b19zZXJ2ZXIoYXJnYyAtIDIsIGFyZ3YgKyAyKTsKKwllbHNlIGlmIChz dHJjbXAoYXJndlsxXSwgImNsaWVudCIpID09IDApCisJCXRjcHV0b19jbGllbnQoYXJnYyAtIDIs IGFyZ3YgKyAyKTsKKwllbHNlCisJCXVzYWdlKCk7CisJCisJKHZvaWQpcHJpbnRfdXRvX3N0YXR1 cygtMSwgMSk7CisJcHJpbnRfcmVzdWx0KCk7CisKKwlleGl0KDApOworfQorCgpQcm9wZXJ0eSBj aGFuZ2VzIG9uOiB0b29scy9yZWdyZXNzaW9uL25ldGluZXQvdGNwdXRvL3RjcHV0by5jCl9fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX18KQWRkZWQ6IHN2bjptaW1lLXR5cGUKICAgKyB0ZXh0L3BsYWluCkFkZGVkOiBzdm46a2V5 d29yZHMKICAgKyBGcmVlQlNEPSVICkFkZGVkOiBzdm46ZW9sLXN0eWxlCiAgICsgbmF0aXZlCgpJ bmRleDogdG9vbHMvcmVncmVzc2lvbi9uZXRpbmV0L3RjcHV0by9NYWtlZmlsZQo9PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 Ci0tLSB0b29scy9yZWdyZXNzaW9uL25ldGluZXQvdGNwdXRvL01ha2VmaWxlCShyZXZpc2lvbiAw KQorKysgdG9vbHMvcmVncmVzc2lvbi9uZXRpbmV0L3RjcHV0by9NYWtlZmlsZQkocmV2aXNpb24g MCkKQEAgLTAsMCArMSw4IEBACisjICRGcmVlQlNEJAorCitQUk9HPQl0Y3B1dG8KK0RQQUREPQkk e0xJQlBDQVB9ICR7TElCUFRIUkVBRH0KK0xEQUREPQktbHBjYXAgLWxwdGhyZWFkCitOT19NQU49 CisKKy5pbmNsdWRlIDxic2QucHJvZy5taz4KClByb3BlcnR5IGNoYW5nZXMgb246IHRvb2xzL3Jl Z3Jlc3Npb24vbmV0aW5ldC90Y3B1dG8vTWFrZWZpbGUKX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpBZGRlZDogc3ZuOm1p bWUtdHlwZQogICArIHRleHQvcGxhaW4KQWRkZWQ6IHN2bjprZXl3b3JkcwogICArIEZyZWVCU0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4sIHNlbGVjdAorYSBwb3J0IG51bWJlciAoZm9yIHRoZSBjbGllbnQgYW5k IHNlcnZlcikgYW5kIGRlY2lkZSB3aGV0aGVyIGVuYWJsZSBUQ1AgdXNlcgordGltZW91dCBhbmQg dGhlIHZhbHVlIG9mIHVzZXIgdGltZW91dCB0byBzZW5kLiAgVHlwaWNhbCB1c2UgbWlnaHQgYmU6 CisKK1J1biB0aGUgc2VydmVyIG9uIHBvcnQgODA4MCBhbmQgZW5hYmxlIFRDUCB1c2VyIHRpbWVv dXQ6CisKKyAgICB0Y3B1dG8gc2VydmVyIDgwODAgdXRvCisKK05vdyBydW4gdGhlIGNsaWVudCBv biBhIHNlY29uZCBtYWNoaW5lIHdpdGggdGhlIHNlcnZlcidzIElQLCBwb3J0IDgwODAsIGVuYWJs ZQorVENQIHVzZXIgdGltZW91dCwgYW5kIHNlbmQgYSA3MDAgc2Vjb25kcyB1c2VyIHRpbWVvdXQg dmFsdWU6CisKKyAgICB0Y3B1dG8gY2xpZW50IDE5Mi4xNjguMTAuMTAgODA4MCB1dG8gNzAwCisK K0FmdGVyIHRoYXQsIGludGVycnVwdCB0aGUgY29ubmVjdGlvbiB3aXRob3V0IGRldGVjdGVkIGJ5 IG9wZXJhdGluZyBzeXN0ZW0sIGFuZAord2FpdCB1bnRpbCBwcm9jZXNzIGV4aXRzLgo= --0050450176f461d4580472878f74--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?abd04180909011034p1e2fc211v126fff410fa032e5>