Fan Wu
Fan Wu

Reputation: 169

How the TCP segments divided?

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 request 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?

Upvotes: 1

Views: 1418

Answers (2)

Steve-o
Steve-o

Reputation: 12866

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

Upvotes: 1

Heisenbug
Heisenbug

Reputation: 39164

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

Upvotes: 1

Related Questions