76 votes 76 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? $6$ and $925$ $6$ and $7400$ $7$ and $1110$ $7$ and $8880$ Computer Networks gatecse-2015-set2 computer-networks ip-packet normal + – go_editor asked Feb 13, 2015 • edited Jan 6, 2018 by pavan singh go_editor 25.7k views answer comment Share Follow See all 11 Comments See all 11 11 Comments reply Show 8 previous comments Arpon Roy commented Oct 28, 2022 reply Follow Share dll mtu means only frame size here after fragmentation 20B of ip header will be added so actually respect to the n/w layer it can divide by 1480 B 1 votes 1 votes Ayushpal commented Nov 10, 2023 reply Follow Share What is offset ? 0 votes 0 votes darcy5 commented Dec 12, 2023 reply Follow Share Similar question: https://gateoverflow.in/204129/gate-cse-2018-question-54 0 votes 0 votes Please log in or register to add a comment.
Best answer 127 votes 127 votes 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. Vikrant Singh answered Feb 13, 2015 • edited Jun 20, 2018 by Milicevic3306 Vikrant Singh comment Share Follow See all 29 Comments See all 29 29 Comments reply Mayu Rathi commented Feb 27, 2015 reply Follow Share @ vikrant...it is 1109....not exactly in option... 0 votes 0 votes Shimpy Goyal commented Jun 18, 2015 reply Follow Share number of fragments = ceil(8888/1480) = 7 y & how???????????? 0 votes 0 votes Arjun commented Jun 23, 2015 reply Follow Share 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. 32 votes 32 votes Neelay Upadhyaya commented Dec 24, 2016 reply Follow Share can you please explain what is a scaling factor? 0 votes 0 votes Sachin Mittal 1 commented Jan 21, 2017 reply Follow Share 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. 26 votes 26 votes priyanka gautam-piya commented Jan 27, 2017 reply Follow Share 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... ?? 0 votes 0 votes Rahul Jain25 commented Jan 28, 2017 reply Follow Share In this question why are we not considering Ethernet header, it should be substracted from MTU right??? 0 votes 0 votes sushmita commented Feb 8, 2017 reply Follow Share We fragment the payload of IP packet and not the whole packet. So we will always subtract header length. 10 votes 10 votes Vishal Bidawatka commented Aug 2, 2017 reply Follow Share 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 ! 1 votes 1 votes shraddha priya commented Sep 21, 2017 reply Follow Share @bikram sir, why are we adding 8 and making DATAGRAM 8888? Please help me understand this concept. 0 votes 0 votes rishi71662data4 commented Oct 27, 2017 reply Follow Share 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 36 votes 36 votes Sumaiya23 commented Dec 26, 2017 reply Follow Share @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? 8 votes 8 votes Gupta731 commented Sep 7, 2018 reply Follow Share Why 6 is multiplied in second step instead of 7? Please explain. 0 votes 0 votes Rutvik Reshamwala commented Sep 7, 2018 reply Follow Share 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. 2 votes 2 votes Rajesh Panwar commented Nov 11, 2018 reply Follow Share sir why are we dividing by 8? 0 votes 0 votes Peeyush Pandey commented Nov 24, 2018 reply Follow Share 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. 2 votes 2 votes minal commented Dec 25, 2018 reply Follow Share if i calculate overhead at receiver what will be the overhead ? 0 votes 0 votes Hemanth_13 commented Jan 2, 2019 reply Follow Share @minal I think it should be 20*7 =140 B 2 votes 2 votes Prashant Srivastava commented Mar 31, 2019 reply Follow Share Because there a six fragments ahead of the last fragment and offset no. depends on the no. of fragments ahead. 0 votes 0 votes arpit_18 commented Nov 3, 2020 reply Follow Share Why the ip header not subtracted from packet? Why is it 8888 and not 8888-20? 0 votes 0 votes soumyajit000⁰00 commented Dec 13, 2020 reply Follow Share ( total size = header + payload or data) it is specified in question that size of data/payload is 8880 bytes. And it is a udp packet whose header size is 8 bytes. so total size of datagram is 8880 + 8(header) =8888 1 votes 1 votes arpit_18 commented Dec 13, 2020 reply Follow Share Got it bro,router doesn’t have layers above Network so the UDP header is treated as Payload. Thanks :) 1 votes 1 votes goldenface commented Feb 8, 2021 reply Follow Share haha I had the same doubt. Thanks for asking behalf of me. And the very first option is a trap answer :) 0 votes 0 votes DAWID15 commented Dec 3, 2021 reply Follow Share Hey it’s 8880 byte. size of one packet without IP header = 1500-20=1480 Total packets = 8880/1480=6 Now for the last packet 5 packets are before, hence total data(without IP header) above the last packet= 1480*5=7400. So the offset will be 7400/8=925 So Option A. 1 votes 1 votes Swarnava Bose commented Oct 4, 2022 reply Follow Share Why are we not dividing by 1500 ? Why are we divinding by 1480 ? In other questions, we divide by MTU size 0 votes 0 votes DAWID15 commented Oct 7, 2022 reply Follow Share That’s because we need to add an IP header to that packet. If we were to take the size 1500 then after adding IP header the size becomes 1520, more than MTU. Also note that the size of packet(excluding IP header) must be divisible by 8. Here 1480 is divisible hence we took this value. Hope it helps. 1 votes 1 votes practicalmetal commented May 29, 2023 reply Follow Share The length of the UDP data is given as 8880 Bytes and the UDP header is 8 Bytes. The UDP datagram(header+data) is inserted into the data field of the IP datagram therefore the length of the data field of the IP datagram is 8880+8=8888B. Hope this clears your doubt :) 0 votes 0 votes dangling-else commented Jul 26, 2023 reply Follow Share If you don't add TCP or UDP header to every fragment, then can you please tell me how you will identify the fragment belongs to which port number/process I'd in receiver ? 0 votes 0 votes kickassakash commented Nov 20, 2023 i edited by kickassakash Nov 20, 2023 reply Follow Share @dangling-else our main motive is to deliver a packet from A to B. routers use ip header(ip header is appended to each fragment) to securely deliver packet from source to the destination address. Then at the Destination host we reassemble the packets and forward to our target port/process. 1 votes 1 votes Please log in or register to add a comment.
45 votes 45 votes Answer is : 7 fragments and last fragment offset is 1110 bahirNaik answered Dec 22, 2015 • edited Feb 1, 2016 by bahirNaik bahirNaik comment Share Follow See all 3 Comments See all 3 3 Comments reply vamp_vaibhav commented Jul 25, 2017 reply Follow Share during my classes we were taught that we cannot take 0- 1479 because 1480 is not divisible by 8 ..so we have to take number which is less than 1480 nd divisible by 8 i.e 1476?? solve this query please?? 0 votes 0 votes VS commented Aug 1, 2017 reply Follow Share @vamp_vaibhav 1480 is divisible by 8 :) 185*8 3 votes 3 votes vamp_vaibhav commented Aug 1, 2017 reply Follow Share hmm i realized my mistake earlier ..forgot to mention :) 0 votes 0 votes Please log in or register to add a comment.
6 votes 6 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 answered Sep 10, 2016 Paras Nath comment Share Follow See all 3 Comments See all 3 3 Comments reply flash12 commented Jan 25, 2018 reply Follow Share @ Paras Nath excluding IP Header or Udp header ?????? 0 votes 0 votes Rajesh Panwar commented Jan 3, 2019 reply Follow Share udp header. 0 votes 0 votes Pvkarma commented Sep 22, 2020 reply Follow Share excluding ip header 0 votes 0 votes Please log in or register to add a comment.
4 votes 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 . Pranay Datta 1 answered Jun 22, 2015 • edited Jun 23, 2015 by Pranay Datta 1 Pranay Datta 1 comment Share Follow See all 8 Comments See all 8 8 Comments reply Show 5 previous comments tiger commented Jan 3, 2016 reply Follow Share final answer is c ? 0 votes 0 votes Neeraj Chandrakar commented Oct 17, 2017 reply Follow Share Answer is C) 0 votes 0 votes Puja Mishra commented Jan 16, 2018 reply Follow Share y r u dividing by 1472 ?? not by 1480 ?? anyone ?? 0 votes 0 votes Please log in or register to add a comment.