锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品亚洲综合在线观看,久久视频免费观看,99久久精品免费看国产小宝寻花http://www.aygfsteel.com/Todd/zh-cnMon, 14 Jul 2025 08:38:43 GMTMon, 14 Jul 2025 08:38:43 GMT60銆恥nix銆慶rontab 涓嬌鐢ㄧ幆澧冨彉閲?/title><link>http://www.aygfsteel.com/Todd/archive/2012/08/17/385698.html</link><dc:creator>Todd</dc:creator><author>Todd</author><pubDate>Fri, 17 Aug 2012 08:13:00 GMT</pubDate><guid>http://www.aygfsteel.com/Todd/archive/2012/08/17/385698.html</guid><wfw:comment>http://www.aygfsteel.com/Todd/comments/385698.html</wfw:comment><comments>http://www.aygfsteel.com/Todd/archive/2012/08/17/385698.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Todd/comments/commentRss/385698.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Todd/services/trackbacks/385698.html</trackback:ping><description><![CDATA[<p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; ">鐜:(浜у搧,騫沖彴,鏈哄瀷,杞歡鐗堟湰,絳?AIX5L</p> <p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; ">闂鎻忚堪:crontab涓惎鍔ㄧ殑shell鑴氭湰涓嶈兘姝e父榪愯錛屼絾鏄嬌鐢ㄦ墜鍔ㄦ墽琛屾病鏈夐棶棰橈紝鍦?home/.profile涓瀹氫簡鑴氭湰鎵€闇€瑕佺殑鐜鍙橀噺銆?/p> <p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; ">瑙g瓟:cron鍛戒護(hù)鐨勯粯璁hell鏄?usr/bin/bsh錛屽鏋滆鍦╟ron鍚姩鐨勮剼鏈腑浣跨敤ksh錛屽氨蹇呴』鍦ㄨ剼鏈腑鐨勭涓€琛屾坊鍔?#8220;#!/usr/bin/ksh”鐨勫0鏄庛€?/p> <p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; ">濡傛灉cron榪涚▼鍚姩鐨剆hell鑴氭湰瑕佺敤鐧誨綍鏃剁殑鐜鍙橀噺錛屽氨蹇呴』鍦╟ron鍚姩鐨剆hell鑴氭湰涓坊鍔犱笅闈㈢殑鍐呭錛屾墠鑳藉鍦ㄥ惎鍔ㄧ殑鑴氭湰涓嬌鐢?br /> $home/.profile鏂囦歡涓殑鐜鍙橀噺銆?/p> <p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; ">. $home/.profile</p> <p style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; ">榪欐槸鍥犱負(fù)cron榪涚▼鎵ц鐨剆hell鑴氭湰鏄笉浼?xì)鑷姩鍔犺浇鐢ㄦ堬L(fēng)洰褰曚笅鐨?profile鏂囦歡錛屾墍浠ラ渶瑕佽剼鏈嚜宸卞姞杞芥墍闇€瑕佺殑鐜鍙橀噺銆?br /> ================<br /> 鐜鍙橀噺鏂囦歡鍔犺澆欏哄簭<br /> <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; color: blue; ">/etc/profile:</span><span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; "> 姝ゆ枃浠朵負(fù)緋葷粺鐨勬瘡涓敤鎴瘋緗幆澧冧俊鎭?褰撶敤鎴風(fēng)涓€嬈$櫥褰曟椂,璇ユ枃浠惰鎵ц.</span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; ">騫朵粠/etc/profile.d鐩綍鐨勯厤緗枃浠朵腑鎼滈泦shell鐨勮緗?</span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; color: blue; ">/etc/bashrc:</span><span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; "> 涓烘瘡涓€涓繍琛宐ash shell鐨勭敤鎴鋒墽琛屾鏂囦歡.褰揵ash shell琚墦寮€鏃?璇ユ枃浠惰璇誨彇.</span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; color: blue; ">~/.bash_profile:</span><span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; "> 姣忎釜鐢ㄦ埛閮藉彲浣跨敤璇ユ枃浠惰緭鍏ヤ笓鐢ㄤ簬鑷繁浣跨敤鐨剆hell淇℃伅,褰撶敤鎴風(fēng)櫥褰曟椂,璇?/span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; ">鏂囦歡浠呬粎鎵ц涓€嬈?榛樿鎯呭喌涓?浠栬緗竴浜涚幆澧冨彉閲?鎵ц鐢ㄦ埛鐨?bashrc鏂囦歡.</span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; color: blue; ">~/.bashrc:</span><span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; "> 璇ユ枃浠跺寘鍚笓鐢ㄤ簬浣犵殑bash shell鐨刡ash淇℃伅,褰撶櫥褰曟椂浠ュ強(qiáng)姣忔鎵撳紑鏂扮殑shell鏃?璇?/span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; ">璇ユ枃浠惰璇誨彇.</span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; color: blue; ">~/.bash_logout:</span><span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; "> 褰撴瘡嬈¢€€鍑虹郴緇?閫€鍑篵ash shell)鏃?鎵ц璇ユ枃浠? </span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; ">鍙﹀,/etc/profile涓瀹氱殑鍙橀噺(鍏ㄥ眬)鐨勫彲浠ヤ綔鐢ㄤ簬浠諱綍鐢ㄦ埛,鑰寏/.bashrc絳変腑璁懼畾鐨勫彉閲?灞€閮?鍙兘緇ф壙/etc/profile涓殑鍙橀噺,浠栦滑鏄?鐖跺瓙"鍏崇郴.</span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; ">~/.bash_profile 鏄氦浜掑紡銆乴ogin 鏂瑰紡榪涘叆 bash 榪愯鐨?/span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; ">~/.bashrc 鏄氦浜掑紡 non-login 鏂瑰紡榪涘叆 bash 榪愯鐨?/span><br style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; " /> <span style="color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; background-color: #28557e; ">閫氬父浜岃€呰緗ぇ鑷寸浉鍚岋紝鎵€浠ラ€氬父鍓嶈€呬細(xì)璋冪敤鍚庤€呫€?/span> <br /> </p> <img src ="http://www.aygfsteel.com/Todd/aggbug/385698.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Todd/" target="_blank">Todd</a> 2012-08-17 16:13 <a href="http://www.aygfsteel.com/Todd/archive/2012/08/17/385698.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>銆恛racle銆戦珮騫跺彂閲忚〃鏇存柊娉ㄦ剰鐐?/title><link>http://www.aygfsteel.com/Todd/archive/2012/07/25/383896.html</link><dc:creator>Todd</dc:creator><author>Todd</author><pubDate>Tue, 24 Jul 2012 18:29:00 GMT</pubDate><guid>http://www.aygfsteel.com/Todd/archive/2012/07/25/383896.html</guid><wfw:comment>http://www.aygfsteel.com/Todd/comments/383896.html</wfw:comment><comments>http://www.aygfsteel.com/Todd/archive/2012/07/25/383896.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Todd/comments/commentRss/383896.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Todd/services/trackbacks/383896.html</trackback:ping><description><![CDATA[縐誨姩涓€涓笟鍔¢珮騫跺彂錛屾帴鍏ヤ竴涓鎴風(fēng)數(shù)璇濆氨鍙戜竴涓壒孌婇個(gè)璇風(fēng)爜錛堢爜涓哄瓧絎﹀姞鏁板瓧娣風(fēng)紪錛屾棤瑙勫緥錛夛紝鐮佸凡瀛樿〃錛屼笟鍔′笂瑕?鐮佸拰鐢ㄦ埛鎵嬫満鍙風(fēng)爜涓€涓€瀵瑰簲錛?br /> 鎵€浠ワ紝鏉ヤ釜鐢ㄦ埛灝卞緱瀵規(guī)湭鏍囪鐨勭爜鏇存柊鎵嬫満鍙風(fēng)爜錛涢珮騫跺彂鏃訛紝琛岄攣鍙?qiáng)绛夊緟姣旇緝鑰楁椂錛屽鑷存暟鎹簱鎬ц兘涓嬮檷涓ラ噸錛?br /> 瑙e喅鍔炴硶錛?br /> 鐮佽〃澧炲姞seqid,瀛楁錛涘鍏ユ暟鎹椂浣跨敤rownum,鍋氳瀛楁鍊?寤虹儲(chǔ)寮曪紱<br /> 鏇存柊鏃訛紝浣跨敤搴忓垪錛? <div></div> <div>CREATE SEQUENCE SQ_U_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 50000000 CYCLE CACHE 2000 NOORDER;<br /> 鏇存柊鍒欙細(xì)update ... where ... and t.seqid = SQ_U_SEQ.nextval ...;<br /> 浠ュ悗鏈夋柊鐨勬暟鎹瀵煎叆錛屽垯搴忓垪闇€閲嶇疆錛屽垯錛?/div> <div style="font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; border-image: initial; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000FF; ">create</span> <span style="color: #808080; ">or</span> <span style="color: #FF00FF; ">replace</span> <span style="color: #0000FF; ">procedure</span> seq_reset(v_seqname <span style="font-weight: bold; ">varchar2</span>) <span style="color: #0000FF; ">as</span> n <span style="font-weight: bold; ">number</span>(<span style="color: #800000; font-weight: bold; ">10</span>);<br /> tsql <span style="font-weight: bold; ">varchar2</span>(<span style="color: #800000; font-weight: bold; ">100</span>);<br />  <span style="color: #0000FF; ">begin</span><br />  <span style="color: #0000FF; ">execute</span> immediate <span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">select </span><span style="color: #FF0000; ">'</span><span style="color: #808080; ">||</span>v_seqname<span style="color: #808080; ">||</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">.nextval from dual</span><span style="color: #FF0000; ">'</span> <span style="color: #0000FF; ">into</span> n;<br />   n:<span style="color: #808080; ">=-</span>(n<span style="color: #808080; ">-</span><span style="color: #800000; font-weight: bold; ">1</span>);<br />   tsql:<span style="color: #808080; ">=</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">alter sequence </span><span style="color: #FF0000; ">'</span><span style="color: #808080; ">||</span>v_seqname<span style="color: #808080; ">||</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; "> increment by </span><span style="color: #FF0000; ">'</span><span style="color: #808080; ">||</span> n;<br />   <span style="color: #0000FF; ">execute</span> immediate tsql;<br />  <span style="color: #0000FF; ">execute</span> immediate <span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">select </span><span style="color: #FF0000; ">'</span><span style="color: #808080; ">||</span>v_seqname<span style="color: #808080; ">||</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">.nextval from dual</span><span style="color: #FF0000; ">'</span> <span style="color: #0000FF; ">into</span> n;<br />   tsql:<span style="color: #808080; ">=</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">alter sequence </span><span style="color: #FF0000; ">'</span><span style="color: #808080; ">||</span>v_seqname<span style="color: #808080; ">||</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; "> increment by 1</span><span style="color: #FF0000; ">'</span>;<br />  <span style="color: #0000FF; ">execute</span> immediate tsql;<br />  <span style="color: #0000FF; ">end</span> seq_reset;</div> 鍙﹀錛岄珮騫跺彂鏃跺簭鍒楃殑cache瑕佽緗ぇ鐐?涓€鑸笟鍔¤緗?00浠ヤ笂錛屼絾nocache鐨勬椂鍊欐€ц兘紜疄寰堝樊錛屾渶澶х浉宸?0鍊嶏紟 鎺掑簭鍙傛暟錛歰racle榛樿鏄疦OORDER錛屽鏋滆緗負(fù)ORDER錛涘湪鍗曞疄渚嬬幆澧冩病鏈夊獎(jiǎng)鍝嶏紝鍦≧AC鐜姝ゆ椂錛屽瀹炰緥瀹為檯緙撳瓨鐩稿悓鐨勫簭鍒楋紝姝ゆ椂鍦ㄥ涓疄渚嬪茍鍙戝彇璇ュ簭鍒楃殑鏃跺€欙紝浼?xì)鏈夌煭鏆傜殑璧勬簮绔炰簤鏉ュ湪澶氬疄渚嬩箣闂礃q涜鍚屾銆傚洜嬈℃€ц兘鐩告瘮noorder瑕佸樊錛屾墍浠AC鐜闈炲繀欏葷殑鎯呭喌涓嬩笉瑕佷嬌鐢∣RDER錛屽挨鍏惰閬垮厤NOCACHE ORDER緇勫悎錛? <img src ="http://www.aygfsteel.com/Todd/aggbug/383896.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Todd/" target="_blank">Todd</a> 2012-07-25 02:29 <a href="http://www.aygfsteel.com/Todd/archive/2012/07/25/383896.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>VI甯哥敤鍛戒護(hù)http://www.aygfsteel.com/Todd/archive/2012/07/18/383419.htmlToddToddWed, 18 Jul 2012 09:32:00 GMThttp://www.aygfsteel.com/Todd/archive/2012/07/18/383419.htmlhttp://www.aygfsteel.com/Todd/comments/383419.htmlhttp://www.aygfsteel.com/Todd/archive/2012/07/18/383419.html#Feedback0http://www.aygfsteel.com/Todd/comments/commentRss/383419.htmlhttp://www.aygfsteel.com/Todd/services/trackbacks/383419.html闃呰鍏ㄦ枃

Todd 2012-07-18 17:32 鍙戣〃璇勮
]]>
銆?銆慺reebsd netperf 緗戠粶鎬ц兘嫻嬭瘯宸ュ叿 http://www.aygfsteel.com/Todd/archive/2012/03/29/373010.htmlToddToddThu, 29 Mar 2012 14:45:00 GMThttp://www.aygfsteel.com/Todd/archive/2012/03/29/373010.htmlhttp://www.aygfsteel.com/Todd/comments/373010.htmlhttp://www.aygfsteel.com/Todd/archive/2012/03/29/373010.html#Feedback0http://www.aygfsteel.com/Todd/comments/commentRss/373010.htmlhttp://www.aygfsteel.com/Todd/services/trackbacks/373010.htmlhttp://www.netperf.org/netperf/DownloadNetperf.html
2.瀹夎錛宯etperf-2.5.0.tar.gz錛涜В鍘嬪悗鎵ц涓€涓嬪懡浠わ細(xì)
cd netperf-2.5.0
./configure
make && make install
榛樿瀹夎鐩綍錛?usr/local/bin
鏈変袱涓枃浠?netperf netserver
鍚庤€呮湇鍔$錛堝湪瑕佹祴璇曠殑鏈哄櫒涓婁篃瑕佸畨瑁咃紝騫舵墽琛宯etserver鍚姩涔嬶紝鍚﹀垯瀹㈡埛绔姤閿欙級  鍓嶈€呭鎴風(fēng)
3.嫻嬭瘯--鐩存帴杞埆浜虹殑

TCP緗戠粶鎬ц兘

鐢變簬TCP鍗忚鑳藉鎻愪緵绔埌绔殑鍙潬浼犺緭錛屽洜姝よ澶ч噺鐨勭綉緇滃簲鐢ㄧ▼搴忎嬌鐢ㄣ€備絾鏄紝鍙潬鎬х殑寤虹珛鏄浠樺嚭浠d環(huán)鐨勩€俆CP鍗忚淇濊瘉鍙潬鎬х殑鎺柦錛屽寤虹珛騫剁淮鎶よ繛鎺ャ€佹帶鍒舵暟鎹湁搴忕殑浼犻€掔瓑閮戒細(xì)娑堣€椾竴瀹氱殑緗戠粶甯﹀銆?/p>

Netperf鍙互妯℃嫙涓夌涓嶅悓鐨凾CP嫻侀噺妯″紡錛?/p>

1錛?鍗曚釜TCP榪炴帴錛屾壒閲忥紙bulk錛変紶杈撳ぇ閲忔暟鎹?/p>

2錛?鍗曚釜TCP榪炴帴錛宑lient璇鋒眰/server搴旂瓟鐨勪氦鏄擄紙transaction錛夋柟寮?/p>

3錛?澶氫釜TCP榪炴帴錛屾瘡涓繛鎺ヤ腑涓€瀵硅姹?搴旂瓟鐨勪氦鏄撴柟寮?/p>

UDP緗戠粶鎬ц兘

UDP娌℃湁寤虹珛榪炴帴鐨勮礋鎷咃紝浣嗘槸UDP涓嶈兘淇濊瘉浼犺緭鐨勫彲闈犳€э紝鎵€浠ヤ嬌鐢║DP鐨勫簲鐢ㄧ▼搴忛渶瑕佽嚜琛岃窡韙瘡涓彂鍑虹殑鍒嗙粍錛屽茍閲嶅彂涓㈠け鐨勫垎緇勩€?/p>

Netperf鍙互妯℃嫙涓ょUDP鐨勬祦閲忔ā寮忥細(xì)

1錛?浠巆lient鍒皊erver鐨勫崟鍚戞壒閲忎紶杈?/p>

2錛?璇鋒眰/搴旂瓟鐨勪氦鏄撴柟寮?/p>

鐢變簬UDP浼犺緭鐨勪笉鍙潬鎬э紝鍦ㄤ嬌鐢╪etperf鏃惰紜繚鍙戦€佺殑緙撳啿鍖哄ぇ灝忎笉澶т簬鎺ユ敹緙撳啿鍖哄ぇ灝忥紝鍚﹀垯鏁版嵁浼?xì)涓㈠け锛宯etperf灝嗙粰鍑洪敊璇殑緇撴灉銆傚洜姝わ紝瀵逛簬鎺ユ敹鍒板垎緇勭殑緇熻涓嶄竴瀹氬噯紜紝闇€瑕佺粨鍚堝彂閫佸垎緇勭殑緇熻緇煎悎寰楀嚭緇撹銆?/p>

Netperf鐨勫懡浠よ鍙傛暟

鍦╱nix緋葷粺涓紝鍙互鐩存帴榪愯鍙墽琛岀▼搴忔潵鍚姩netserver錛屼篃鍙互璁﹊netd鎴杧inetd鏉ヨ嚜鍔ㄥ惎鍔╪etserver銆?/p>

褰搉etserver鍦╯erver绔惎鍔ㄤ互鍚庯紝灝卞彲浠ュ湪client绔繍琛宯etperf鏉ユ祴璇曠綉緇滅殑鎬ц兘銆俷etperf閫氳繃鍛戒護(hù)琛屽弬鏁版潵鎺у埗嫻嬭瘯鐨勭被鍨嬪拰鍏蜂綋鐨勬祴璇曢€夐」銆傛牴鎹綔鐢ㄨ寖鍥寸殑涓嶅悓錛宯etperf鐨勫懡浠よ鍙傛暟鍙互鍒嗕負(fù)涓ゅぇ綾伙細(xì)鍏ㄥ眬鍛戒護(hù)琛屽弬鏁般€佹祴璇曠浉鍏崇殑灞€閮ㄥ弬鏁幫紝涓よ€呬箣闂翠嬌鐢?-鍒嗛殧錛?/p>
netperf [global options]-- [test-specific options] 

榪欓噷鎴戜滑鍙В閲婇偅浜涘父鐢ㄧ殑鍛戒護(hù)琛屽弬鏁幫紝鍏跺畠鐨勫弬鏁拌鑰呭彲浠ユ煡璇etperf鐨刴an鎵嬪唽銆?/p>

-H host 錛氭寚瀹氳繙绔繍琛宯etserver鐨剆erver IP鍦板潃銆?/p>

-l testlen錛氭寚瀹氭祴璇曠殑鏃墮棿闀垮害錛堢錛?/p>

-t testname錛氭寚瀹氳繘琛岀殑嫻嬭瘯綾誨瀷錛屽寘鎷琓CP_STREAM錛孶DP_STREAM錛孴CP_RR錛孴CP_CRR錛孶DP_RR錛屽湪涓嬫枃涓垎鍒瀹冧滑璇存槑銆?/p>

鍦ㄥ悗闈㈢殑嫻嬭瘯涓紝netserver榪愯鍦?92.168.0.28錛宻erver涓巆lient閫氳繃灞€鍩熺綉榪炴帴錛?00M Hub錛夈€?/p>

Netperf嫻嬭瘯緗戠粶鎬ц兘

嫻嬭瘯鎵歸噺錛坆ulk錛夌綉緇滄祦閲忕殑鎬ц兘

鎵歸噺鏁版嵁浼犺緭鍏稿瀷鐨勪緥瀛愭湁ftp鍜屽叾瀹冪被浼肩殑緗戠粶搴旂敤錛堝嵆涓€嬈′紶杈撴暣涓枃浠訛級銆傛牴鎹嬌鐢ㄤ紶杈撳崗璁殑涓嶅悓錛屾壒閲忔暟鎹紶杈撳張鍒嗕負(fù)TCP鎵歸噺浼犺緭鍜孶DP鎵歸噺浼犺緭銆?/p>

1錛?TCP_STREAM

Netperf緙虹渷鎯呭喌涓嬭繘琛孴CP鎵歸噺浼犺緭錛屽嵆-t TCP_STREAM銆傛祴璇曡繃紼嬩腑錛宯etperf鍚憂etserver鍙戦€佹壒閲忕殑TCP鏁版嵁鍒嗙粍錛屼互紜畾鏁版嵁浼犺緭榪囩▼涓殑鍚炲悙閲忥細(xì)

 ./netperf -H 192.168.0.28 -l 60 TCP STREAM TEST to 192.168.0.28 Recv   Send    Send Socket Socket  Message  Elapsed Size   Size    Size     Time     Throughput bytes  bytes   bytes    secs.    10^6bits/sec    87380  16384  16384    60.00      88.00  

浠巒etperf鐨勭粨鏋滆緭鍑轟腑錛屾垜浠彲浠ョ煡閬撲互涓嬬殑涓€浜涗俊鎭細(xì)

1錛?榪滅緋葷粺錛堝嵆server錛変嬌鐢ㄥぇ灝忎負(fù)87380瀛楄妭鐨剆ocket鎺ユ敹緙撳啿

2錛?鏈湴緋葷粺錛堝嵆client錛変嬌鐢ㄥぇ灝忎負(fù)16384瀛楄妭鐨剆ocket鍙戦€佺紦鍐?/p>

3錛?鍚戣繙绔郴緇熷彂閫佺殑嫻嬭瘯鍒嗙粍澶у皬涓?6384瀛楄妭

4錛?嫻嬭瘯緇忓巻鐨勬椂闂翠負(fù)60縐?/p>

5錛?鍚炲悙閲忕殑嫻嬭瘯緇撴灉涓?8Mbits/縐?/p>

鍦ㄧ己鐪佹儏鍐典笅錛宯etperf鍚戝彂閫佺殑嫻嬭瘯鍒嗙粍澶у皬璁劇疆涓烘湰鍦扮郴緇熸墍浣跨敤鐨剆ocket鍙戦€佺紦鍐插ぇ灝忋€?/p>

TCP_STREAM鏂瑰紡涓嬩笌嫻嬭瘯鐩稿叧鐨勫眬閮ㄥ弬鏁板涓嬭〃鎵€紺猴細(xì)

鍙傛暟璇存槑
-s size璁劇疆鏈湴緋葷粺鐨剆ocket鍙戦€佷笌鎺ユ敹緙撳啿澶у皬
-S size璁劇疆榪滅緋葷粺鐨剆ocket鍙戦€佷笌鎺ユ敹緙撳啿澶у皬
-m size璁劇疆鏈湴緋葷粺鍙戦€佹祴璇曞垎緇勭殑澶у皬
-M size璁劇疆榪滅緋葷粺鎺ユ敹嫻嬭瘯鍒嗙粍鐨勫ぇ灝?/td>
-D瀵規(guī)湰鍦頒笌榪滅緋葷粺鐨剆ocket璁劇疆TCP_NODELAY閫夐」

閫氳繃淇敼浠ヤ笂鐨勫弬鏁幫紝騫惰瀵熺粨鏋滅殑鍙樺寲錛屾垜浠彲浠ョ‘瀹氭槸浠€涔堝洜绱犲獎(jiǎng)鍝嶄簡榪炴帴鐨勫悶鍚愰噺銆備緥濡傦紝濡傛灉鎬€鐤戣礬鐢卞櫒鐢變簬緙轟箯瓚沖鐨勭紦鍐插尯絀洪棿錛屼嬌寰楄漿鍙戝ぇ鐨勫垎緇勬椂瀛樺湪闂錛屽氨鍙互澧炲姞嫻嬭瘯鍒嗙粍錛?m錛夌殑澶у皬錛屼互瑙傚療鍚炲悙閲忕殑鍙樺寲錛?/p>
 ./netperf -H 192.168.0.28 -l 60 -- -m 2048 TCP STREAM TEST to 192.168.0.28 Recv   Send    Send Socket Socket  Message  Elapsed Size   Size    Size     Time     Throughput bytes  bytes   bytes    secs.    10^6bits/sec    87380  16384   2048    60.00      87.62  

鍦ㄨ繖閲岋紝嫻嬭瘯鍒嗙粍鐨勫ぇ灝忓噺灝戝埌2048瀛楄妭錛岃€屽悶鍚愰噺鍗存病鏈夊緢澶х殑鍙樺寲錛堜笌鍓嶉潰渚嬪瓙涓祴璇曞垎緇勫ぇ灝忎負(fù)16K瀛楄妭鐩告瘮錛夈€傜浉鍙嶏紝濡傛灉鍚炲悙閲忔湁浜嗚緝澶х殑鎻愬崌錛屽垯璇存槑鍦ㄧ綉緇滀腑闂寸殑璺敱鍣ㄧ‘瀹炲瓨鍦ㄧ紦鍐插尯鐨勯棶棰樸€?/p>

2錛?UDP_STREAM

UDP_STREAM鐢ㄦ潵嫻嬭瘯榪涜UDP鎵歸噺浼犺緭鏃剁殑緗戠粶鎬ц兘銆傞渶瑕佺壒鍒敞鎰忕殑鏄紝姝ゆ椂嫻嬭瘯鍒嗙粍鐨勫ぇ灝忎笉寰楀ぇ浜巗ocket鐨勫彂閫佷笌鎺ユ敹緙撳啿澶у皬錛屽惁鍒檔etperf浼?xì)鎶ュ嚭閿欐彁绀哄Q?/p>
./netperf -t UDP_STREAM -H 192.168.0.28 -l 60 UDP UNIDIRECTIONAL SEND TEST to 192.168.0.28 udp_send: data send error: Message too long 

涓轟簡閬垮厤榪欐牱鐨勬儏鍐碉紝鍙互閫氳繃鍛戒護(hù)琛屽弬鏁伴檺瀹氭祴璇曞垎緇勭殑澶у皬錛屾垨鑰呭鍔爏ocket鐨勫彂閫?鎺ユ敹緙撳啿澶у皬銆俇DP_STREAM鏂瑰紡浣跨敤涓嶵CP_STREAM鏂瑰紡鐩稿悓鐨勫眬閮ㄥ懡浠よ鍙傛暟錛屽洜姝わ紝榪欓噷鍙互浣跨敤-m鏉ヤ慨鏀規(guī)祴璇曚腑浣跨敤鍒嗙粍鐨勫ぇ灝忥細(xì)

 ./netperf -t UDP_STREAM -H 192.168.0.28 -- -m 1024 UDP UNIDIRECTIONAL SEND TEST to 192.168.0.28 Socket  Message  Elapsed      Messages Size    Size     Time         Okay Errors   Throughput bytes   bytes    secs            #      #   10^6bits/sec    65535    1024   9.99       114127      0      93.55  65535           9.99       114122             93.54  

UDP_STREAM鏂瑰紡鐨勭粨鏋滀腑鏈変袱琛屾祴璇曟暟鎹紝絎竴琛屾樉紺虹殑鏄湰鍦扮郴緇熺殑鍙戦€佺粺璁★紝榪欓噷鐨勫悶鍚愰噺琛ㄧずnetperf鍚戞湰鍦皊ocket鍙戦€佸垎緇勭殑鑳藉姏銆備絾鏄紝鎴戜滑鐭ラ亾錛孶DP鏄笉鍙潬鐨勪紶杈撳崗璁紝鍙戦€佸嚭鍘葷殑鍒嗙粍鏁伴噺涓嶄竴瀹氱瓑浜庢帴鏀跺埌鐨勫垎緇勬暟閲忋€?/p>

絎簩琛屾樉紺虹殑灝辨槸榪滅緋葷粺鎺ユ敹鐨勬儏鍐碉紝鐢變簬client涓巗erver鐩存帴榪炴帴鍦ㄤ竴璧鳳紝鑰屼笖緗戠粶涓病鏈夊叾瀹冪殑嫻侀噺錛屾墍浠ユ湰鍦扮郴緇熷彂閫佽繃鍘葷殑鍒嗙粍鍑犱箮閮借榪滅緋葷粺姝g‘鐨勬帴鏀朵簡錛岃繙绔郴緇熺殑鍚炲悙閲忎篃鍑犱箮絳変簬鏈湴緋葷粺鐨勫彂閫佸悶鍚愰噺銆備絾鏄紝鍦ㄥ疄闄呯幆澧冧腑錛屼竴鑸繙绔郴緇熺殑socket緙撳啿澶у皬涓嶅悓浜庢湰鍦扮郴緇熺殑socket緙撳啿鍖哄ぇ灝忥紝鑰屼笖鐢變簬UDP鍗忚鐨勪笉鍙潬鎬э紝榪滅緋葷粺鐨勬帴鏀跺悶鍚愰噺瑕佽繙榪滃皬浜庡彂閫佸嚭鍘葷殑鍚炲悙閲忋€?/p>

嫻嬭瘯璇鋒眰/搴旂瓟錛坮equest/response錛夌綉緇滄祦閲忕殑鎬ц兘

鍙︿竴綾誨父瑙佺殑緗戠粶嫻侀噺綾誨瀷鏄簲鐢ㄥ湪client/server緇撴瀯涓殑request/response妯″紡銆傚湪姣忔浜ゆ槗錛坱ransaction錛変腑錛宑lient鍚憇erver鍙戝嚭灝忕殑鏌ヨ鍒嗙粍錛宻erver鎺ユ敹鍒拌姹傦紝緇忓鐞嗗悗榪斿洖澶х殑緇撴灉鏁版嵁銆傚涓嬪浘鎵€紺猴細(xì)


 

1錛?TCP_RR

TCP_RR鏂瑰紡鐨勬祴璇曞璞℃槸澶氭TCP request鍜宺esponse鐨勪氦鏄撹繃紼嬶紝浣嗘槸瀹冧滑鍙戠敓鍦ㄥ悓涓€涓猅CP榪炴帴涓紝榪欑妯″紡甯稿父鍑虹幇鍦ㄦ暟鎹簱搴旂敤涓€傛暟鎹簱鐨刢lient紼嬪簭涓巗erver紼嬪簭寤虹珛涓€涓猅CP榪炴帴浠ュ悗錛屽氨鍦ㄨ繖涓繛鎺ヤ腑浼犻€佹暟鎹簱鐨勫嬈′氦鏄撹繃紼嬨€?/p>
./netperf -t TCP_RR -H 192.168.0.28 TCP REQUEST/RESPONSE TEST to 192.168.0.28 Local /Remote Socket Size   Request  Resp.   Elapsed  Trans. Send   Recv   Size     Size    Time     Rate bytes  Bytes  bytes    bytes   secs.    per sec   16384  87380  1        1       10.00    9502.73 16384  87380 

Netperf杈撳嚭鐨勭粨鏋滀篃鏄敱涓よ緇勬垚銆傜涓€琛屾樉紺烘湰鍦扮郴緇熺殑鎯呭喌錛岀浜岃鏄劇ず鐨勬槸榪滅緋葷粺鐨勪俊鎭€傚鉤鍧囩殑浜ゆ槗鐜囷紙transaction rate錛変負(fù)9502.73嬈?縐掋€傛敞鎰忓埌榪欓噷姣忔浜ゆ槗涓殑request鍜宺esponse鍒嗙粍鐨勫ぇ灝忛兘涓?涓瓧鑺傦紝涓嶅叿鏈夊緢澶х殑瀹為檯鎰忎箟銆傜敤鎴峰彲浠ラ€氳繃嫻嬭瘯鐩稿叧鐨勫弬鏁版潵鏀瑰彉request鍜宺esponse鍒嗙粍鐨勫ぇ灝忥紝TCP_RR鏂瑰紡涓嬬殑鍙傛暟濡備笅琛ㄦ墍紺猴細(xì)

鍙傛暟璇存槑
-r req,resp璁劇疆request鍜宺eponse鍒嗙粍鐨勫ぇ灝?/td>
-s size璁劇疆鏈湴緋葷粺鐨剆ocket鍙戦€佷笌鎺ユ敹緙撳啿澶у皬
-S size璁劇疆榪滅緋葷粺鐨剆ocket鍙戦€佷笌鎺ユ敹緙撳啿澶у皬
-D瀵規(guī)湰鍦頒笌榪滅緋葷粺鐨剆ocket璁劇疆TCP_NODELAY閫夐」

閫氳繃浣跨敤-r鍙傛暟錛屾垜浠彲浠ヨ繘琛屾洿鏈夊疄闄呮剰涔夌殑嫻嬭瘯錛?/p>
./netperf -t TCP_RR -H 192.168.0.28 -- -r 32,1024 TCP REQUEST/RESPONSE TEST to 192.168.0.28 Local /Remote Socket Size   Request  Resp.   Elapsed  Trans. Send   Recv   Size     Size    Time     Rate bytes  Bytes  bytes    bytes   secs.    per sec   16384  87380  32       1024    10.00    4945.97 16384  87380 

浠庣粨鏋滀腑鍙互鐪嬪嚭錛岀敱浜巖equest/reponse鍒嗙粍鐨勫ぇ灝忓鍔犱簡錛屽鑷翠簡浜ゆ槗鐜囨槑鏄劇殑涓嬮檷銆?娉細(xì)鐩稿浜庡疄闄呯殑緋葷粺錛岃繖閲屼氦鏄撶巼鐨勮綆楁病鏈夊厖鍒嗚€冭檻鍒頒氦鏄撹繃紼嬩腑鐨勫簲鐢ㄧ▼搴忓鐞嗘椂寤訛紝鍥犳緇撴灉寰€寰€浼?xì)楂樹簬瀹為檯鎯呭嘃c(diǎn)€?/p>

2錛?TCP_CRR

涓嶵CP_RR涓嶅悓錛孴CP_CRR涓烘瘡嬈′氦鏄撳緩绔嬩竴涓柊鐨凾CP榪炴帴銆傛渶鍏稿瀷鐨勫簲鐢ㄥ氨鏄疕TTP錛屾瘡嬈TTP浜ゆ槗鏄湪涓€鏉″崟鐙殑TCP榪炴帴涓繘琛岀殑銆傚洜姝わ紝鐢變簬闇€瑕佷笉鍋滃湴寤虹珛鏂扮殑TCP榪炴帴錛屽茍涓斿湪浜ゆ槗緇撴潫鍚庢媶闄CP榪炴帴錛屼氦鏄撶巼涓€瀹氫細(xì)鍙楀埌寰堝ぇ鐨勫獎(jiǎng)鍝嶃€?/p>
./netperf -t TCP_CRR -H 192.168.0.28  TCP Connect/Request/Response TEST to 192.168.0.28 Local /Remote Socket Size   Request  Resp.   Elapsed  Trans. Send   Recv   Size     Size    Time     Rate bytes  Bytes  bytes    bytes   secs.    per sec   131070 131070 1        1       9.99     2662.20 16384  87380 

鍗充嬌鏄嬌鐢ㄤ竴涓瓧鑺傜殑request/response鍒嗙粍錛屼氦鏄撶巼涔熸槑鏄劇殑闄嶄綆浜嗭紝鍙湁2662.20嬈?縐掋€俆CP_CRR浣跨敤涓嶵CP_RR鐩稿悓鐨勫眬閮ㄥ弬鏁般€?/p>

3錛?UDP_RR

UDP_RR鏂瑰紡浣跨敤UDP鍒嗙粍榪涜request/response鐨勪氦鏄撹繃紼嬨€傜敱浜庢病鏈塗CP榪炴帴鎵€甯︽潵鐨勮礋鎷咃紝鎵€浠ユ垜浠帹嫻嬩氦鏄撶巼涓€瀹氫細(xì)鏈夌浉搴旂殑鎻愬崌銆?/p>
./netperf -t UDP_RR -H 192.168.0.28  UDP REQUEST/RESPONSE TEST to 192.168.0.28 Local /Remote Socket Size   Request  Resp.   Elapsed  Trans. Send   Recv   Size     Size    Time     Rate bytes  Bytes  bytes    bytes   secs.    per sec   65535  65535  1        1       9.99     10141.16 65535  65535 

緇撴灉璇佸疄浜嗘垜浠殑鎺ㄦ祴錛屼氦鏄撶巼涓?0141.16嬈?縐掞紝楂樿繃TCP_RR鐨勬暟鍊箋€備笉榪囷紝濡傛灉鍑虹幇浜嗙浉鍙嶇殑緇撴灉錛屽嵆浜ゆ槗鐜囧弽鑰岄檷浣庝簡錛屼篃涓嶉渶瑕佹媴蹇冿紝鍥犱負(fù)榪欒鏄庝簡鍦ㄧ綉緇滀腑錛岃礬鐢卞櫒鎴栧叾瀹冪殑緗戠粶璁懼瀵筓DP閲囩敤浜嗕笌TCP涓嶅悓鐨勭紦鍐插尯絀洪棿鍜屽鐞嗘妧鏈€?/p>

http://www.ibm.com/developerworks/cn/linux/l-netperf/


Todd 2012-03-29 22:45 鍙戣〃璇勮
]]>
[杞琞鏆撮洩鎬昏鎬葷粨娓告垙鍗佹潯緇忛獙 http://www.aygfsteel.com/Todd/archive/2012/03/19/372197.htmlToddToddMon, 19 Mar 2012 07:33:00 GMThttp://www.aygfsteel.com/Todd/archive/2012/03/19/372197.htmlhttp://www.aygfsteel.com/Todd/comments/372197.htmlhttp://www.aygfsteel.com/Todd/archive/2012/03/19/372197.html#Feedback0http://www.aygfsteel.com/Todd/comments/commentRss/372197.htmlhttp://www.aygfsteel.com/Todd/services/trackbacks/372197.html鏆撮洩鍒涘姙浜哄吋鎬昏Michael Morhaime鍦℅DC Austin涓婂彂琛ㄤ簡婕旇錛岃皥璁轟粬浠庛€婇瓟鍏戒笘鐣屻€嬪拰鍏朵粬鏆撮洩娓告垙涓€葷粨鍑烘潵鐨勫崄鏉$粡楠屻€?br style="word-wrap: break-word; " />
1·娓告垙鎬х涓€銆?br style="word-wrap: break-word; " />
    濡傛灉浣犱簡瑙f毚闆紝閭d綘鐭ラ亾浠栦滑鍦ㄦ父鎴忓鉤琛℃€т笂鍔涘敖瀹岀編錛屾垨鑰呰姣斾換浣曚漢鍋氱殑閮藉ソ銆傛毚闆摬瀛﹀ソ鎳備絾闅炬帉鎻°€備粬浠笇鏈涗綘鍏ラ棬瀹規(guī)槗鑰岀淮鎸侀暱鏃墮棿鐨勫叴瓚o紝鐢ㄥ悓涓€嬈句駭鍝佸悓鏃跺惛寮曚紤闂插拰鏍稿績鐜╁銆?br style="word-wrap: break-word; " />
2·鎵撻€犲茍淇濇姢鍝佺墝銆?br style="word-wrap: break-word; " />
    鏆撮洩鐨勭洰鏍囨槸瑕佹秷璐硅€呰繘鍏ュ晢搴楋紝鐪嬪埌鏆撮洩鐨勫晢鏍囧氨鐭ラ亾閭f槸濂戒笢瑗褲€備絾涓漢璁や負(fù)鏆撮洩榪欐柟闈㈠仛鐨勪笉濂斤紝涓轟綍錛熶粬浠璐熶簡鍙€滅殑BNetD錛堟垬緗戠鏈嶏級浜哄憳錛屾帶鍛婁竴緹ゆ病鏈夊弽鎶楄兘鍔涚殑寮€鍙戣€呫€傛毚闆湡鍧忋€?br style="word-wrap: break-word; " />
3·鎶楁嫆鎻愭棭涓婂競鐨勮鎯戙€?br style="word-wrap: break-word; " />
    榪欎竴鐐瑰緢澶氫漢閮藉仛涓嶅埌銆傛父鎴忔槸瑕佸湪瀹屾垚涔嬪悗鍐嶆帹鍑猴紝鑰屼笉鏄綋鏃ュ巻涓婃煇涓椂鍊欏埌鏉ャ€傚鏋滅収鐫€鏃ュ巻鍔炰簨錛岄偅浣犵殑緇撴灉灝辨槸鍒涗笘綰?錛屾洿緋熺硶鐨勶紝灝辨槸澶歜ug鐨勫井杞伓姊﹁埇鐨勬搷浣滅郴緇熴€?br style="word-wrap: break-word; " />
    Michael鎸囧嚭錛屽叕鍙稿簲璇ョ敤闀胯繙鐨勭洰鍏夊幓鐪嬶紝鑰屼笉鏄€冭檻鐭湡銆傜煭鏈熻€冭檻閫氬父涓嶄細(xì)鏈夊ソ緇撴灉銆傘€婃殫榛戠牬鍧忕銆嬮敊榪囦簡鍦h癁鍋囨湡錛屽湪12鏈?1鏃ユ帹鍑恒€備綘浼?xì)瑙夊緱鏆楅粦鏄釜閿櫂q囦簡鍦h癁鐨勬父鎴忥紝榪樻槸涓崠浜嗗嚑鐧句竾鐨勬父鎴忥紵銆婄噧鐑ц繙寰併€嬩篃閿欒繃浜嗗湥璇炲亣鏈燂紝浣嗗湪絎竴澶╁氨鍗栧嚭浜?40涓囦喚銆?br style="word-wrap: break-word; " />
4·涓嶈鎵€鏈変笢瑗塊兘鍚屾椂鍋氥€?br style="word-wrap: break-word; " />
    鐭ラ亾鑷繁鑳藉仛浠€涔堬紝鐒跺悗鎶婂畠鍋氬ソ銆傘€婇瓟鍏戒笘鐣屻€嬪茍涓嶆槸浠栦滑絎竴嬈懼湪綰挎父鎴忥紝銆婇瓟鍏?銆嬪氨鏈夊ぇ閲忓湪綰垮唴瀹癸紝銆婃殫榛?銆嬩篃鏄€備粠瀹冧滑涔嬩腑鍚稿彇緇忛獙錛學(xué)OW灝辮癁鐢熶簡銆?br style="word-wrap: break-word; " />
5·鏆撮洩鏄竴涓叏鐞冩€х殑浼佷笟銆?br style="word-wrap: break-word; " />
    瀹冩浘緇忓彧鏄編鍥界殑鍏徃銆備笢瑗垮厛鍋氬ソ鑻辨枃鐨勫啀鍘誨仛鍏跺畠鍦板尯鐨勩€傛父鎴忓厛鍦ㄥ寳緹庡彂鍞紝鐒跺悗鍒版媧詫紝鐒跺悗鍒板叾瀹冨湴鏂廣€傝繖縐嶅仛娉曟湁濂戒簺寮婄銆?br style="word-wrap: break-word; " />
    鏄熼檯浜夐湼錛岄煩鍥界殑鍥藉綰ф父鎴忥紝鏄劇ず鐨勫嵈涓嶆槸鏈湴璇█銆傚敮涓€鏈夋湰鍦拌璦€鐨勬槸鏃ユ湰鐗堬紝浣嗚繖涓増鏈張涓庡叾瀹冪殑鍐茬獊錛岄煩鍥戒漢鐜╃殑鏄嫳鏂囩増銆傝€屽寳緹庡拰嬈ф床鐨勭伆鑹插競鍦烘剰鍛崇潃褰撴父鎴忓湪緹庡浗鍙戝敭錛岄偅鍦ㄦ媧插彂鍞棩鏈熶箣鍓嶄漢浠氨鑳芥嬁鍒板畠錛岃€屽綋娓告垙姝e紡鍦ㄦ媧插彂鍞殑鏃跺€欙紝浜轟滑宸茬粡涔板埌浜嗭紝閿€鍞嚜鐒朵笉濂斤紝闆跺敭鍟嗕篃涓嶉珮鍏淬€?br style="word-wrap: break-word; " />
    瑙e喅鏂規(guī)硶灝辨槸騫崇瓑鐨勫寰呮墍鏈夌帺瀹躲€傝繘琛屽叏鐞冭寖鍥寸殑鍚屾鍙戝敭銆傝繖闇€瑕佹洿澶氭椂闂達(dá)紝浣嗙粷瀵瑰€煎緱銆傘€婃殫榛?銆嬩究鏄叏鐞冨悓鏃跺彂鍞紝鑰岀粨鏋滀篃鐩稿綋濂姐€?br style="word-wrap: break-word; " />
6·鍦板尯鎬у彛鍛崇殑紲炶瘽銆?br style="word-wrap: break-word; " />
    鏆撮洩涓嶇浉淇℃湁鍦板尯鎬у彛鍛寵繖鐜╂剰鍎匡紝鍏ㄧ悆鍏磋叮閮芥槸涓€鏍風(fēng)殑錛屽彧鏄漢鏁頒笉鍚屻€傚鏋滀綘鍒朵綔涓€嬈鵑€傚悎鎵€鏈変漢鍙e懗寰楁父鎴忥紝閭d綘灝變笉鐢ㄩ拡瀵規(guī)瘡涓競鍦哄悇鍋氫竴涓増鏈簡銆?br style="word-wrap: break-word; " />
    鏈変竴浠朵簨榪樻槸寰楁敞鎰忥紝灝辨槸鏂囧寲闂錛屾瘮濡傞瓟鍏?閲岀殑鐔婄尗銆傛父鎴忛噷鐨勭唺鐚┛鐫€鏃ユ湰鏈嶈鎷跨潃鏃ユ湰姝﹀櫒銆備腑鍥界帺瀹跺姝ら鏈夋€ㄨ█銆傚洜姝ゅ畠鍚庢潵灝辨敼絀夸簡涓紡鏈嶈鍜屼腑寮忔鍣紝闂灝辮В鍐充簡銆?br style="word-wrap: break-word; " />
7·榪愯惀緗戠粶娓告垙涓嶅睘浜庢父鎴忓紑鍙戙€?br style="word-wrap: break-word; " />
    浣犲湪涓変釜澶ч檰涓?4灝忔椂涓嶅仠寰楄繍琛岀潃鏁板崈鍙版湇鍔″櫒銆備綘榪橀渶瑕佺鐞嗕竴緹ゆ椿璺冧絾铏氭嫙鐨勭ぞ鍖恒€?br style="word-wrap: break-word; " />
    涓句釜渚嬪瓙錛屼綘鐨勫紑鍙戝皬緇勫湪涓烘父鎴忓鍔犲唴瀹癸紝浣嗗鏋滃皬緇勯渶瑕佷慨姝f湇鍔″櫒鐨勯棶棰橈紝浠栦滑灝變笉鑳界戶緇紑鍙戦偅浜涘唴瀹癸紝鍝釜鏇撮噸瑕侊紵鏆撮洩鐗瑰埆鎴愮珛浜嗕竴涓皬緇勪笓闂ㄥ簲浠樻父鎴忛噷鐨勯棶棰橈紝榪欐牱寮€鍙戝皬緇勫氨鍙互涓撴敞浜庝粬浠殑宸ヤ綔浜嗐€?br style="word-wrap: break-word; " />
8·浜ゆ祦銆傚唴閮ㄤ氦嫻併€佸閮ㄤ氦嫻併€?br style="word-wrap: break-word; " />
    濡傛灉浣犳湁紺懼尯錛岃窡浠栦滑浜よ皥錛岀粡甯哥殑錛屾竻妤氱殑銆傚鏋滄湁涓ぇbug錛屾垨鑰呮湇鍔″櫒鎸備簡錛屽伐浣滀漢鍛橀┈涓婂氨寮€濮嬪伐浣滐紝浠栦滑涓嶄細(xì)鍒拌鍧涢噷瑙i噴闂錛屾椂闂村氨榪欐牱嫻垂浜嗐€?br style="word-wrap: break-word; " />
    鍥犱負(fù)榪欐牱錛屽唴閮ㄦ棤鍏充漢鍛樹笉鐭ラ亾鍙戠敓浜嗕粈涔堜簨錛屽闈㈢殑浜轟篃涓嶇煡閬撳彂鐢熶簡浠€涔堜簨錛岀劧鍚庝漢浠紑濮嬫姄鐙傦紝鍦ㄨ鍧涗笂鐤媯鍙戣創(chuàng)鐒跺悗璁哄潧灝辨寕浜嗐€?br style="word-wrap: break-word; " />
    涓轟簡瑙e喅榪欎釜闂錛屾毚闆緩绔嬩簡涓€涓寮忕殑閭歡緋葷粺銆傚紑鍙戝皬緇勫彲浠ヤ笌鍐呴儴浜哄憳浜ゆ祦錛屾秷鎭彲浠ユ湁縐╁簭鐨勪紶鎾紑鍘匯€?br style="word-wrap: break-word; " />
9·閬垮厤娑夊強(qiáng)閲戦挶銆?br style="word-wrap: break-word; " />
    鍙浣犲湪WOW閲屾樉闇插嚭涓€鐐瑰晢鏈猴紝浜轟滑灝變細(xì)婊ョ敤瀹冦€傚鏋滀綘鎶婂畠闅愯棌錛岄棶棰樺氨鍙樺皬浜嗐€傚鏋滃潖浜轟笉鑳借禋閽憋紝娣橀噾銆佺獌鍙栧笎鍙楓€佷吉閫犱俊鐢ㄥ崱絳夌瓑榪欎簺闂灝變笉鍐嶅瓨鍦ㄤ簡銆?br style="word-wrap: break-word; " />
10·鎸佺畫嫻嬭瘯娓告垙銆?br style="word-wrap: break-word; " />
    涓嶈鐩鎬俊Ver.1.0銆備綘嫻嬭瘯鐨勮秺澶氬氨瓚婂ソ錛屼絾寰堝皯浜鴻兘鍋氬埌銆傚湪鏆撮洩錛屾瘡鏃舵瘡鍒繪瘡浜洪兘鍦ㄦ祴璇曘€傚厛鏈夊皝嫻嬶紝鐒跺悗鍏祴錛岀劧鍚庡彂鍞紝甯屾湜娓告垙鍒頒簡鍙戝敭鏃ョ殑鏃跺€欒兘鏈夊鉤琛℃€с€佹祦鐣呫€佹棤bug銆?br style="word-wrap: break-word; " />
    鏆撮洩鍦ㄧ噧鐑ц繙寰佺殑鍙戝敭涓婄浉褰撴帴榪戣繖涓洰鏍囥€傛湇鍔″櫒鐨勭粨鏋勫崌綰т互鍑忓皯緗戠粶寤惰繜錛屽茍鎻愬崌浜嗗閲忋€備粬浠ˉ鍏呬簡寰堝鐨勫唴瀹癸紝鏈€鍚庢妸鍙戝敭鏃ユ湡鎺ㄨ繜鍒板畬鎴愮殑閭d竴澶┿€?br style="word-wrap: break-word; " />
    鏈€鍚庯紝浠栦滑鍦ㄥ綋鍦版椂闂村噷鏅ㄥ彂鍞簡銆備竴澶╁崠鎺変簡240涓囦喚錛岃繖鏄緢濂界殑鎴愮嘩銆傛湁綆$悊鍛樿〃紺哄綋浠栫湅鐫€鏈嶅姟鍣ㄧ殑鐏竴涓帴涓€涓寒璧鋒潵鐨勬椂鍊欎粬鎰熷埌闈炲父嬈f叞銆?br style="word-wrap: break-word; " />
    鏆撮洩濂嬫枟浜?6騫達(dá)紝鐜板湪鏈夋暟鐧句竾鐜╁鍦ㄧ嚎娓告垙錛屼粬浠仛鍑轟簡涓嶉敊鐨勬垚緇┿€備換浣曟妧鏈兘浼?xì)鍑虹幇闂锛屼絾鏆撮洩鎬昏兘鎶婂畠浠噺杞匯€傚笇鏈涙棩鍚庣殑緗戠粶娓告垙鍙互浠庝粬浠殑閿欒鍜屾垚鍔熶腑瀛﹀埌涓€浜涚粡楠?/td>

Todd 2012-03-19 15:33 鍙戣〃璇勮
]]>
銆?銆慺reebsd 瀹夎錛岀幆澧冿紝璧勬枡http://www.aygfsteel.com/Todd/archive/2012/02/09/369634.htmlToddToddWed, 08 Feb 2012 17:26:00 GMThttp://www.aygfsteel.com/Todd/archive/2012/02/09/369634.htmlhttp://www.aygfsteel.com/Todd/comments/369634.htmlhttp://www.aygfsteel.com/Todd/archive/2012/02/09/369634.html#Feedback0http://www.aygfsteel.com/Todd/comments/commentRss/369634.htmlhttp://www.aygfsteel.com/Todd/services/trackbacks/369634.html1.涓枃浣跨敤鎵嬪唽 蹇呭
http://www.freebsd.org/doc/zh_CN/books/handbook/index.html
寮€鍙戞墜鍐?br />http://www.freebsd.org/doc/en/books/developers-handbook/index.html
2.緋葷粺瀹夎
緋葷粺瀹夎鍖匜reeBSD-8.2-RELEASE-i386-disc1.iso 鍦板潃錛?br />ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/8.2/
鎴栬€呬嬌鐢ㄧ綉鏄撶殑闀滃儚鍦板潃涓嬭澆錛?br />http://mirrors.163.com/FreeBSD/ISO-IMAGES-i386/8.2/
浣跨敤铏氭嫙鍏夐┍鍔犺澆iso鏂囦歡錛屽湪vm涓姞杞藉畨瑁?br />瀹夎姝ラ鍙傝銆婃墜鍐屻€嬪湴鍧€錛?br />http://www.freebsd.org/doc/zh_CN/books/handbook/using-sysinstall.html
鎴戜嬌鐢ㄦ爣鍑嗗畨瑁咃紝瀹夎姝ラ寰堣緇嗭紝鑻ヨssh,鏍囧噯瀹夎涓甫ssh,媯€(gè)鏌ヤ笅rc.conf涓?pre class="SCREEN">sshd_enable="YES"
gcc涔熸槸鑷甫瑁呭ソ鐨勶紝鍙互hello楠岃瘉涓?br />#include <stdio.h>
int main()
{
        printf("hello,todd^^\n");
        return 0;
}
>gcc hello.c -o hello
>./hello
>hello,todd^^
嬈т簡






Todd 2012-02-09 01:26 鍙戣〃璇勮
]]>
[杞琞linux涓嬫姄鍖呭懡浠?-tcpdump鐨勪嬌鐢?/title><link>http://www.aygfsteel.com/Todd/archive/2012/02/06/369460.html</link><dc:creator>Todd</dc:creator><author>Todd</author><pubDate>Mon, 06 Feb 2012 02:38:00 GMT</pubDate><guid>http://www.aygfsteel.com/Todd/archive/2012/02/06/369460.html</guid><wfw:comment>http://www.aygfsteel.com/Todd/comments/369460.html</wfw:comment><comments>http://www.aygfsteel.com/Todd/archive/2012/02/06/369460.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Todd/comments/commentRss/369460.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Todd/services/trackbacks/369460.html</trackback:ping><description><![CDATA[<div><div>渚?tcpdump host 172.16.29.40 and port 4600 -X -s 500 </div><div></div><div>tcpdump閲囩敤鍛戒護(hù)琛屾柟寮忥紝瀹冪殑鍛戒護(hù)鏍煎紡涓猴細(xì)</div><div>銆€銆€tcpdump [ -adeflnNOpqStvx ] [ -c 鏁伴噺 ] [ -F 鏂囦歡鍚?]</div><div>銆€銆€銆€銆€銆€銆€銆€銆€銆€銆€[ -i 緗戠粶鎺ュ彛 ] [ -r 鏂囦歡鍚峕 [ -s snaplen ]</div><div>銆€銆€銆€銆€銆€銆€銆€銆€銆€銆€[ -T 綾誨瀷 ] [ -w 鏂囦歡鍚?] [琛ㄨ揪寮?]</div><div></div><div>銆€銆€1. tcpdump鐨勯€夐」浠嬬粛</div><div>銆€銆€銆€-a 銆€銆€銆€灝嗙綉緇滃湴鍧€鍜屽箍鎾湴鍧€杞彉鎴愬悕瀛楋紱</div><div>銆€銆€銆€-d 銆€銆€銆€灝嗗尮閰嶄俊鎭寘鐨勪唬鐮佷互浜轟滑鑳藉鐞嗚В鐨勬眹緙栨牸寮忕粰鍑猴紱</div><div>銆€銆€銆€-dd 銆€銆€銆€灝嗗尮閰嶄俊鎭寘鐨勪唬鐮佷互c璇█紼嬪簭孌電殑鏍煎紡緇欏嚭錛?/div><div>銆€銆€銆€-ddd 銆€銆€銆€灝嗗尮閰嶄俊鎭寘鐨勪唬鐮佷互鍗佽繘鍒剁殑褰㈠紡緇欏嚭錛?/div><div>銆€銆€銆€-e 銆€銆€銆€鍦ㄨ緭鍑鴻鎵撳嵃鍑烘暟鎹摼璺眰鐨勫ご閮ㄤ俊鎭紱</div><div>銆€銆€銆€-f 銆€銆€銆€灝嗗閮ㄧ殑Internet鍦板潃浠ユ暟瀛楃殑褰㈠紡鎵撳嵃鍑烘潵錛?/div><div>銆€銆€銆€-l 銆€銆€銆€浣挎爣鍑嗚緭鍑哄彉涓虹紦鍐茶褰㈠紡錛?/div><div>銆€銆€銆€-n 銆€銆€銆€涓嶆妸緗戠粶鍦板潃杞崲鎴愬悕瀛楋紱</div><div>銆€銆€銆€-t 銆€銆€銆€鍦ㄨ緭鍑虹殑姣忎竴琛屼笉鎵撳嵃鏃墮棿鎴籌紱</div><div>銆€銆€銆€-v 銆€銆€銆€杈撳嚭涓€涓◢寰緇嗙殑淇℃伅錛屼緥濡傚湪ip鍖呬腑鍙互鍖呮嫭ttl鍜屾湇鍔$被鍨嬬殑淇℃伅錛?/div><div>銆€銆€銆€-vv 銆€銆€銆€杈撳嚭璇︾粏鐨勬姤鏂囦俊鎭紱</div><div>銆€銆€銆€-c 銆€銆€銆€鍦ㄦ敹鍒版寚瀹氱殑鍖呯殑鏁扮洰鍚庯紝tcpdump灝變細(xì)鍋滄錛?/div><div>銆€銆€銆€-F 銆€銆€銆€浠庢寚瀹氱殑鏂囦歡涓鍙栬〃杈懼紡,蹇界暐鍏跺畠鐨勮〃杈懼紡錛?/div><div>銆€銆€銆€-i 銆€銆€銆€鎸囧畾鐩戝惉鐨勭綉緇滄帴鍙o紱</div><div>銆€銆€銆€-r 銆€銆€銆€浠庢寚瀹氱殑鏂囦歡涓鍙栧寘(榪欎簺鍖呬竴鑸€氳繃-w閫夐」浜х敓)錛?/div><div>銆€銆€銆€-w 銆€銆€銆€鐩存帴灝嗗寘鍐欏叆鏂囦歡涓紝騫朵笉鍒嗘瀽鍜屾墦鍗板嚭鏉ワ紱</div><div>銆€銆€銆€-T 銆€銆€銆€灝嗙洃鍚埌鐨勫寘鐩存帴瑙i噴涓烘寚瀹氱殑綾誨瀷鐨勬姤鏂囷紝甯歌鐨勭被鍨嬫湁rpc 錛堣繙紼嬭繃紼?/div><div>璋冪敤錛夊拰snmp錛堢畝鍗曘€€銆€銆€銆€銆€銆€銆€緗戠粶綆$悊鍗忚錛涳級</div><div></div><div>銆€銆€2. tcpdump鐨勮〃杈懼紡浠嬬粛</div><div>銆€銆€銆€琛ㄨ揪寮忔槸涓€涓鍒欒〃杈懼紡錛宼cpdump鍒╃敤瀹冧綔涓鴻繃婊ゆ姤鏂囩殑鏉′歡錛屽鏋滀竴涓姤鏂囨弧瓚寵〃</div><div>杈懼紡鐨勬潯浠訛紝鍒欒繖涓姤鏂囧皢浼?xì)琚崟鑾枫€傚鏋滄病鏈夌粰鍑轟換浣曟潯浠訛紝鍒欑綉緇滀笂鎵€鏈夌殑淇℃伅鍖呭皢浼?/div><div>琚埅鑾楓€?/div><div>銆€銆€銆€鍦ㄨ〃杈懼紡涓竴鑸涓嬪嚑縐嶇被鍨嬬殑鍏抽敭瀛楋紝涓€縐嶆槸鍏充簬綾誨瀷鐨勫叧閿瓧錛屼富瑕佸寘鎷琱ost錛?/div><div>net錛宲ort, 渚嬪 host 210.27.48.2錛屾寚鏄?210.27.48.2鏄竴鍙頒富鏈猴紝net 202.0.0.0 鎸囨槑</div><div>202.0.0.0鏄竴涓綉緇滃湴鍧€錛宲ort 23 鎸囨槑绔彛鍙鋒槸23銆傚鏋滄病鏈夋寚瀹氱被鍨嬶紝緙虹渷鐨勭被鍨嬫槸</div><div>host.</div><div>銆€銆€銆€絎簩縐嶆槸紜畾浼犺緭鏂瑰悜鐨勫叧閿瓧錛屼富瑕佸寘鎷瑂rc , dst ,dst or src, dst and src ,</div><div>榪欎簺鍏抽敭瀛楁寚鏄庝簡浼犺緭鐨勬柟鍚戙€備婦渚嬭鏄庯紝src 210.27.48.2 ,鎸囨槑ip鍖呬腑婧愬湴鍧€鏄?10.27.</div><div>48.2 , dst net 202.0.0.0 鎸囨槑鐩殑緗戠粶鍦板潃鏄?02.0.0.0 銆傚鏋滄病鏈夋寚鏄庢柟鍚戝叧閿瓧錛屽垯</div><div>緙虹渷鏄痵rc or dst鍏抽敭瀛椼€?/div><div>銆€銆€銆€絎笁縐嶆槸鍗忚鐨勫叧閿瓧錛屼富瑕佸寘鎷琭ddi,ip ,arp,rarp,tcp,udp絳夌被鍨嬨€侳ddi鎸囨槑鏄湪</div><div>FDDI(鍒嗗竷寮忓厜綰ゆ暟鎹帴鍙g綉緇?涓婄殑鐗瑰畾鐨勭綉緇滃崗璁紝瀹為檯涓婂畠鏄?ether"鐨勫埆鍚嶏紝fddi鍜宔</div><div>ther鍏鋒湁綾諱技鐨勬簮鍦板潃鍜岀洰鐨勫湴鍧€錛屾墍浠ュ彲浠ュ皢fddi鍗忚鍖呭綋浣渆ther鐨勫寘榪涜澶勭悊鍜屽垎鏋愩€?/div><div>鍏朵粬鐨勫嚑涓叧閿瓧灝辨槸鎸囨槑浜嗙洃鍚殑鍖呯殑鍗忚鍐呭銆傚鏋滄病鏈夋寚瀹氫換浣曞崗璁紝鍒檛cpdump灝嗕細(xì)</div><div>鐩戝惉鎵€鏈夊崗璁殑淇℃伅鍖呫€?/div><div>銆€銆€銆€闄や簡榪欎笁縐嶇被鍨嬬殑鍏抽敭瀛椾箣澶栵紝鍏朵粬閲嶈鐨勫叧閿瓧濡備笅錛歡ateway, broadcast,less,</div><div>greater,榪樻湁涓夌閫昏緫榪愮畻錛屽彇闈炶繍綆楁槸 'not ' '! ', 涓庤繍綆楁槸'and','&&';鎴栬繍綆?鏄?o</div><div>r' ,'||'錛?/div><div>銆€銆€銆€榪欎簺鍏抽敭瀛楀彲浠ョ粍鍚堣搗鏉ユ瀯鎴愬己澶х殑緇勫悎鏉′歡鏉ユ弧瓚充漢浠殑闇€瑕侊紝涓嬮潰涓懼嚑涓緥瀛愭潵</div><div>璇存槑銆?/div><div>銆€銆€銆€(1)鎯寵鎴幏鎵€鏈?10.27.48.1 鐨勪富鏈烘敹鍒扮殑鍜屽彂鍑虹殑鎵€鏈夌殑鏁版嵁鍖咃細(xì)</div><div>銆€銆€銆€銆€#tcpdump host 210.27.48.1 </div><div>銆€銆€銆€(2) 鎯寵鎴幏涓繪満210.27.48.1 鍜屼富鏈?10.27.48.2 鎴?10.27.48.3鐨勯€氫俊錛屼嬌鐢ㄥ懡浠?/div><div>錛氾紙鍦ㄥ懡浠よ涓€傜敤銆€銆€銆€鎷彿鏃訛紝涓€瀹氳</div><div>銆€銆€銆€銆€#tcpdump host 210.27.48.1 and \ (210.27.48.2 or 210.27.48.3 \) </div><div>銆€銆€銆€(3) 濡傛灉鎯寵鑾峰彇涓繪満210.27.48.1闄や簡鍜屼富鏈?10.27.48.2涔嬪鎵€鏈変富鏈洪€氫俊鐨刬p鍖?/div><div>錛屼嬌鐢ㄥ懡浠わ細(xì)</div><div>銆€銆€銆€銆€#tcpdump ip host 210.27.48.1 and ! 210.27.48.2</div><div>銆€銆€銆€(4)濡傛灉鎯寵鑾峰彇涓繪満210.27.48.1鎺ユ敹鎴栧彂鍑虹殑telnet鍖咃紝浣跨敤濡備笅鍛戒護(hù)錛?/div><div>銆€銆€銆€銆€#tcpdump tcp port 23 host 210.27.48.1 </div><div></div><div>銆€銆€3. tcpdump 鐨勮緭鍑虹粨鏋滀粙緇?/div><div>銆€銆€銆€涓嬮潰鎴戜滑浠嬬粛鍑犵鍏稿瀷鐨則cpdump鍛戒護(hù)鐨勮緭鍑轟俊鎭?/div><div>銆€銆€銆€(1) 鏁版嵁閾捐礬灞傚ご淇℃伅</div><div>銆€銆€銆€浣跨敤鍛戒護(hù)#tcpdump --e host ice</div><div>銆€銆€銆€ice 鏄竴鍙拌鏈塴inux鐨勪富鏈猴紝濂圭殑MAC鍦板潃鏄?錛?0錛?7錛?8錛欰F錛?A</div><div>銆€銆€銆€H219鏄竴鍙拌鏈塖OLARIC鐨凷UN宸ヤ綔绔欙紝瀹冪殑MAC鍦板潃鏄?錛?錛?0錛?9錛?B錛?6錛涗笂涓€鏉?/div><div>鍛戒護(hù)鐨勮緭鍑虹粨鏋滃涓嬫墍紺猴細(xì)</div><div>21:50:12.847509 eth0 < 8:0:20:79:5b:46 0:90:27:58:af:1a ip 60: h219.33357 > ice.</div><div>telne</div><div>t 0:0(0) ack 22535 win 8760 (DF)</div><div>銆€銆€鍒嗘瀽錛?1錛?0錛?2鏄樉紺虹殑鏃墮棿錛?847509鏄疘D鍙鳳紝eth0 <琛ㄧず浠庣綉緇滄帴鍙th0 鎺ュ彈璇?/div><div>鏁版嵁鍖咃紝eth0 >琛ㄧず浠庣綉緇滄帴鍙h澶囧彂閫佹暟鎹寘, 8:0:20:79:5b:46鏄富鏈篐219鐨凪AC鍦板潃,瀹?/div><div>琛ㄦ槑鏄粠婧愬湴鍧€H219鍙戞潵鐨勬暟鎹寘. 0:90:27:58:af:1a鏄富鏈篒CE鐨凪AC鍦板潃,琛ㄧず璇ユ暟鎹寘鐨?/div><div>鐩殑鍦板潃鏄疘CE . ip 鏄〃鏄庤鏁版嵁鍖呮槸IP鏁版嵁鍖?60 鏄暟鎹寘鐨勯暱搴? h219.33357 > ice.</div><div>telnet 琛ㄦ槑璇ユ暟鎹寘鏄粠涓繪満H219鐨?3357绔彛鍙戝線涓繪満ICE鐨凾ELNET(23)绔彛. ack 22535</div><div>琛ㄦ槑瀵瑰簭鍒楀彿鏄?22535鐨勫寘榪涜鍝嶅簲. win 8760琛ㄦ槑鍙戦€佺獥鍙g殑澶у皬鏄?760.</div><div></div><div>銆€銆€(2) ARP鍖呯殑TCPDUMP杈撳嚭淇℃伅</div><div>銆€銆€銆€浣跨敤鍛戒護(hù)#tcpdump arp </div><div>銆€銆€銆€寰楀埌鐨勮緭鍑虹粨鏋滄槸錛?/div><div>銆€銆€22:32:42.802509 eth0 > arp who-has route tell ice (0:90:27:58:af:1a)</div><div>銆€銆€22:32:42.802902 eth0 < arp reply route is-at 0:90:27:12:10:66 (0:90:27:58:af</div><div>:1a)</div><div>銆€銆€鍒嗘瀽: 22:32:42鏄椂闂存埑, 802509鏄疘D鍙? eth0 >琛ㄦ槑浠庝富鏈哄彂鍑鴻鏁版嵁鍖? arp琛ㄦ槑鏄?/div><div>ARP璇鋒眰鍖? who-has route tell ice琛ㄦ槑鏄富鏈篒CE璇鋒眰涓繪満ROUTE鐨凪AC鍦板潃銆?0:90:27:5</div><div>8:af:1a鏄富鏈篒CE鐨凪AC鍦板潃銆?/div><div></div><div>銆€銆€(3) TCP鍖呯殑杈撳嚭淇℃伅</div><div>銆€銆€銆€鐢═CPDUMP鎹曡幏鐨凾CP鍖呯殑涓€鑸緭鍑轟俊鎭槸錛?/div><div>銆€銆€src > dst: flags data-seqno ack window urgent options</div><div>銆€銆€src > dst:琛ㄦ槑浠庢簮鍦板潃鍒扮洰鐨勫湴鍧€, flags鏄疶CP鍖呬腑鐨勬爣蹇椾俊鎭?S 鏄疭YN鏍囧織, F (F</div><div>IN), P (PUSH) , R (RST) "." (娌℃湁鏍囪); data-seqno鏄暟鎹寘涓殑鏁版嵁鐨勯『搴忓彿, ack鏄?/div><div>涓嬫鏈熸湜鐨勯『搴忓彿, window鏄帴鏀剁紦瀛樼殑紿楀彛澶у皬, urgent琛ㄦ槑鏁版嵁鍖呬腑鏄惁鏈夌揣鎬ユ寚閽? </div><div>Options鏄€夐」.</div><div></div><div>銆€銆€(4) UDP鍖呯殑杈撳嚭淇℃伅</div><div>銆€銆€銆€鐢═CPDUMP鎹曡幏鐨刄DP鍖呯殑涓€鑸緭鍑轟俊鎭槸錛?/div><div>銆€銆€route.port1 > ice.port2: udp lenth</div><div>銆€銆€UDP鍗佸垎綆€鍗曪紝涓婇潰鐨勮緭鍑鴻琛ㄦ槑浠庝富鏈篟OUTE鐨刾ort1绔彛鍙戝嚭鐨勪竴涓猆DP鏁版嵁鍖呭埌涓繪満</div><div>ICE鐨刾ort2绔彛錛岀被鍨嬫槸UDP錛?鍖呯殑闀垮害鏄痩enth <br />=====================================================<br /><div><div class="wmqeeuq" id="appShareTitle" style="word-wrap: break-word; height: 24px; line-height: 24px; font-weight: bold; color: #333333; font-family: arial; background-color: #f4f8fb; ">tcpdump鎶撳寘鍒嗘瀽璇﹁В</div><div class="wmqeeuq" id="appShareOpt" style="word-wrap: break-word; text-align: right; margin-bottom: 10px; margin-right: 5px; line-height: 24px; font-family: arial; background-color: #f4f8fb; "></div><div class="wmqeeuq" id="app-share-content" style="word-wrap: break-word; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #edf1f4; border-right-color: #edf1f4; border-bottom-color: #edf1f4; border-left-color: #edf1f4; border-image: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f4f8fb; padding-top: 20px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px; color: #9a9a9a; font-size: 12px; font-family: arial; "><div style="word-wrap: break-word; ">瑾鍦ㄧ殑錛屽皪鏂?tcpdump 閫欏€嬭粺楂斾締瑾紝浣犵敋鑷沖彲浠ヨ閫欏€嬭粺楂斿叾瀵﹀氨鏄€嬮Л瀹㈣粺楂旓紝 鍥犵偤浠栦笉浣嗗彲浠ュ垎鏋愬皝鍖呯殑嫻佸悜錛岄€e皝鍖呯殑鍏у涔熷彲浠ラ€茶銆庣洠鑱姐€忥紝 濡傛灉浣犱嬌鐢ㄧ殑鍌寵幾璩囨枡鏄槑紕肩殑瑭憋紝涓嶅緱浜嗭紝鍦?router 涓婇潰灝卞彲鑳借浜哄鐩h伣璧頒簡錛?寰堝彲鎬曞惗錛佹墍浠ワ紝鎴戝€戜篃瑕佷締鐬В涓€涓嬮€欏€嬭粺楂斿晩錛?璦伙細(xì)閫欏€?tcpdump 蹇呴爤浣跨敤 root 鐨勮韓浠藉煼琛?<br /><table fck__showtableborders"="" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><tbody><tr><td style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><pre>[root@linux ~]# <strong>tcpdump [-nn] [-i 浠嬮潰] [-w 鍎插瓨妾斿悕] [-c 嬈℃暩] [-Ae]</strong> <strong> [-qX] [-r 妾旀] [鎵€嬈叉摲鍙栫殑璩囨枡鍏у]</strong> 鍙冩暩錛?-nn錛氱洿鎺ヤ互 IP 鍙?port number 欏ず錛岃€岄潪涓繪鍚嶈垏鏈嶅嫏鍚嶇ū -i 錛氬緦闈㈡帴瑕併€庣洠鑱姐€忕殑綞茶礬浠嬮潰錛屼緥濡?eth0, lo, ppp0 絳夌瓑鐨勪粙闈紱 -w 錛氬鏋滀綘瑕佸皣鐩h伣鎵€寰楃殑灝佸寘璩囨枡鍎插瓨涓嬩締錛岀敤閫欏€嬪弮鏁稿氨灝嶄簡錛佸緦闈㈡帴妾斿悕 -c 錛氱洠鑱界殑灝佸寘鏁革紝濡傛灉娌掓湁閫欏€嬪弮鏁革紝 tcpdump 鏈冩寔綰屼笉鏂風(fēng)殑鐩h伣錛? 鐩村埌浣跨敤鑰呰幾鍏?[ctrl]-c 鐐烘銆?-A 錛氬皝鍖呯殑鍏у浠?ASCII 欏ず錛岄€氬父鐢ㄤ締鎹夊彇 WWW 鐨勭恫闋佸皝鍖呰硣鏂欍€?-e 錛氫嬌鐢ㄨ硣鏂欓€f帴灞?(OSI 絎簩灞? 鐨?MAC 灝佸寘璩囨枡渚嗛’紺猴紱 -q 錛氬儏鍒楀嚭杓冪偤綈$煭鐨勫皝鍖呰硣璦婏紝姣忎竴琛岀殑鍏у姣旇純綺劇啊 -X 錛氬彲浠ュ垪鍑哄崄鍏€蹭綅 (hex) 浠ュ強(qiáng) ASCII 鐨勫皝鍖呭収瀹癸紝灝嶆柤鐩h伣灝佸寘鍏у寰堟湁鐢?-r 錛氬緸寰岄潰鎺ョ殑妾旀灝囧皝鍖呰硣鏂欒畝鍑轟締銆傞偅鍊嬨€庢獢妗堛€忔槸宸茬稉瀛樺湪鐨勬獢妗堬紝 涓︿笖閫欏€嬨€庢獢妗堛€忔槸鐢?-w 鎵€瑁戒綔鍑轟締鐨勩€?鎵€嬈叉摲鍙栫殑璩囨枡鍏у錛氭垜鍊戝彲浠ュ皥闁€閲濆皪鏌愪簺閫氳▕鍗斿畾鎴栬€呮槸 IP 渚嗘簮閫茶灝佸寘鎿峰彇錛? 閭e氨鍙互綈″寲杓稿嚭鐨勭祼鏋滐紝涓﹀彇寰楁渶鏈夌敤鐨勮硣璦娿€傚父瑕嬬殑琛ㄧず鏂規(guī)硶鏈夛細(xì) 'host foo', 'host 127.0.0.1' 錛氶嚌灝嶅柈閮ㄤ富姍熶締閫茶灝佸寘鎿峰彇 'net 192.168' 錛氶嚌灝嶆煇鍊嬬恫鍩熶締閫茶灝佸寘鐨勬摲鍙栵紱 'src host 127.0.0.1' 'dst net 192.168'錛氬悓鏅傚姞涓婁締婧?src)鎴栫洰妯?dst)闄愬埗 'tcp port 21'錛氶倓鍙互閲濆皪閫氳▕鍗斿畾鍋墊脯錛屽 tcp, udp, arp, ether 絳? 閭勫彲浠ュ埄鐢?and 鑸?or 渚嗛€茶灝佸寘璩囨枡鐨勬暣鍚堥’紺哄憿錛? 綃勪緥涓€錛氫互 IP 鑸?port number 鎹変笅 eth0 閫欏€嬬恫璺崱涓婄殑灝佸寘錛屾寔綰?3 縐?[root@linux ~]# <strong>tcpdump -i eth0 -nn</strong> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 01:33:40.41 IP 192.168.1.100.22 > 192.168.1.11.1190: P 116:232(116) ack 1 win 9648 01:33:40.41 IP 192.168.1.100.22 > 192.168.1.11.1190: P 232:364(132) ack 1 win 9648 <==鎸変笅 [ctrl]-c 涔嬪緦緄愭潫 6680 packets captured <==鎹変笅渚嗙殑灝佸寘鏁擱噺 14250 packets received by filter <==鐢遍亷嬋炬墍寰楃殑綹藉皝鍖呮暩閲?7512 packets dropped by kernel <==琚牳蹇冩墍涓熸鐨勫皝鍖?/pre></td></tr></tbody></table>濡傛灉浣犳槸絎竴嬈$湅 tcpdump 鐨?man page 鏅傦紝鑲畾涓€鍊嬮牠鍏╁€嬪ぇ錛屽洜鐐?tcpdump 騫句箮閮芥槸鍒嗘瀽灝佸寘鐨勮〃闋硣鏂欙紝浣跨敤鑰呭鏋滄矑鏈夌啊鏄撶殑綞茶礬灝佸寘鍩虹錛岃鐪嬫噦綺夐洠鍚訛紒 鎵€浠ワ紝鑷沖皯鎮(zhèn)ㄥ緱瑕佸洖鍒?a style="color: #1463c4; text-decoration: none; ">綞茶礬鍩虹</a>瑁¢潰鍘誨皣 TCP 灝佸寘鐨勮〃闋硣鏂欑悊瑙g悊瑙f墠濂藉晩錛?^_^錛佽嚦鏂奸偅鍊嬬瘎渚嬩竴鎵€鐢㈢敓鐨勮幾鍑虹瘎渚嬩腑錛屾垜鍊戝彲浠ョ磩鐣ュ崁鍒嗙偤鏁稿€嬫瑒浣嶏紝 鎴戝€戜互綃勪緥涓€鐣朵腑閭e€嬬壒孌婂瓧楂旇渚嗚鏄庝竴涓嬶細(xì)<br /><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">01:33:40.41錛氶€欏€嬫槸姝ゅ皝鍖呰鎿峰彇鐨勬檪闁擄紝銆庢檪:鍒?縐掋€忕殑鍠綅錛?/li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">IP錛氶€忛亷鐨勯€氳▕鍗斿畾鏄?IP 錛?/li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">192.168.1.100.22 > 錛氬偝閫佺鏄?192.168.1.100 閫欏€?IP錛岃€屽偝閫佺殑 port number 鐐?22錛屾?zhèn)ㄥ繀闋堣鐬В鐨勬槸锛岄偅鍊嬪ぇ鏂?(>) 鐨勭铏熸寚鐨勬槸灝佸寘鐨勫偝杓告柟鍚戝枖錛?/li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">192.168.1.11.1190錛氭帴鏀剁鐨?IP 鏄?192.168.1.11錛?涓旇┎涓繪闁嬪暉 port 1190 渚嗘帴鏀訛紱</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">P 116:232(116)錛氶€欏€嬪皝鍖呭付鏈?PUSH 鐨勮硣鏂欏偝杓告瑾岋紝 涓斿偝杓哥殑璩囨枡鐐烘暣楂旇硣鏂欑殑 116~232 byte錛屾墍浠ラ€欏€嬪皝鍖呭付鏈?116 bytes 鐨勮硣鏂欓噺錛?/li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">ack 1 win 9648錛欰CK鑸?Window size 鐨勭浉闂滆硣鏂欍€?/li></ul>鏈€綈″柈鐨勮娉曪紝灝辨槸瑭插皝鍖呮槸鐢?192.168.1.100 鍌沖埌 192.168.1.11錛岄€忛亷鐨?port 鏄敱 22 鍒?1190 錛?涓斿付鏈?116 bytes 鐨勮硣鏂欓噺錛屼嬌鐢ㄧ殑鏄?PUSH 鐨勬棗妯欙紝鑰屼笉鏄?SYN 涔嬮鐨勪富鍕曢€g窔妯欒獙銆?鍛靛懙錛佷笉瀹規(guī)槗鐪嬬殑鎳傚惂錛佹墍浠ヨ錛屼笂闋墠瓔涜珛鍕欏繀鍒?nbsp;<a style="color: #1463c4; text-decoration: none; ">TCP 琛ㄩ牠璩囨枡</a>鐨勯儴鍒嗗幓鐬т竴鐬х殑鍟婏紒<br /><br />鍐嶄締錛屼竴鍊嬬恫璺媭鎱嬪緢蹇欑殑涓繪涓婇潰錛屼綘鎯寵鍙栧緱鏌愰儴涓繪灝嶄綘閫g窔鐨勫皝鍖呰硣鏂欒€屽凡鏅傦紝 浣跨敤 tcpdump 閰嶅悎綆$窔鍛戒護(hù)鑸囨瑕忚〃紺烘硶涔熷彲浠ワ紝涓嶉亷錛岀暍绔熶笉濂芥崏鍙栵紒 鎴戝€戝彲浠ラ€忛亷 tcpdump 鐨勮〃紺烘硶鍔熻兘錛屽氨鑳藉杓曟槗鐨勫皣鎵€闇€瑕佺殑璩囨枡鐛ㄧ珛鐨勫彇鍑轟締銆?鍦ㄤ笂闈㈢殑綃勪緥涓€鐣朵腑錛屾垜鍊戝儏閲濆皪 eth0 鍋氱洠鑱斤紝鎵€浠ユ暣鍊?eth0 浠嬮潰涓婇潰鐨勮硣鏂欓兘鏈冭欏ず鍒拌灑騫曚笂錛?涓嶅ソ鍒嗘瀽鍟婏紒閭i杭鎴戝€戝彲浠ョ啊鍖栧棊錛熶緥濡傚彧鍙栧嚭 port 21 鐨勯€g窔灝佸寘錛屽彲浠ラ€欐ǎ鍋氾細(xì)<br /><table fck__showtableborders"="" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><tbody><tr><td style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><pre>[root@linux ~]# <strong>tcpdump -i eth0 -nn port 21</strong> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 01:54:37.96 IP 192.168.1.11.1240 > 192.168.1.100.21: . ack 1 win 65535 01:54:37.96 IP 192.168.1.100.21 > 192.168.1.11.1240: P 1:21(20) ack 1 win 5840 01:54:38.12 IP 192.168.1.11.1240 > 192.168.1.100.21: . ack 21 win 65515 01:54:42.79 IP 192.168.1.11.1240 > 192.168.1.100.21: P 1:17(16) ack 21 win 65515 01:54:42.79 IP 192.168.1.100.21 > 192.168.1.11.1240: . ack 17 win 5840 01:54:42.79 IP 192.168.1.100.21 > 192.168.1.11.1240: P 21:55(34) ack 17 win 5840</pre></td></tr></tbody></table>鐬э紒閫欐ǎ灝卞儏鎻愬嚭 port 21 鐨勮硣璦婅€屽凡錛屼笖浠旂窗鐪嬬殑瑭憋紝浣犳渻鐧肩従灝佸寘鐨勫偝閬為兘鏄洐鍚戠殑錛?client 绔櫦鍑恒€庤姹傘€忚€?server 绔墖浜堜互銆庡洖鎳夈€忥紝鎵€浠ワ紝鐣剁劧鏄湁鍘繪湁鍥炲晩錛?鑰屾垜鍊戜篃灝卞彲浠ョ稉閬庨€欏€嬪皝鍖呯殑嫻佸悜渚嗙灜瑙e埌灝佸寘閬嬩綔鐨勯亷紼嬨€?鑸変緥渚嗚錛?ol style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: none; list-style-position: outside; list-style-type: none; ">鎴戝€戝厛鍦ㄤ竴鍊嬬祩绔瑕栫獥杓稿叆銆?tcpdump -i lo -nn 銆?鐨勭洠鑱斤紝</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: none; list-style-position: outside; list-style-type: none; ">鍐嶅彟闁嬩竴鍊嬬祩绔瑕栫獥渚嗗皪鏈 (127.0.0.1) 鐧誨叆銆巗sh localhost銆?/li></ol>閭i杭杓稿嚭鐨勭祼鏋滄渻鏄浣曪紵<br /><table fck__showtableborders"="" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><tbody><tr><td style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><pre>[root@linux ~]# <strong>tcpdump -i lo -nn</strong> 1 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode 2 listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes 3 11:02:54.253777 IP 127.0.0.1.32936 > 127.0.0.1.22: S 933696132:933696132(0) win 32767 <mss 16396,sackOK,timestamp 236681316 0,nop,wscale 2> 4 11:02:54.253831 IP 127.0.0.1.22 > 127.0.0.1.32936: S 920046702:920046702(0) ack 933696133 win 32767 <mss 16396,sackOK,timestamp 236681316 236681316,nop, wscale 2> 5 11:02:54.253871 IP 127.0.0.1.32936 > 127.0.0.1.22: . ack 1 win 8192 <nop, nop,timestamp 236681316 236681316> 6 11:02:54.272124 IP 127.0.0.1.22 > 127.0.0.1.32936: P 1:23(22) ack 1 win 8192 <nop,nop,timestamp 236681334 236681316> 7 11:02:54.272375 IP 127.0.0.1.32936 > 127.0.0.1.22: . ack 23 win 8192 <nop, nop,timestamp 236681334 236681334></pre></td></tr></tbody></table>涓婅〃欏ず鐨勯牠鍏╄鏄?tcpdump 鐨勫熀鏈鏄庯紝鐒跺緦錛?ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">絎?3 琛岄’紺虹殑鏄€庝締鑷?client 绔紝甯舵湁 SYN 涓誨嫊閫g窔鐨勫皝鍖呫€忥紝</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">絎?4 琛岄’紺虹殑鏄€庝締鑷?server 绔紝闄や簡鍥炴噳 client 绔箣澶?ACK)錛岄倓甯舵湁 SYN 涓誨嫊閫g窔鐨勬瑾岋紱</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">絎?5 琛屽墖欏ず client 绔洖鎳?server 紕哄畾閫g窔寤虹珛 (ACK)</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; ">絎?6 琛屼互寰屽墖闁嬪閫插叆璩囨枡鍌寵幾鐨勬椹熴€?/li></ul>寰炵 3-5 琛岀殑嫻佺▼渚嗙湅錛岀啛涓嶇啛鎮(zhèn)夊晩錛熸矑閷紒閭e氨鏄?nbsp;<a style="color: #1463c4; text-decoration: none; ">涓夊悜浜ゆ彙</a> 鐨勫熀紺庢祦紼嬪暒錛佸鏈夎叮鍚э紒 涓嶉亷 tcpdump 涔嬫墍浠ヨ紼辯偤椐杌熼珨涔嬩竴鍙笉姝笂闋粙绱圭殑鍔熻兘鍚訛紒 涓婇潰浠嬬垂鐨勫姛鑳藉彲浠ョ敤渚嗕綔鐐烘垜鍊戜富姍熺殑灝佸寘閫g窔鑸囧偝杓哥殑嫻佺▼鍒嗘瀽錛?閫欏皣鏈夊姪鏂兼垜鍊戠灜瑙e埌灝佸寘鐨勯亱浣滐紝鍚屾檪鐬В鍒頒富姍熺殑闃茬伀鐗嗚ō瀹氳鍓囨槸鍚︽湁闇€瑕佷慨璦傜殑鍦版柟銆?br /><br />鏇寸濂囩殑浣跨敤瑕佷締鍟︼紒濡傛灉鎴戝€戜嬌鐢?tcpdump 鍦?router 涓婇潰鐩h伣銆庢槑紕箋€忕殑鍌寵幾璩囨枡鏅傦紝 渚嬪 FTP 鍌寵幾鍗斿畾錛屼綘瑕哄緱鏈冪櫦鐢熶粈楹煎晱欏屽憿錛?鎴戝€戝厛鍦ㄤ富姍熺涓嬮仈銆?tcpdump -i lo port 21 -nn -X 銆忕劧寰屽啀浠?ftp 鐧誨叆鏈錛屼甫杓稿叆甯寵櫉鑸囧瘑紕鹼紝 緄愭灉浣犲氨鍙互鐧肩従濡備笅鐨勭媭娉侊細(xì)<br /><table fck__showtableborders"="" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><tbody><tr><td style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><pre>[root@linux ~]# <strong>tcpdump -i lo -nn -X 'port 21'</strong> 0x0000: 4500 0048 2a28 4000 4006 1286 7f00 0001 E..H*(@.@....... 0x0010: 7f00 0001 0015 80ab 8355 2149 835c d825 .........U!I.\.% 0x0020: 8018 2000 fe3c 0000 0101 080a 0e2e 0b67 .....<.........g 0x0030: 0e2e 0b61 3232 3020 2876 7346 5450 6420 ...a220.(vsFTPd. 0x0040: 322e 302e 3129 0d0a 2.0.1).. 0x0000: 4510 0041 d34b 4000 4006 6959 7f00 0001 E..A.K@.@.iY.... 0x0010: 7f00 0001 80ab 0015 835c d825 8355 215d .........\.%.U!] 0x0020: 8018 2000 fe35 0000 0101 080a 0e2e 1b37 .....5.........7 0x0030: 0e2e 0b67 5553 4552 2064 6d74 7361 690d ...gUSER.dmtsai. 0x0040: 0a . 0x0000: 4510 004a d34f 4000 4006 694c 7f00 0001 E..J.O@.@.iL.... 0x0010: 7f00 0001 80ab 0015 835c d832 8355 217f .........\.2.U!. 0x0020: 8018 2000 fe3e 0000 0101 080a 0e2e 3227 .....>........2' 0x0030: 0e2e 1b38 5041 5353 206d 7970 6173 7377 ...8PASS.mypassw 0x0040: 6f72 6469 7379 6f75 0d0a ordisyou..</pre></td></tr></tbody></table>涓婇潰鐨勮幾鍑虹祼鏋滃凡綞撹綈″寲閬庝簡錛屼綘蹇呴爤瑕佽嚜琛屽湪浣犵殑杓稿嚭緄愭灉鐣朵腑鎼滃皨鐩擱棞鐨勫瓧涓叉墠琛屻€?寰炰笂闈㈣幾鍑虹祼鏋滅殑鐗規(guī)畩瀛楅珨涓紝鎴戝€戝彲浠ョ櫦鐝俱€庤┎ FTP 杌熼珨浣跨敤鐨勬槸 vsftpd 錛屼甫涓斾嬌鐢ㄨ€呰幾鍏?dmtsai 閫欏€嬪賦铏熷悕紼憋紝涓斿瘑紕兼槸 mypasswordisyou銆?鍢垮樋錛佷綘瑾彲涓嶅彲鎬曞晩錛佸鏋滀嬌鐢ㄧ殑鏄槑紕肩殑鏂瑰紡渚嗗偝杓鎬綘鐨勭恫璺硣鏂欙紵 鎵€浠ユ垜鍊戞墠甯稿父鍦ㄨ瑳鍟婏紝綞茶礬鏄緢涓嶅畨鍏ㄤ綆錛?br /><br />鍙﹀浣犲緱鐬В錛岀偤浜嗚畵綞茶礬浠嬮潰鍙互璁?tcpdump 鐩h伣錛屾墍浠ュ煼琛?tcpdump 鏅傜恫璺粙闈㈡渻鍟熷嫊鍦?銆庨尟浜傛ā寮?(promiscuous)銆忥紝鎵€浠ヤ綘鏈冨湪 /var/log/messages 瑁¢潰鐪嬪埌寰堝鐨勮鍛婅▕鎭紝 閫氱煡浣犺浣犵殑綞茶礬鍗¤璦畾鎴愮偤閷簜妯″紡錛佸垾鎿斿績錛岄偅鏄甯哥殑銆?鑷蟲柤鏇村鐨勬噳鐢紝璜嬪弮鑰?man tcpdump 鍥夛紒<br /><br /><table cellspacing="0" cellpadding="5" width="90%" border="1" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><tbody><tr><td style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">渚嬮錛氬浣曚嬌鐢?tcpdump 鐩h伣 (1)渚嗚嚜 eth0 浠嬮潰鍗′笖 (2)閫氳▕鍗斿畾鐐?port 22 錛?3)鐩渚嗘簮鐐?192.168.1.100 鐨勫皝鍖呰硣鏂欙紵<br /><br />絳旓細(xì)<ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; ">tcpdump -i eth0 -nn 'port 22 and src host 192.168.1.100'</ul></td></tr></tbody></table></div><hr /><a name="ethereal" style="color: rgb(20, 99, 196); text-decoration: none; "></a><img height="23" alt="灝忔欏岀殑鍦栫ず" width="16" align="middle" src="http://linux.vbird.org/images/penguin-s.gif" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /><strong>ethereal<br /></strong><div style="word-wrap: break-word; ">闄や簡 tcpdump 閫欏€嬭粺楂斾箣澶栵紝鍏跺浣犻倓鍙互浣跨敤 ethereal 閫欏€嬪ソ鐢ㄧ殑綞茶礬嫻侀噺鍒嗘瀽杌熼珨鍚訛紒 ethereal 鍒嗙偤鏂囧瓧浠嬮潰鑸囧湒褰粙闈紝鏂囧瓧浠嬮潰鐨勭敤娉曡垏 tcpdump 鐩哥暥鐨勯浼鹼紝涓嶉亷浠栫殑鎸囦護(hù)鍚嶇ū鐐?tethereal 灝辨槸浜嗐€傚洜鐐虹敤娉曞樊涓嶅錛屾墍浠ュ緩璀版?zhèn)ㄧ洿鎺ヤ娇鐢?man tethereal 鏌ラ柋鍚э紒 鍦?CentOS 涓婂師鏈氨鏈?ethereal 浜嗭紝鎵€浠ヨ珛鎷垮嚭鍏夌渚嗗畨瑁濆嵆鍙枖錛?闇€瑕佸畨瑁?ethereal 鑸?ethereal-gnome 鎵嶈鍚訛紒<br /><br />鍟熷嫊鐨勬柟娉曞緢綈″柈錛屼綘蹇呴爤瑕佸湪 X Window 搴曚笅錛屽厛闁嬪暉涓€鍊嬬祩绔錛岀劧寰岀洿鎺ヨ幾鍏?ethereal 寰岋紝 灝辨渻鍑虹従濡備笅鐨勭暙闈簡錛?br /><br /><center><img title="ethereal 浣跨敤綃勪緥鍦? alt="ethereal 浣跨敤綃勪緥鍦? src="http://linux.vbird.org/linux_server/0140networkcommand/ethereal_1.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /><br />鍦栦簲銆乪thereal 浣跨敤綃勪緥鍦?/center><br />綈″柈鐨勪綔娉曪紝浣犲彲浠ラ粸閬稿涓婂湒欏ず鐨勯偅鍊嬫寜閳曪紝鏈冨嚭鐝炬寫閬哥洠鑱界殑浠嬮潰瑕栫獥錛屽涓嬫墍紺猴細(xì)<br /><br /><center><img title="ethereal 浣跨敤綃勪緥鍦? alt="ethereal 浣跨敤綃勪緥鍦? src="http://linux.vbird.org/linux_server/0140networkcommand/ethereal_2.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /><br />鍦栧叚銆乪thereal 浣跨敤綃勪緥鍦?/center><br />浣犳噳瑭查伕鎿囪鐩h伣鐨勪粙闈紝鍦ㄩ€欒!鍥犵偤鏄脯瑭︾敤鐨勶紝鎵€浠ラ償鍝ヤ嬌鐢ㄧ殑鏄?lo 閫欏€嬪収閮ㄤ粙闈紝 浣犵暥鐒舵噳瑭茶閬告搰浣犺嚜宸辯殑綞茶礬浠嬮潰鎵嶆槸銆傜劧寰屾寜涓?start 寰岋紝灝辨渻鍑虹従闁嬪鍋墊脯鐨勭暙闈簡錛?br /><br /><center><img title="ethereal 浣跨敤綃勪緥鍦? alt="ethereal 浣跨敤綃勪緥鍦? src="http://linux.vbird.org/linux_server/0140networkcommand/ethereal_3.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /><br />鍦栦竷銆乪thereal 浣跨敤綃勪緥鍦?/center><br />鍦ㄩ€欏€嬬暙闈㈢暥涓綘鍙互鐪嬪埌寰堝欏炲瀷鐨勫皝鍖呭崝瀹氾紝鍦ㄧ瓑浣犺檿鐞嗗畬鐣㈠緦錛屽氨鍙互鎸変笅銆巗top銆忕祼鏉熺洠鑱斤紝 鑰岄枊濮嬮€插叆濡備笅鐨勫皝鍖呭垎鏋愮暙闈€€?br /><br /><center><img title="ethereal 浣跨敤綃勪緥鍦? alt="ethereal 浣跨敤綃勪緥鍦? src="http://linux.vbird.org/linux_server/0140networkcommand/ethereal_4.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /><br />鍦栧叓銆乪thereal 浣跨敤綃勪緥鍦?/center><br />灝佸寘鍒嗘瀽鐣潰鍏卞垎鐐轟笁澶у崁濉婏紝濡備笂鍦栨墍紺猴紝絎竴鍗€濉婁富瑕侀’紺虹殑鏄皝鍖呯殑妯欓牠璩囨枡錛?鍏у灝辨湁榛為浼?tcpdump 鐨勯’紺虹祼鏋滐紝絎簩鍗€濉婂墖鏄┏绱扮殑琛ㄩ牠璩囨枡錛?鍖呮嫭璦婃鐨勫収瀹廣€侀€氳▕鍗斿畾鐨勫収瀹逛互鍙?socket pair 絳夌瓑璩囪▕銆?絎笁鍗€濉婂墖鏄?16 閫蹭綅鑸?ASCII 紕肩殑欏ず緄愭灉銆傞€忛亷閫欏€?ethereal 鎮(zhèn)ㄥ氨鍙互涓€鍙f埃寰楀埌鎵€闇€瑕佺殑鎵€鏈夊皝鍖呭収瀹瑰暒錛?鑰屼笖閭勬槸鍦栧艦浠嬮潰鐨勶紝寰堟柟渚垮惂錛侀€忛亷鍦ㄧ涓€鍗€濉婇伕鎿囦笉鍚岀殑灝佸寘錛屽氨鑳藉鏌ラ柋姣忓€嬪皝鍖呯殑璩囨枡鍏у鍥夛紒</div><hr /><a name="nc" style="color: rgb(20, 99, 196); text-decoration: none; "></a><img height="23" alt="灝忔欏岀殑鍦栫ず" width="16" align="middle" src="http://linux.vbird.org/images/penguin-s.gif" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /><strong>nc, netcat<br /></strong><div style="word-wrap: break-word; ">閫欏€?nc 鍙互鐢ㄤ締浣滅偤鏌愪簺鏈嶅嫏鐨勬娓紝鍥犵偤浠栧彲浠ラ€f帴鍒版煇鍊?port 渚嗛€茶婧濋€氾紝 姝ゅ錛岄倓鍙互鑷鍟熷嫊涓€鍊?port 渚嗗偩鑱藉叾浠栫敤鎴剁殑閫g窔鍚訛紒闈炲父鐨勪笉閷敤錛?濡傛灉鍦ㄧ法璀殑鏅傚€欑鄲浜堛€嶨APING_SECURITY_HOLE銆忓弮鏁哥殑瑭憋紝鍢垮樋錛?閫欏€嬭粺楂旈倓鍙互鐢ㄤ締鍙栧緱鐢ㄦ埗绔殑 bash 鍝╋紒鍙€曞惂錛佹垜鍊戠殑 CentOS 姣旇純浜烘€у寲錛屼甫娌掓湁緄︿簣涓婇潰鐨勫弮鏁革紝鎵€浠ユ垜鍊戜笉鑳藉鐢ㄤ締浣滅偤椐杌熼珨锝?浣嗘槸鐢ㄤ締鍙栦唬 telnet 涔熸槸鍊嬪緢媯掔殑鍔熻兘浜嗭紒(鏈夌殑緋葷當(dāng)灝囧煼琛屾獢鏀瑰悕鐐?netcat 鍟︼紒)<br /><table fck__showtableborders"="" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><tbody><tr><td style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><pre>[root@linux ~]# <strong>nc [IP|host] [port]</strong> [root@linux ~]# <strong>nc -l -p [port]</strong> 鍙冩暩錛?-l 錛氫綔鐐虹洠鑱戒箣鐢紝浜﹀嵆闁嬪暉涓€鍊?port 渚嗙洠鑱界敤鎴剁殑閫g窔錛?-p 錛氶枊鍟熺殑閫欏€?port number 綃勪緥涓€錛氶€f帴鏈湴绔殑 port 25 鏌ラ柋鐩擱棞璦婃伅 [root@linux ~]# <strong>nc localhost 25</strong> localhost.localdomain [127.0.0.1] 25 (smtp) open 220 pc.dm.tsai ESMTP Postfix <strong>ehlo localhost</strong> 250-pc.dm.tsai 250-PIPELINING 250-SIZE 40000000 250-ETRN <strong>quit</strong> 221 Bye</pre></td></tr></tbody></table>閫欏€嬫渶綈″柈鐨勫姛鑳借垏 telnet 騫句箮涓€妯e惂錛佸彲浠ュ幓妾㈡煡鏌愬€嬫湇鍕欏暒錛佷笉閬庯紝鏇寸濂囩殑鍦ㄥ緦闈紝 鎴戝€戝彲浠ュ緩绔嬪叐鍊嬮€g窔渚嗗偝璦婂枖錛佽垑鍊嬩緥瀛愪締瑾紝鎴戝€戝厛鍦?client 绔殑鍦版柟鍟熷嫊涓€鍊?port 渚嗛€茶鍌捐伣錛?br /><table fck__showtableborders"="" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><tbody><tr><td style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><pre>綃勪緥浜岋細(xì)鍟熷嫊涓€鍊?port 渚嗙洠鑱戒嬌鐢ㄨ€呯殑閫g窔瑕佹眰 [root@linux ~]# <strong>nc -l -p 20000</strong> # 鍟熷嫊涓€鍊?port 20000 鍦ㄤ富姍熶笂錛屽鏋滄鏅備嬌鐢?netstat -tlnp # 灝卞彲浠ョ湅鍒扮郴緄變笂澶氬嚭渚嗕竴鍊?port 20000 鍦ㄥ偩鑱戒嬌鐢ㄨ€呯殑閫g窔鍠旓紒</pre></td></tr></tbody></table>鐒跺緦鍦ㄤ富姍熺鐨勫湴鏂癸紝涔熷埄鐢?nc 渚嗛€g窔鍒扮敤鎴剁錛屼甫涓旇幾鍏ヤ竴浜涙寚浠ょ湅鐪嬪枖錛?br /><table fck__showtableborders"="" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><tbody><tr><td style="word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><pre>[root@linux ~]# <strong>nc localhost 20000</strong> <==閫欒!鍙互闁嬪杓稿叆瀛椾覆浜嗭紒</pre></td></tr></tbody></table>姝ゆ檪錛屽湪涓繪绔垜鍊戝彲浠ユ墦鍏ヤ竴浜涘瓧錛屼綘鏈冪櫦鐝懼湪 client 绔渻鍚屾檪鍑虹従浣犺幾鍏ョ殑瀛楃溂鍚訛紒 濡傛灉浣犲悓鏅傜鄲浜堜竴浜涢澶栫殑鍙冩暩錛屼緥濡傚埄鐢ㄦ婧栬幾鍏ヨ垏杓稿嚭 (stdout, stdin) 鐨勮┍錛?閭i杭灝卞彲浠ラ€忛亷閫欏€嬮€g窔渚嗕綔寰堝浜嬫儏浜嗭紒 鐣剁劧 nc 鐨勫姛鑳戒笉鍙姝わ紝浣犻倓鍙互鐧肩従寰堝鐨勭敤閫斿枖錛?璜嬭嚜琛屽埌鎮(zhèn)ㄤ富姍熷収鐨?/usr/share/doc/nc-1.10/scripts 鐩寗涓嬬湅鐪嬮€欎簺 script 錛屾湁騫姪鐨勫惗錛?涓嶉亷錛屽鏋滀綘闇€瑕侀澶栫殑綬ㄨ鍑哄惈鏈?GAPING_SECURITY_HOLE 鍔熻兘錛?浠ヤ嬌鍏╃</div></div><div class="wmqeeuq" id="appShareUrl" style="word-wrap: break-word; font-size: 12px; color: #999999; margin-top: 10px; border-top-width: 1px; border-top-style: solid; border-top-color: #f4f4f4; font-family: arial; background-color: #f4f8fb; clear: both; ">鏉ヨ嚜: <a target="_blank" style="color: #9a9a9a; text-decoration: none; ">http://hi.baidu.com/june2june/blog/item/84a66865ea77acf8f73654ea.html</a></div></div></div></div><img src ="http://www.aygfsteel.com/Todd/aggbug/369460.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Todd/" target="_blank">Todd</a> 2012-02-06 10:38 <a href="http://www.aygfsteel.com/Todd/archive/2012/02/06/369460.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>mysql root 瀵嗙爜http://www.aygfsteel.com/Todd/archive/2011/12/13/366196.htmlToddToddMon, 12 Dec 2011 19:18:00 GMThttp://www.aygfsteel.com/Todd/archive/2011/12/13/366196.htmlhttp://www.aygfsteel.com/Todd/comments/366196.htmlhttp://www.aygfsteel.com/Todd/archive/2011/12/13/366196.html#Feedback0http://www.aygfsteel.com/Todd/comments/commentRss/366196.htmlhttp://www.aygfsteel.com/Todd/services/trackbacks/366196.html

Todd 2011-12-13 03:18 鍙戣〃璇勮
]]>
java heap space錛?PermGen space 閿欒 浣跨敤jvisualvm鐩戞祴璁劇疆鍚堢悊鍊?/title><link>http://www.aygfsteel.com/Todd/archive/2011/10/18/361543.html</link><dc:creator>Todd</dc:creator><author>Todd</author><pubDate>Tue, 18 Oct 2011 14:16:00 GMT</pubDate><guid>http://www.aygfsteel.com/Todd/archive/2011/10/18/361543.html</guid><wfw:comment>http://www.aygfsteel.com/Todd/comments/361543.html</wfw:comment><comments>http://www.aygfsteel.com/Todd/archive/2011/10/18/361543.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Todd/comments/commentRss/361543.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Todd/services/trackbacks/361543.html</trackback:ping><description><![CDATA[浣跨敤myeclipse鍚姩tomcat 鎶ava heap space 錛孭ermGen space 閿欒錛屽垎鍒負(fù) heap鍐呭瓨涓嶈凍錛孭ermGen鍐呭瓨涓嶈凍<br />闇€鍔犲ぇ tomcat鍚姩欏瑰弬鏁?Xmx 鍜?nbsp;XX:MaxPermSize<br />PermGen鏄寚鍐呭瓨鐨勬案涔呬繚瀛樺尯鍩燂紝瀹冪敤浜庡瓨鏀綾lass鍜?method 瀵硅薄錛屼互鍙?qiáng)String 瀵硅薄<br />錛坰un鍘熸枃錛歱ermanent generation is the area of the heap where class and method objects are stored. If an application loads a very large number of classes, then the size of the permanent generation might need to be increased using the -XX:MaxPermSize option. <div>Interned java.lang.String objects are also stored in the permanent generation. The java.lang.String class maintains a pool of strings. When the intern method is invoked, the method checks the pool to see if an equal string is already in the pool. If there is, then the intern method returns it; otherwise it adds the string to the pool. In more precise terms, the java.lang.String.intern method is used to obtain the canonical representation of the string; the result is a reference to the same class instance that would be returned if that string appeared as a literal. If an application interns a huge number of strings, the permanent generation might need to be increased from its default setting. </div> <div>When this kind of error occurs, the text String.intern or ClassLoader.defineClass might appear near the top of the stack trace that is printed. </div> <div>The jmap -permgen command prints statistics for the objects in the permanent generation, including information about internalized String instances. See 2.6.4 Getting Information on the Permanent Generation.</div>錛?br />PermGen鍙堟槸涓€涓壒孌婂唴瀛樺尯鍩燂細(xì)Classloader 鍔犺澆鐨勪笢涓滄槸涓嶈兘鍥炴敹鐨勶紝瀹冧滑鏀懼湪PermGen涓?br />錛坱omcat鍘熸枃錛歐hy does the memory usage increase when I redeploy a web application? Because the Classloader (and the Class objects it loaded) cannot be recycled. They are stored in the permanent heap generation by the JVM, and when you redepoy a new class loader is created, which loads another copy of all these classes. This can cause OufOfMemoryErrors eventually.錛?br /><br />鍥炲埌鎴戠殑闂鏉ワ紝鎵撳紑%java_home%bin\jvisualvm.exe  (jdk6浠ヤ笂鏈?<br />鏌ョ湅tomcat鐨勫唴瀛樻儏鍐碉紝鐐瑰嚮tomcat鏍囩涓媘onitor , 褰搖sed heap = max heap      used PermGen = max PermGen 鏃秚omcat榪樺湪鍚姩涓紝涓€浼?xì)灏辨姤閿欏Q?br />鐢變簬姝ゅ墠宸茬粡灝唌yeclipse涓璼erver->tomcat->tomcatx.x->jdk鐨勫弬鏁拌緗垚-Xms64m -Xmx512m -XX:MaxPermSize=80m<br />浣嗘槸monitor 鐢婚潰涓璵ax heap涓?256M<br />鐐瑰嚮overview鏍囩,鍙戠幇jvm鍙傛暟濡備笅錛?br />-Xms64m<br />-Xmx512m<br />-XX:MaxPermSize=80m<br />-Xms64m<br />-Xmx256m<br /><br />鏄劇劧tomcat浣跨敤浜嗘渶鍚庣殑璁劇疆-Xms64m -Xmx256m錛涜繖涓槸鍦╩yeclipse鐨勫睘鎬?銆媕ava->installed jres 涓殑vm鍚姩鍙傛暟閲岋紝鍙屽嚮榛樿鍚敤鐨刯re錛屾妸鍙傛暟鍘繪帀鎴栬€呰緗垚-Xms64m -Xmx512m<br />鍐嶅洖鍒皊erver->tomcat->tomcatx.x->jdk涓妸-XX:MaxPermSize=80m淇敼涓?XX:MaxPermSize=128m<br />淇濆瓨鍚庡啀鍚姩tomcat錛宱k<br /><br />鍙﹀錛屼嬌鐢╦visualvm鎸佺畫鐩戞祴tomcat鍐呭瓨鎯呭喌鍙戠幇heap鍖哄煙鐨勫唴瀛樹嬌鐢ㄤ細(xì)鍦ㄤ竴涓珮宄板悗紼沖畾闄嶄綆錛屽唴瀛樿鍥炴敹浜嗭紱<br />鑰孭ermGen鍖哄煙鐨勫唴瀛樺垯鏄笉鏂鍔犲埌杈句竴涓嘲鍊煎悗灝變笉鍐嶅鍔狅紝浣嗕箣鍚庢鍖虹殑鍐呭瓨娌℃湁琚洖鏀訛紝楠岃瘉浜嗕笂闈㈢殑璇存硶錛?br /><br />澶氳涓ゅ彞錛歫ava鐨勫姩鎬佸姞杞借鐢熷嚭璇稿妗嗘灦錛屽湪絀洪棿涓婁篃鏆撮湶鍑洪棶棰橈紝鍙嶅皠鍦ㄦ椂闂翠笂涔熷瓨鍦ㄦ晥鐜囬棶棰橈細(xì)涓嬮潰鏄粍嫻嬭瘯鏁版嵁錛?br /> <p>Java version 1.6.0_13<br />Java HotSpot(TM) Client VM<br />11.3-b02<br />Sun Microsystems Inc.</p> <p>Direct access using member field:<br /> 47 125 47 46 46<br /> average time = 66 ms.<br />Reference access to member field:<br /> 109 109 110 94 109<br /> average time = 106 ms.<br />Reflection access to member field:<br /> 13094 12984 13063 13062 13094<br /> average time = 13051 ms.</p> <p>Java version 1.6.0_13<br />Java HotSpot(TM) Client VM<br />11.3-b02<br />Sun Microsystems Inc.</p> <p>Direct call using member field:<br /> 47 31 109 109 31<br /> average time = 70 ms.<br />Direct call using passed value:<br /> 16 16 16 31 15<br /> average time = 20 ms.<br />Call to object using member field:<br /> 46 47 47 47 32<br /> average time = 43 ms.<br />Call to object using passed value:<br /> 15 16 31 16 16<br /> average time = 20 ms.<br />Reflection call using member field:<br /> 812 782 844 844 844<br /> average time = 829 ms.<br />Reflection call using passed value:<br /> 938 953 954 1031 953<br /> average time = 973 ms.</p> <p>Java version 1.6.0_13<br />Java HotSpot(TM) Client VM<br />11.3-b02<br />Sun Microsystems Inc.</p> <p>Direct Object creation:<br /> 62 47 78 32 93<br /> average time = 63 ms.<br />Reflection Object creation:<br /> 125 94 94 109 187<br /> average time = 121 ms.<br />Direct byte[8] creation:<br /> 125 187 94 172 94<br /> average time = 137 ms.<br />Reflection byte[8] creation:<br /> 266 171 187 188 219<br /> average time = 191 ms.<br />Direct byte[64] creation:<br /> 250 172 156 125 203<br /> average time = 164 ms.<br />Reflection byte[64] creation:<br /> 281 219 203 203 219<br /> average time = 211 ms.</p>鍗庝附鐨勪笂灞傞渶瑕佸潥瀹炵殑搴曞眰鍩虹<br /><br /><a >http://wiki.apache.org/tomcat/FAQ/Deployment</a><br /><a >http://download.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/memleaks.html#gbyuu</a><br /><br /><img src ="http://www.aygfsteel.com/Todd/aggbug/361543.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Todd/" target="_blank">Todd</a> 2011-10-18 22:16 <a href="http://www.aygfsteel.com/Todd/archive/2011/10/18/361543.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>java鍙嶅皠鏁堢巼嫻嬭瘯 jdk6http://www.aygfsteel.com/Todd/archive/2011/09/22/359221.htmlToddToddWed, 21 Sep 2011 23:18:00 GMThttp://www.aygfsteel.com/Todd/archive/2011/09/22/359221.htmlhttp://www.aygfsteel.com/Todd/comments/359221.htmlhttp://www.aygfsteel.com/Todd/archive/2011/09/22/359221.html#Feedback0http://www.aygfsteel.com/Todd/comments/commentRss/359221.htmlhttp://www.aygfsteel.com/Todd/services/trackbacks/359221.html

Java version 1.6.0_13
Java HotSpot(TM) Client VM
11.3-b02
Sun Microsystems Inc.

Direct access using member field:
 47 125 47 46 46
 average time = 66 ms.
Reference access to member field:
 109 109 110 94 109
 average time = 106 ms.
Reflection access to member field:
 13094 12984 13063 13062 13094
 average time = 13051 ms.

Java version 1.6.0_13
Java HotSpot(TM) Client VM
11.3-b02
Sun Microsystems Inc.

Direct call using member field:
 47 31 109 109 31
 average time = 70 ms.
Direct call using passed value:
 16 16 16 31 15
 average time = 20 ms.
Call to object using member field:
 46 47 47 47 32
 average time = 43 ms.
Call to object using passed value:
 15 16 31 16 16
 average time = 20 ms.
Reflection call using member field:
 812 782 844 844 844
 average time = 829 ms.
Reflection call using passed value:
 938 953 954 1031 953
 average time = 973 ms.

Java version 1.6.0_13
Java HotSpot(TM) Client VM
11.3-b02
Sun Microsystems Inc.

Direct Object creation:
 62 47 78 32 93
 average time = 63 ms.
Reflection Object creation:
 125 94 94 109 187
 average time = 121 ms.
Direct byte[8] creation:
 125 187 94 172 94
 average time = 137 ms.
Reflection byte[8] creation:
 266 171 187 188 219
 average time = 191 ms.
Direct byte[64] creation:
 250 172 156 125 203
 average time = 164 ms.
Reflection byte[64] creation:
 281 219 203 203 219
 average time = 211 ms.

 



Todd 2011-09-22 07:18 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 蓬安县| 昌吉市| 新昌县| 淄博市| 梨树县| 高清| 洛南县| 永嘉县| 孝昌县| 红河县| 交口县| 绥宁县| 潮安县| 德保县| 乌兰县| 运城市| 浪卡子县| 和田市| 沙坪坝区| 墨脱县| 南木林县| 神农架林区| 宁远县| 松阳县| 平山县| 平南县| 嘉善县| 麻栗坡县| 牡丹江市| 达州市| 阿尔山市| 益阳市| 霍州市| 汝阳县| 宣汉县| 上思县| 宜宾市| 锦屏县| 青铜峡市| 林芝县| 罗甸县|