The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+20 votes
3.4k views
Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many times each packet has to visit the network layer and the data link layer during a transmission from S to D.

(A) Network layer – $4$ times and Data link layer – $4$ times

(B) Network layer – $4$ times and Data link layer – $3$ times

(C) Network layer – $4$ times and Data link layer – $6$ times

(D) Network layer – $2$ times and Data link layer – $6$ times
asked in Computer Networks by Veteran (355k points)
edited by | 3.4k views
0
any good explanation ?

5 Answers

+32 votes
Best answer

C is the Answer.

answered by Loyal (6k points)
edited by
0
@Mithlesh Can u plz elaborate on why in the router the protocol stack is visited twice.
0
Ok thanks :)
0
As the packet visits the network layer in the routers too, why it is not counted ??
+1
Answer to this needs more explaination.
0
give more explanation broooo diagram is clear but why didn't u addd network at routers and why did u count two two times at thr router why can't it be once
+1
both side of router may have different ethernet network or different frame mtu so it has 2 -2 layer of datalink and physical while network layer can handle mtu ,frame size so only 1 network layer
+1

At source: Application layer transmit the message. TCP adds the header to the message and sends this segment to IP.

Network layer now adds IP header, puts TTL value, checksum and then, passes IP packet down to data link layer.

Data link layer puts this IP packet into ethernet frame, adds the preamble and Starting Frame delimiter and transmits the frame with CRC.

Physical layer encodes the frame from DLL into 0's and 1's.

Now What happens at each Router:

The router receives the packet,

Physical layer decodes the bitstream, data link layer checks the frame for errors using CRC, passes to the network layer, the network layer sees the destination address as D and decides to route it to another router, decrements the TTL, recomputes the checksum and sends the packet down to the data link layer.

The data link layer changes the destination MAC address to the MAC address of the next router (or destination D if the router is the second one), recalculates CRC and sends the frame.

The physical layer again passes the frame as sequence of 1's and 0's.

At Destination: The physical layer decodes the message and passes it to the data link layer. Data link layer checks for errors and passes the IP packet to the network layer. The network layer checks the destination address and accepts it.

Here confusion is why network layer at routers R1 and R2 is visited only once?

Because the routers R1 and R2 don't have to consume the information present in the message, otherwise, this should have been passed on to the transport layer and application layer and then back to network layer again.

Data link layer will be visited twice per router because the routing decision is involved and this will be made only by the network layer.

+23 votes

In source,

it is $1$ data link and $1$ network .. now as routers are in network layer
So in

$\text{Router1:}$At first, it goes to network layer like physical$\Rightarrow$DLL$\Rightarrow$network
(then again comes to physical like)$\Rightarrow$DLL$\Rightarrow$physical 

$\text{Router2}:$
Physical$\Rightarrow$DLL$\Rightarrow$network$\Rightarrow$Dll$\Rightarrow$physical

Destination:

Physical$\Rightarrow$DLL$\Rightarrow$Network$\Rightarrow$TCP$\Rightarrow$Application

In both routers after computation in Network layer, it is coming back to physical again...
the reason is signals can only be transmitted with physical layer.

So, Network Layer$=4 \text{ Visit}.$

DLL$=6\text{ Visit}.$

answered by Boss (18.5k points)
edited by
+10 votes
(C) Network layer – 4 times and Data link layer – 6 times

Sender Has one network layer and data link layer as receiver but router have 1NL,2DL and 2PL;

So Total NL=1NL(Sender)+2NL*(Router)+1N(Receiver)=4NL

Total DL=1*2DL(Sender+Receiver)+2*2DL(Router=6DL)

Option given as

(C) Network layer – 4 times and Data link layer – 6 times
answered by Loyal (8.8k points)
+6 votes

(C) is the correct option!
For detailed explanation:

answered by Boss (39.8k points)
0
Good Explanation
+4 votes
ans c)
answered by Active (5.2k points)
Answer:


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

38,050 questions
45,543 answers
131,851 comments
48,879 users