edited by
28,185 views
66 66 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

8 Answers

Best answer
154 154 votes

C is the Answer.

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.

credits: Ayush Upadhyaya sir

edited by
28 28 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}.$

edited by
11 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
2 2 votes

Answer: C. Network layer - 4 times and Data link layer - 6 times

Let’s break this down step by step:


Key Concepts

  • Network Layer: Handles logical addressing and routing (e.g., IP addresses).
  • Data Link Layer: Handles physical addressing and link-level communication (e.g., MAC addresses). A new data link connection (frame) is created for every hop between devices.

Scenario

  • Source (S) and Destination (D) are connected through two intermediate routers (R1 and R2).
  • The packet travels through 4 nodes: Source (S)Router R1Router R2Destination (D).

Packet's Journey

Step 1: From Source (S) to Router R1

  • Network Layer:
    • The packet is processed at the network layer at the source to determine the destination IP address and route.
  • Data Link Layer:
    • A frame is created for the link between the source and Router R1.
    • The frame is received and processed at Router R1.

Step 2: From Router R1 to Router R2

  • Network Layer:
    • At Router R1, the network layer processes the packet to determine the next hop (Router R2).
  • Data Link Layer:
    • A new frame is created for the link between Router R1 and Router R2.
    • The frame is received and processed at Router R2.

Step 3: From Router R2 to Destination (D)

  • Network Layer:
    • At Router R2, the network layer processes the packet to determine the final destination (D).
  • Data Link Layer:
    • A new frame is created for the link between Router R2 and the destination.
    • The frame is received and processed at the destination.

Layer Visits

Network Layer:

  • The packet is processed at the network layer at:
    1. Source (S)
    2. Router R1
    3. Router R2
    4. Destination (D)
  • Total Network Layer Visits: 4

Data Link Layer:

  • A new frame is created and processed at every hop:
    1. Source (S) → Router R1 (1st frame)
    2. Router R1 → Router R2 (2nd frame)
    3. Router R2 → Destination (D) (3rd frame)
  • Each of the 3 hops involves two visits to the data link layer:
    • One at the sender of the frame.
    • One at the receiver of the frame.
  • Total Data Link Layer Visits: 3 hops×2 visits per hop=63 \text{ hops} \times 2 \text{ visits per hop} = 6

Final Answer

  • Network Layer: 4 times
  • Data Link Layer: 6 times

So the correct answer is C. Network layer - 4 times and Data link layer - 6 times.

Here’s a diagram illustrating the flow of packets from the Source (S) to the Destination (D) via two routers (R1 and R2). It shows how the packet is processed at both the Network Layer and Data Link Layer for each hop.

4 flags:
✌ Migrate (rhl “seems chatgpt slop”)
✌ Spam (AnshG01)
✌ Migrate (Subh23 “CHATGPT”)
✌ Migrate (Millind_Patro “gpt with bad prompt”)
Answer:
Position:
Show:

Related questions

72 72 votes
10 answers 10 answers
55.7k
55.7k views
Arjun asked Sep 24, 2014
55,681 views
In an IPv4 datagram, the $M$ bit is $0$, the value of $HLEN$ is $10$, the value of total length is $400$ and the fragment offset value is $300$. The position of the datag...
39 39 votes
7 answers 7 answers
24.7k
24.7k views
Arjun asked Sep 24, 2014
24,664 views
Determine the maximum length of the cable (in km) for transmitting data at a rate of $500$ Mbps in an Ethernet LAN with frames of size $10,000$ bits. Assume the signal sp...
24 24 votes
3 answers 3 answers
12.9k
12.9k views
Arjun asked Sep 23, 2014
12,906 views
Using public key cryptography, $X$ adds a digital signature σ to message $M$, encrypts $\langle M, \sigma \rangle$, and sends it to $Y$, where it is decrypted. Which one ...
6 6 votes
0 0 answers
1.2k
1.2k views
Surajit Sadhukhan asked Aug 31, 2024
1,214 views
This post was deleted with below mentioned reason.
Delete Reason Name: All previous gate questions are already available in the site. See "Previous Years" tab in the Menu.
Delete Reason Note:
Has Author Submitted Revision Edit?: NOT YET
The submitted edit has been rejected. The post is hidden permanently.
Relation $R$ has eight attributes $ABCDEFGH$. Fields of $R$ contain only atomic values.$F=$ $\{\mathrm{CH} \rightarrow \mathrm{G}, \mathrm{A} \rightarrow \mathrm{BC}, \ma...