How hop count in a local area network works?

3

1

I have a network laid out similar to this:

Router A (LAN Port) -> Switch -> Router B (WAN Port)

A PC is connected to the LAN side of each router. PC 1 is on Router A, PC 2 is on Router B. IP Addresses are below:

  • Router A (LAN): 192.168.1.1
  • Router B: 192.168.1.2
  • PC 1: 192.168.1.10
  • PC 2: 192.168.1.25

When I run a traceroute between the PCs, I only see one hop - the destination PC. However, I'm expecting that I should see two - the destination PC and Router B. Why is there not a second hop in the output?

DHCP is enabled on both routers. OUTPUT of ifconfig on both PC's are. I am working in a Linux environment. PC-1

wlan0     Link encap:Ethernet  HWaddr 54:35:30:2b:d9:99  
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::5635:30ff:fe2b:d999/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30098 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22554 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10359238 (10.3 MB)  TX bytes:2881707 (2.8 MB)

PC-2

wlan0     Link encap:Ethernet  HWaddr 54:35:30:2b:d9:99  
          inet addr:192.168.1.25  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::5635:30ff:fe2b:d999/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30098 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22554 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10359238 (10.3 MB)  TX bytes:2881707 (2.8 MB)

Sanket

Posted 2014-07-22T14:51:08.890

Reputation: 133

1We need more details. Can you explain exactly how the routers and switch are attached? Like which ports are you using on the routers (WAN vs LAN)? – Ƭᴇcʜιᴇ007 – 2014-07-22T15:00:26.547

In addition, could you post the output of traceroute/tracert? – mtak – 2014-07-22T15:01:06.613

Switch is connected to router A's LAN port and router B's WAN port is connected to switch port. – Sanket – 2014-07-22T15:07:26.540

Wait, what? Router B is connected to its own WAN port? – Iszi – 2014-07-22T15:07:55.887

Not Its own but Switch port. – Sanket – 2014-07-22T15:09:59.543

Ok, now I'm really confused. Is it Router A (LAN Port) -> Switch -> Router B (WAN Port) or Router A (LAN Port) -> Switch -> Router B (LAN Port). Also, is Router B configured in "bridge mode"? – Iszi – 2014-07-22T15:11:21.507

Router A (LAN Port) -> Switch -> Router B (MODEM Port) I don't know what is modem port. – Sanket – 2014-07-22T15:14:14.667

Ok. There's some key detail missing here. Please provide the IP addresses for each of the network interfaces in question here (Router A LAN, Router B WAN & LAN, PCs 1 & 2). Also, a copy of the output for ipconfig from each PC, and a copy of the output for a tracert from one PC to the other would be useful. Please edit these details into the question, instead of a comment. – Iszi – 2014-07-22T15:17:23.203

Router A 192.168.1.1 Router B 192.168.1.2 PC-1 192.168.1.10 PC-2 192.168.1.25 Command executed :- traceroute -n 192.168.1.25 OUTPUT###### traceroute to 192.168.1.25 (192.168.1.25), 30 hops max, 60 byte packets 1 192.168.1.25 43.045 ms 44.679 ms 44.735 ms – Sanket – 2014-07-22T15:19:05.167

Which side of the network is the IP for Router B on - WAN or LAN? Also please provide ipconfig output for each PC. – Iszi – 2014-07-22T15:30:24.157

@Sanket I've edited the IP information and other details into the question for you. Please provide further clarification (i.e.: ipconfig outputs, interface location for 192.168.1.2, other IP of Router B) via edit to the question instead of further comment. – Iszi – 2014-07-22T15:34:38.670

Answers

4

See the answers posted here.

"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."

Marc05

Posted 2014-07-22T14:51:08.890

Reputation: 286

Quite probably right, but it's interesting that the OP says Router B is linked on the WAN interface. Either the network connections are not quite as described here, or Router B is using some sort of special non-router mode configuration. – Iszi – 2014-07-22T18:29:59.437