Yes, a TCP packet can contain multiple HEADERS frames.
Typically a TCP packet has an MTU of about 1500 bytes, while a typical HEADERS frame containing an HTTP request could be around 200-500 bytes so a TCP packet can contain about 2-8 HEADERS frames.
However, it is typical for clients to issue a TCP write per HTTP request, which is why you see just one HEADERS frame in each TCP packet.
To have the client send multiple HEADERS frames in a single TCP packet, you would need the following:
- The client to support the gathering of many HEADERS frames into single TCP writes.
- To cause the client to accumulate HEADERS frames, which typically means to send HTTP requests concurrently at a rate that is higher than the rate of TCP writes.
In summary, the case of multiple HEADERS frames in a single TCP packet depends heavily on the client implementation and the HTTP request send rate.
Disclaimer, I am the implementer of HTTP/2 in the Jetty Project
Jetty's HttpClient
supports HEADERS frame gathering, so in the right conditions it may issue multiple HEADERS frames in a single TCP packet.