I have a very simple question which answer seems impossible to find as I want it. Let’s suppose I have a tcp connection between a client and a sever and the client made a request for a page that contains 2 files. We assume that the http connection is persisted and with pipeline so the 2 requests for the files are send in one tcp segment to the from the client to the server. Now suppose the files that the client wants are like 4500 bytes and 3000 bytes and the MSS of tcp is 1460 bytes because we are using ethernet, so the first file should be divided in 3 segments of 1460 and one of 120 while the second file is divided in 2 segments of 1460 and one of 80 (at least this is what happen if tcp send one file only). In this situations how many segments tcp will send? The first 4 of the first file and the 3 of the second file or it will “merge” the 2 file together at first and then send that file divided? In the second case we would have a file of 7500, 5 MSS + 200 bytes.
I can’t find anywhere informations about this problem. So in the end my question how is the pattern of the segments send by tcp:
3 MSS -> 120 bytes -> 2 MSS -> 80 bytes Or 5 MSS -> 200 bytes
I can’t understand how tcp could send a segment containing bytes of 2 different files.