From above given diagram, it's easily visible that packet will visit network layer 4 times(once at each node [S, R, R, D]) and packet will visit Data Link layer 6 times (One time at S and one time at D, then two times for each intermediate router R as data link layer is used for link to link communication.)
Once packet reaches to R(router) then it goes up from physical layer to DLL to Network layer and when packet coming out of router in order from Network layer to DLL to Physical layer.
Remember: You can see, At router there are two Physical Layer and two Data link Layer.The reason is,on one side of the router there could be one network and other side of the router there could be other network.
For ex.- One side there could be Ethernet and on other side there could be Token Ring.So,One DLL will understand the language of Ethernet and other DLL will convert the packet so that it could be read by the Token Ring.
That is why two DLL and two PL is needed at the Router.