The Gateway to Computer Science Excellence
+7 votes
2.1k views
Suppose that host A is connected to a router R 1, R 1 is connected to another router,
R 2, and R 2 is connected to host B. Suppose that a TCP message that contains 900
bytes of data and 20 bytes of TCP header is passed to the IP code at host A for delivery
to B. Show the Total length of the IP header in each packet transmitted over the three links. Assume that link A-R1
can support a maximum frame size of 1024 bytes including a 14-byte frame header,
link R1-R2 can support a maximum frame size of 512 bytes, including an 8-byte frame
header, and link R2-B can support a maximum frame size of 512 bytes including a
12-byte frame header.
in Computer Networks by Junior (765 points) | 2.1k views
0

@Kapil maximum frame size of 1024 bytes including a 14-byte frame header 

This means that total frame length is 1024 + 14 = 1034B     or  does 14B is included in 1024B

0
920, 432, 432?
0
NO

But how ?

MTU OF A---> R1  ; 1014

MTU OF R1 ---> R2 : 504

MTU OF R2-- > B ; 500

FOR A---> R1: 920  that is right

FOR R1--->R2 : (416) (504) so according to me answer is 416

FOR R2-->B  : (416) (4) (500)  so according to me answer is 416

 

 answer given is (920,460,460)  but my answer is (920, 416, 416).
0
MTU in A = 1024 - 14(Frame header) = 1010 - 20(IP header) = 990 (excluding IP header)

MTU in B = 512 - 8 = 504 - 20 = 484 BUT we can send in only multiples of 8, so its 480.

MTU in C = 512 - 12 = 500 - 20 = 480.

A to R1 : fragment length : 920

R1 to R2 : fragment 1 : 480, fragment 2 : 440   *made calculation mistake the last time here so got 432*

R2 to B : fragment 1: 480, fragment 2 : 440

so according to me its 920,440,440
0

Ok now i understand how they got 460,460.

They are adding TCP header to the fragments also.

i.e.. from R1 to R2 : first fragment is :  20(TCP header) + 460(DATA) = 480.

                                second fragment : 20(TCP header) + 440(Remaining data because the initial data is 900) = 460.

similar is the case with transmission form R2 to B.

BUT... The answer provided is wrong. because the TCP header is not split when fragmentation occurs.

link for the above statement : http://web.deu.edu.tr/doc/oreily/networking/firewall/ch06_03.htm

see 6.3.2.2 in the above link.

0
still i am confuse give proper solution so that i can get it . What is wrong with my solution

2 Answers

+8 votes
Best answer

A---------R1----------R2-----------B     (This is how the packet flows from A to B)

When we receive data from transport layer, then whole of it is considered as data by network layer to be sent .So, transport layer gives 900 + 20 (TCP header) = 920 B to the network layer to be sent .

Hence, the data to be considered is 920 B, which is what transport layer sends to IP layer.

1). First, we talk about how to successfully transmit data from A to R1.

No fragmentation required here, hence IP packet size = 920 B 

2). Now, we see for R1 to R2. (For sending, R1 removes previous frame added of 14 B)

It says , it can support maximum frame size of 512 B including 8 B frame header .

Hence, it can be fragmented into 2 frames ( 480 and 440 ) . Finally, One IP packet is 480 + 20 = 500 B and second is

440 + 20 = 460 B . So, 2 packets are send to R2 .

3). We see for R2 to B. (For sending , R2 removes previous frame added of 8 B)

It says , it can support maximum frame size of 512 B including 12 B frame header , hence , no need to fragment it . 

One frame is 480 + 20 = 500 B and other frame 440 + 20 = 460 B , will reach B.


Note: I have only considered here IP packet size (Payload + Header), and if this packet is sent to DLL then DLL packet size = IP packet size + DLL header. But that is not asked in the question .Question is only asking about IP packet size

by Veteran (50.9k points)
edited by
0
Link A-R1:
Length = 940
Link R1-R2:
(1) Length = 500
(2) Length = 460
Link R2-B:
(1) Length = 500
(2) Length = 460
0
ur ans. is wrong.

ans. should be as above mentioned.
0
@Rajnish, i hv given the complete length for each part .

For A-->R1, 954 is total size , whereas its data length part means 940 bytes.

Also, 512 - 8 = 504 then, it cannot be 500.
500 also includes IP header which is must.

And for 460 B , i dont think it will come,
0
u know that data part is exactly divisible by 8 in fragmentation.

but in step 2. ur fragmentation data part i.e. 436 is not divisible by 8.

in step 3. ur data part 500,4,436 is also not divisible by 8.
0
Yes. It is divisible by 8. Right, I forgot to do that part. I did it by simple logic..

Thanks. I will update....
0
so answer will be A or C??the data in last fragment id 440 or 440 + 20??
0

@Akriti sood , i have tried to make it more clear. Check now !!

PS: You can still ask in case of doubt.

0
thanks @kapil
+1

I found this altough i'm unable to understand whole concept form either side!

+1
How ip [packet size is  920 B for first? Ip will add its header and make it  920 B +20=940
0
Also,in gate questions that i have solved. The ip header is shared among fragments with some change in value.

Now here IP adds 20 B. On the top of that R1 will add its 14 B?I did not understand this?Can you help @Kapil.

Why are we considering both headers? R1 should use the same header with some changes.I mean header increases to 34 bytes here.But it should be 20 B
+13

@rahul sharma 5

I am unable to understand why are you confusing :) The answer is apt and clear .

Consider :
1) Our original packet is : 20|920 ; //By this notation I mean 20 B IP header and 920 B data from transport layer.

2) Link A--R1 : MTU(It includes IP header but does not include frame header) : 1010B or 20|990 //As IP header of 20 B is shared.

Our data: 920 ,  Max allowed:990 --> No fragmentation needed .

Packet transmitted : 20|920

3) Link R1--R2 : MTU(It includes IP header but does not include frame header) : 504B or 20|484 //As IP header of 20 B is shared.

Our data: 920 ,  Max allowed:484 -->  fragmentation needed .

Now, 484 not a multiple of 8 ---> Effective MTU : 20|480 ; 480 =60*8 , multiple of 8,

Fragment 1 : 20|480     Fragment 2: 20|440   ; 920-480=440

Offset :            0-59          Offset :            60-114

Packets transmitted : 20|480 and 20|440

4) Link R2--B : MTU(It includes IP header but does not include frame header) : 500B or 20|480//As IP header of 20 B is shared.

Our data: 480 and 440 ,  Max allowed:480 --> No fragmentation needed .

Packets transmitted : 20|480 and 20|440

PS: Now, You might be thinking why we have considered IP header as 20 B only as it is no where mentioned in the question the size of IP header and

IP header : 20-40 B in IPv4 and  40B in IPv6

This thing is even not clear to me. May be the question is poorly structured(No offense to the one posting the question :) )

Hope this helps :)

0
lovely explanation sethi mam
+1 vote

Link A-R1

Length= (920Bdata+20Bheader)=940B   

Link R1-R2(here the packet is being fragmented into 2 packets)

Packet1:Length=(504B data+ 8B header)=512B  [It is correct bcz data's length i.e 504 is divisible by 8]

Packet 2:Length=(416B data + 8B header)=424B [It is correct bcz data's length i.e 416 is divisible by 8]

Link R2-B( here packet 1 from link R1-R2 is fragmented into to two packets say packet1,1 and packet 1,2)

Packet1.1 Length=(496 B data+ 12 bytes header)=508 B [It is correct bcz data's length i.e 496 is divisible by 8]

Packet 1.2 Length=(8 B data+ 12 bytes header)=20 B [It is correct bcz data's length i.e 8 is divisible by 8]

Packet 2 Length=(416 B data+ 12 bytes header)=428 B [It is correct bcz data's length i.e 416 is divisible by 8]

So Receiver receives three packets.

PACKET ID MF HL=Headersize/4 TL  OFFSET
PACKET 1,1 X 1 3 508 0
PACKET 1,2 X 1 3 20 496/8=62
PACKET 2 X 0 3 428 (496+8)/8=63
by Active (3.3k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,370 answers
198,506 comments
105,275 users