Log In
58 votes

$\text{Host A}$ sends a $\text{UDP}$ datagram containing $8880\text{ bytes}$ of user data to $\text{host B}$ over an $\text{Ethernet LAN}.$ Ethernet frames may carry data up to $1500\text{ bytes (i.e. MTU = 1500 bytes)}.$ Size of $\text{UDP}$ header is $8\text{ bytes}$ and size of $\text{IP}$ header is $20\text{ bytes}.$ There is no option field in $\text{IP}$ header. How many total number of $\text{IP}$ fragments will be transmitted and what will be the contents of offset field in the last fragment?

  1. $6$ and $925$
  2. $6$ and $7400$
  3. $7$ and $1110$
  4. $7$ and $8880$
in Computer Networks
edited by
its already given UDP DATAGRAM is 8880 B which mean it is send to network layer without more addition of 8 B  then why u adding 8 and making DATAGRAM 8888?

simply if we forward 8880 and let it go for fragmentation answer is


in question its clearly written that 8880 bytes of user data so header will be added before user data.

I too skipped this word and wasted a lot of time...

in this for last fragment we will take 1472 from options



What is this. Please explain this term


@Ritik Jain RJ

data unit

TCP -segment


hahahaha same buddy I also skipped that part :-)

9 Answers

91 votes
Best answer

Answer is C.

Number of fragments  $=\large\Big\lceil\frac{8888}{1480}\Big\rceil = 7$
Offset of last fragment $=\dfrac{(1500 - 20)\times  6} {8}=1110$
(scaling factor of $8$ is used in offset field).

$\text{TCP or UDP header}$ will be added to the DataUnit received from Transport Layer to Network Layer. And fragmentation happens at Network Layer. So no need to add $\text{TCP or UDP}$ header into each fragment.

edited by
@ is 1109....not exactly in option...

number of fragments  = ceil(8888/1480) = 7

y & how????????????

In each fragment we are sending 1480 bytes of data. Total data to be sent is 8888. So, number of fragments = ceil(8888/1480). Ceil is used because even if 1 byte is extra we need a full fragment.
can you please explain what is a scaling factor?
Only first fragment contain UDP header else don't, right?

This makes sense too, as router don't need UDP header and at the destination, after reassembly at destination it's going to be one packet anyway.
To travel intermediate routers we don't need UDP header.
sir mera ek basic doubt hai.. plz make it clear.. sir sometimes we subtract header length sometimes not as actualy frame division we only need the actual data so why not we subtract 20 here... ??
In this question why are we not considering Ethernet header, it should be substracted from MTU right???
We fragment the payload of IP packet and not the whole packet. So we will always subtract header length.
In the question, ethernet frame's max size is given 1500 B. So the framing should happen in data link layer of sender. Why we are doing that in network layer?

Please clear my understanding about this. Thanks in advance !
@bikram sir, why are we adding 8 and making DATAGRAM 8888? Please help me understand this concept.

Why are we adding 8 and making it 8888 ?

To answer this, ask yourself, what is inside a IP datagram ? Inside a IP datagram (or call it IP packet) we keep  a TCP segment. (or a UDP segment).

Now, a UDP (or TCP) has to be there with its header. Question clearly mentions that 8880 Bytes of user data is there and 8 Bytes of UDP header. So this makes up the UDP segment size as 8880+8 = 8888B

@sachin mittal 1

UDP header is not added to the first fragment, instead, it is added to the datagram and then this entire package (of 8880 bytes data and 8 bytes header is passed to the network layer) as one unit of 8888 bytes. And at the network layer, this is fragmented and IP header is added to individual fragments. Am I right?
Why 6 is multiplied in second step instead of 7?

Please explain.
Since there are 7 fragments hence till now we have sent 6 fragments and so to find out the fragment offset of the 7th fragment we find out the total data sent till now in 6 fragments and scale it by a factor of 8.
sir why are we dividing by 8?
Because max length of ip packet is 65535(2^16) but in offset field we have only 13 bits to store the data value ahead of current packet so we do scaling of (2^16)/(2^13)=8.
if i calculate overhead at receiver what will be the overhead ?

@minal I think it should be 20*7 =140 B

Because there a six fragments ahead of the last fragment and offset no. depends on the no. of fragments ahead.
39 votes

 Answer is : 7 fragments and last fragment offset is 1110

edited by
during my classes we were taught that we cannot take 0- 1479 because 1480 is not divisible by 8 we have to take number which is less than 1480 nd divisible by 8 i.e 1476?? solve this query please??

1480 is divisible by 8 :) 185*8
hmm i realized my mistake earlier ..forgot to mention :)
5 votes
UDP data = 8880 bytes
UDP header = 8 bytes
IP Header = 20 bytes

Total Size excluding IP Header = 8888 bytes.

Number of fragments  = ⌈ 8888 / 1480 ⌉ 
                     = 7
Offset of last segment = (1480 * 6) / 8 = 1110 
Paras Nath  excluding IP Header or Udp header ??????
udp header.
excluding ip header
4 votes
1500 is MTU . And header length of ip is 20 . So net data can go is 1500-20 =1480 . and no. of fragment needed  (8880+8)/1472 = 6.something so 7 . and offset 6*1480/8= 1110 .

edited by
all have different explanation then wch one shd correct m getting u even correct but some one mark a option

To me i am correct and none of the options are matching for offset (1104)  . It is closed to 1110 .

And the guy who mark option A ( @sameer ) actually did what i did . But he has made a mistake while computing -

Fragment 5,  2292 - 1472 = 820,  Offset = (1472 * 4) / 8 = 736 it should be 

Fragment 5,  2992 - 1472 = 1520,  Offset = (1472 * 4) / 8 = 736  .peace

Transport is at a higher level than network. There won't be multiple UDP headers for the same UDP datagram.
I miss that again .  Yeah you are right .
ok.. thx..
final answer is c ?
Answer is C)
y r u dividing by 1472 ?? not by 1480 ?? anyone ??
3 votes
A.   6 and 925

Fragment 1,  8880 - 1472 = 7408,  Offset = (1472 * 0) / 8 = 0

Fragment 2,  7408 - 1472 = 5936,  Offset = (1472 * 1) / 8 = 184

Fragment 3,  5936 - 1472 = 4464,  Offset = (1472 * 2) / 8 = 368

Fragment 4,  4464 - 1472 = 2992,  Offset = (1472 * 3) / 8 = 552

Fragment 5,  2292 - 1472 = 820,  Offset = (1472 * 4) / 8 = 736

Fragment 6,  820,  Offset = (1472 * 5) / 8 = 920

edited by
you are adding a new UDP header for each IP fragment.

Yes, correct.

TCP or UDP header will be added to the DataUnit received from Transport Layer to Network Layer.

And fragmentation happens at Network Layer. So no need to add TCP or UDP header into each fragment.

fragment shd 7 if ceil then y 6 plz say
how will think we have to include data size in data size itself. i mean in this question we are considering data as 1480+20 why not 1500+20, in some question we include header explicitly. In this question how do we know header is included implicitly , i am very much confused please help me in this

Most of the time MTU size is given which is 1500 which includes (data+header) . IP header is given to 20 bytes so (total - header) is data . This is always true .
2 votes

The concept that you should be clear with before or after attempting this question is how UDP datagram is handled during fragmentation at IP layer

You can read whole thing here

Or remember following

The UDP header that contains the source and destination port numbers appears only in the first fragment (a complicating factor for firewalls and NATs). Fragmentation is controlled by the IdentificationFragment Offset, and More Fragments (MF) fields in the IPv4 header. 

Rest calculation is easy 

Total size of IP payload $=ceil( 8888 /1480)=7

Fragmentation offset is (1480*6)/8=1110

edited by
2 votes

On total there are 7 fragments and offset of last fragment is 1110

0 votes

Related questions

27 votes
5 answers
A link has transmission speed of $10^6$ bits/sec. It uses data packets of size $1000$ $\text{bytes}$ each. Assume that the acknowledgment has negligible transmission delay and that its propagation delay is the same as the data propagation delay. Also, assume that the ... $\text{%}$. The value of the one way propagation delay (in milliseconds) is_____.
asked Feb 12, 2015 in Computer Networks jothee 5.2k views
27 votes
6 answers
Which of the following fields of an IP header is NOT modified by a typical IP router? Check sum Source address Time to Live (TTL) Length
asked Feb 13, 2015 in Computer Networks makhdoom ghaya 4.2k views
18 votes
5 answers
Consider the following routing table at an IP router: $\begin{array}{|l|l|l|} \hline \textbf {Network No} & \textbf {Net Mask} & \textbf{Next Hop} \\\hline \text {} & \text{} & \text{Interface $0$} \\\hline\text {} & \text{} & \text{Interface $ ... i-a, ii-c, iii-e, iv-d i-a, ii-d, iii-b, iv-e i-b, ii-c, iii-d, iv-e i-b, ii-c, iii-e, iv-d
asked Feb 13, 2015 in Computer Networks jothee 5k views
48 votes
5 answers
Assume that the bandwidth for a $TCP$ connection is $1048560$ bits/sec. Let $\alpha$ be the value of RTT in milliseconds (rounded off to the nearest integer) after which the $TCP$ window scale option is needed. Let $\beta$ be the maximum possible window size with window scale option. Then ... $^{16}$ $500$ milliseconds, $65535$ $\times $2$^{14}$ $500$ milliseconds, $65535$ $\times $2$^{16}$
asked Feb 12, 2015 in Computer Networks jothee 12.8k views