The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+22 votes

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.

  1. Network layer – $4$ times and Data link layer – $4$ times
  2. Network layer – $4$ times and Data link layer – $3$ times
  3. Network layer – $4$ times and Data link layer – $6$ times
  4. Network layer – $2$ times and Data link layer – $6$ times
asked in Computer Networks by Veteran (406k points)
edited by | 4.2k views
any good explanation ?

5 Answers

+40 votes
Best answer

C is the Answer.

answered by Active (5k points)
edited by
@Mithlesh Can u plz elaborate on why in the router the protocol stack is visited twice.
Ok thanks :)
As the packet visits the network layer in the routers too, why it is not counted ??
Answer to this needs more explaination.
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
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

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.

+25 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 




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 (17.7k points)
edited by
+11 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 (9.7k points)
+8 votes

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

answered by Boss (42.3k points)
Good Explanation
+4 votes
ans c)
answered by Loyal (5.2k 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
49,541 questions
54,093 answers
71,001 users