I have a local network here. I am doing traceroute to another system on the same network. I was expecting two results. One is the hit to my router, and then to the other machine. But I see just one result as follows
1 13 ms 4 ms 12 ms nj-PC [192.168.1.110]
Why is the information about the router not shown?
1) Does router act as a switch here, or
2) Does it not return the packet if the packet is being forwarded on the same interface? or
3) The packet does not go through the router at all. Once it gets the MAC address of the destination, does it directly send it to the destination? My doubt here is the packet will still go through the router, right? Will it just act as a pass through for these packets?
Basically, what happens when you run traceroute nj-PC
is this:
nj-PC
to an IP address. (won't go into the details of that here)The source host checks its local routing table for a route to that IP address.
Example routing table:
Destination Gateway Genmask ...
0.0.0.0 192.168.1.254 0.0.0.0 ... # default route
192.168.2.0 192.168.1.253 255.255.255.0 ... # net route
192.168.3.23 192.168.1.252 255.255.255.255 ... # host route
192.168.1.0 0.0.0.0 255.255.255.0 ... # directly reachable
If the destination is directly reachable (gateway 0.0.0.0
or On-link
, depending on your operating system), the MAC address of the destination IP address is resolved via ARP and the packet is sent directly to the destination host (via Ethernet).
In your case both source and destination IP address are in the same subnet, so the destination is directly reachable and the packet is thus delivered directly without router involvement. That's why you see only a single hop in the traceroute
output.
The router device may still act as a switch here, if it has a built-in switch and both devices are connected to that switch, but that's a different matter and unrelated to routing. Switching (Ethernet) takes place in the data link layer (layer 2 of the OSI model), whereas routing (IP) takes place in the network layer (layer 3).
My IP is 182.168.1.4 and when I trace route to that device I get.
shiva:ToDoList sparcs$ traceroute shiva
traceroute to shiva.home (192.168.1.4), 64 hops max, 52 byte packets
1 shiva.home (192.168.1.4) 78.566 ms 0.060 ms 0.039 ms
There is no hop, or a router that is needed to get to another network as your device is local.
So, its telling you the exact route.
When tracerouting to my iPhone I get
shiva:ToDoList sparcs$ traceroute Sparcs
traceroute to 192.168.35.181 (192.168.1.181), 64 hops max, 52 byte packets
1 192.168.35.181 (192.168.35.181) 5.129 ms 5.317 ms 5.976 ms
Its on the same segment.
Your questions :
Why is the information about the router not shown?
Does router act as a switch here, or
Not relevent, not needed in regards to trace route functional intent
Does it not return the packet if the packet is being forwarded on the same interface?
No
The packet does not go through the router at all.
True
Once it gets the MAC address of the destination, does it directly send it to the destination?
No
My doubt here is the packet will still go through the router, right?
No
Will it just act as a pass through for these packets?
No
Good read: http://www.cisco.com/en/US/products/sw/iosswrel/ps1831/products_tech_note09186a00800a6057.shtml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With