tcp三向交握和HTTP請求格式

來源:互聯網
上載者:User

標籤:localhost   伺服器   number   資訊   資料包   

採用三向交握串連

第一次握手:主機A發送位碼為syn=1,隨機產生seq number=1234567的資料包到伺服器,主機B由SYN=1知道,A要求建立聯機;

第二次握手:主機B收到請求後要確認聯機資訊,向A發送ack number=(主機A的seq+1),syn=1,ack=1,隨機產生seq=7654321的包

第三向交握:主機A收到後檢查ack number是否正確,即第一次發送的seq number+1,以及位碼ack是否為1,若正確,主機A會再發送ack number=(主機B的seq+1),ack=1,主機B收到後確認seq值與ack=1則串連建立成功。

HTTP請求的格式如下所示:

<request-line>
<headers>
<blank line>
[<request-body>]

 

POST /sample.jsp HTTP/1.1 (請求行)

Accept:image/gif.image/jpeg,*/*

650) this.width=650;" width="13" height="125" src="/e/u261/themes/default/images/spacer.gif" style="background:url("/e/u261/themes/default/images/word.gif") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" />Accept-Language:zh-cn

Connection:Keep-Alive

Host:localhost                                                    (訊息前序)

User-Agent:Mozila/4.0(compatible;MSIE5.01;Window NT5.0)

Accept-Encoding:gzip,deflate

 

username=jinqiao&password=1234 (請求本文)


tcp三向交握和HTTP請求格式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.