7,420 views
8 votes
8 votes
Suppose datagrams are limited to 1,500 bytes (including header) between source Host A and destination Host B. Assuming a 20-byte IP header and a 20-byte TCP header, how many datagrams would be required to send an MP3 consisting of 4 million bytes?

5 Answers

Best answer
12 votes
12 votes

The concept is straight here ..The key words here are :

Host to host delivery which is nothing but we are talking about IP packets

Here fragmentation does not come into picture because nothing is mentioned here regarding fragmentation.Simply we need to find how many IP packets we need to transfer between the hosts in order to send the required amount of message which is representative of application layer..

So message size    =    4 * 106 B

Now an IP packet  =   Message coming from application layer +  TCP header + IP header

And MTU includes all these things..

Hence data allowed in 1 packet      =    1500 -  40   

                                                    =    1460 B

And total data (message) size        =     4 * 106

Hence no of packets(IP datagrams) needed  =  ceil((4 * 106) / 1460)

                                                                 =  2740

Hence 2740 is correct answer..

selected by
2 votes
2 votes

Million means 106.

Mega may create a confusion, but million has only one meaning.

4000000-40 are the data bytes.=3999960 bytes.

MTU is 1500 bytes, so data bytes are only 1460 bytes

No. of datagrams=3999960/1460=2739.72=2740

2 votes
2 votes
The enitre 4 million user data is transfered from the Application Layer to the Transport Layer.

Now , given is the IP Datagram is of 1500 bytes , so remove the IP header from it

IP datagram without the header is 1480 bytes. Now this 1480 bytes of data will contain a TCP segment.

If we had a big enough datagram we would have put the entire 4milllion data into one segment (including the header and passed it to the IP) but here the IP is limited by 1480 bytes.

So we can put a TCP segment of max 1480 bytes . Each TCP segment will contain a header.

Thus amount of user data that can be placed in the TCP segment is 1480 - 20 (header size) = 1460.

Thus finally we can place 1460 bytes of user data into 1 TCP segment , which with addtional 20 bytes header will be sent to the IP datagram.

Thus every IP datagram will have 1460 bytes of user data .

Total IP datagrams required  = 4 * 10^6 / 1460 = 2740
0 votes
0 votes

Ceil[ 4× 106/ 1460] = 2740 packets.

edited by
Answer:

Related questions

0 votes
0 votes
3 answers
2
Lucky sunda asked Feb 7, 2017
702 views
According to me option B is correct.
3 votes
3 votes
3 answers
3
biranchi asked Jan 24, 2017
1,064 views