开发者

How the TCP segments divided?

开发者 https://www.devze.com 2023-03-29 11:21 出处:网络
I used WireShark to analyze the HTTP protocol, I found that a HTTP request which was large enough will be disassembled into several TCP packets like this: HTTP request method as a packet; HTTP reque开

I used WireShark to analyze the HTTP protocol, I found that a HTTP request which was large enough will be disassembled into several TCP packets like this: HTTP request method as a packet; HTTP reque开发者_JS百科st headers as a packet and HTTP content as a packet.

My question is: Is the TCP segments division decided by upper layer protocol or some other way?


For HTTP you might find this article interesting, how Google basically have their HTTP server interacting with TCP to push the initial segments without waiting for a response.

http://blog.benstrong.com/2010/11/google-and-microsoft-cheat-on-slow.html

And a RFC draft published here:

https://datatracker.ietf.org/doc/html/draft-hkchu-tcpm-initcwnd-01


Upper layer protocols are encapsulated insite TCP payload. TCP like any other level, is unaware of the above levels. TCP packets has a maximum size (MTU: maximum transmission unit), when an HTTP (or other higher level protocols) need more space to transmit data, payload will be splitted on different TCP segments.

Your operationg system can modify MTU values. For example with linux:

ifconfig eth0 mtu MTU_SIZE
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号