Operating System - HP-UX
1836396 Members
2471 Online
110100 Solutions
New Discussion

Why is my localhost traffic showing up on lan0 stats?

 
SOLVED
Go to solution
M Wallis
New Member

Why is my localhost traffic showing up on lan0 stats?

HP-UX 11
No routing protcols enabled
Only default route is configured in rc.config.d
machine name : dma1a
ip addr : 66.99.7.6
Nearly all my IP is internal so I expect lo0
to clock up much bigger stats that lan0 but
its the other way around?

# netstat -r
Routing tables
Dest/Netmask Gateway Flags Refs Use Interface Pmtu
localhost localhost UH 0 25368 lo0 4136
dma1a dma1a UH 0 10690716 lan0 4136
66.99.0.0 dma1a U 2 0 lan0 1500
127.0.0.0 localhost U 0 0 lo0 4136
default 66.99.1.1 UG 0 0 lan0 1500

ping -o to my local machine name says its going
to localhost but netstat stats show its going to lan0 and not lo0. ( I ping'd continually
and watched the stats grow ).

# netstat -i
Name Mtu Network Address Ipkts Opkts
lan0 1500 66.99.0.0 dma1a 10697695 10675170
lo0 4136 127.0.0.0 localhost 25308 25308

ping -o shows the ip is being sent to
localhost but this is pegging the lan0 stats.

# ping -o dma1a
PING dma1a: 64 byte packets
64 bytes from 66.99.7.6: icmp_seq=0. time=0. ms

----dma1a PING Statistics----
1 packets transmitted, 1 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
1 packets sent via:
127.0.0.1 - localhost

# ifconfig lo0
lo0: flags=849
inet 127.0.0.1 netmask ff000000
# ifconfig lan0
lan0: flags=843
inet 66.99.7.6 netmask ffff0000 broadcast 66.99.255.255


I noticed that my routing entry for my lan0
IP is destined for itself / lan0 and
this differs with the man page on routing
where the lan0 IP address points to the
loopback address.

my entry

# netstat -rnv
Routing tables
Dest/Netmask Gateway Flags Refs Use Interface Pmtu
127.0.0.1/255.255.255.255
127.0.0.1 UH 0 25493 lo0 4136
66.99.7.6/255.255.255.255
66.99.7.6 UH 0 10745161 lan0 4136

man page on routing from HP-UX 11 (7)

# netstat -rnv
Routing tables
Dest/Netmask Gateway Flags Refs Use Interface Pmtu
15.13.136.66/255.255.255.255
127.0.0.1 UH 1 39 lo0 4608
127.0.0.1/255.255.255.255
127.0.0.1 UH 0 68 lo0 4608

I tried the same thing on SunOS and it all
went to the loopback device.

Are packets destined for the local IP address
of lan0 sent to the lan card or the loopback
device lo0 in HP-UX11?

Is the card transmitting this to the network
as the stats in 'netstat -i' suggest?

Please help explain this behaviour on HP-UX

Thanks,

Mark.



7 REPLIES 7
harry d brown jr
Honored Contributor

Re: Why is my localhost traffic showing up on lan0 stats?

It's the same lan card - so exactly what are you looking for?

live free or die
harry
Live Free or Die
M Wallis
New Member

Re: Why is my localhost traffic showing up on lan0 stats?

Harry,

I would like to find out whether the traffic is really
going to lan card 0 or
worse still being sent out
onto the lan attached to
lan card 0.

I would also like to find
out why my routing table
shows the local IP address
pointing to itself and not
on the loopback dev as in
the man page.

Mark.
harry d brown jr
Honored Contributor

Re: Why is my localhost traffic showing up on lan0 stats?

Mark,

Sorry, I missed the gist the first time. I see what you are saying. If someone doesn't pipe in and anser this by tomorrow, I'll do some quick tests, but I really don't think anything not destined to go anywhere but on the local machine stay's on that machine. if it did hit the "net' then the routing would seem wrong.

live free or die
harry
Live Free or Die
sven verhaegen
Respected Contributor

Re: Why is my localhost traffic showing up on lan0 stats?

hi, the ping -o local machine name isn't a good test , in fact it sends the packet not to the loopback but to the interface holding the IP even if the packet doesn't leave the system , it just gets forwarded on the stack to the actual lancard who replies internally trough the loopback function but the packet is stated in the output of lan0 not lo0

be aware that netstat output differs from ux versions 10.x to 11.x so man pages might be somewhat dated
...knowing one ignores a greath many things is the first step to wisdom...
M Wallis
New Member

Re: Why is my localhost traffic showing up on lan0 stats?

Sven,

Thanks, that tip is helpful.

I feel HP have been a little tricky in what
they have done to the routing as the routing
for the loopback device is now automatically
created and I cannot change it.

The reason behind why the question was raised
is that I am running an Informix DB on the
HP-UX L2000 server and all traffic to and
from the DB is local. The DB binds to
the actual IP address of lan0 (66.99.7.6) and
not local host.

Is this traffic going out onto the lan attached
to lan0 or just looping back locally from the
lan0 card?

Should the DB be forced to bind to the locahost
127.0.0.1 address to avoid sending traffic to
the lan0 card? Sending it to lan0 seems like
a waste if resources.

Can I modify the routing entry for the IP
address of lan0 so its gateway is lo0 and
not lan0 (like the good old days)?

Thanks,

Mark.
sven verhaegen
Respected Contributor
Solution

Re: Why is my localhost traffic showing up on lan0 stats?

ok I can see your point , however I would strongly disadvise trying to alter anything on the way this is done now in HP-UX 11 , I have not all the internal data but rest assured the fact the data is sent to 'the card' doesn't load it at all as this happen at SW level , it just takes the same time as it would with the loopback , the reason I am proposing not to touch the routing is the NetworkStack of HP-UX which has een extensive changes since 11.x , it is fully Streams based now and altough I don't know why they altered some of the stuff and why they impleemnted the routing table like this you can be sure that they had a very good reason for doing it , it probably would cause more harm to try and change it
...knowing one ignores a greath many things is the first step to wisdom...
M Wallis
New Member

Re: Why is my localhost traffic showing up on lan0 stats?

Sven,

I am in no hurry to change the routing - I just
wanted to discover what was going on and I
was concerned that my internal application was
now dependent on the LAN card performance and
availability.

Found a few interesting updates to the loopback
configuration with PATCH PHNE_26771 which
should re-introduce the old loopback routing
functionality back to to the base HP-UX11
release.

With the patch routing to a local IP address
should continue to work even if the LAN card
goes down

( SR number: 1653307850 ; Defect: JAGab20953 )
Routes disappear if interface is downed.
Resolution:
Leave a "loopback" route when taking down an
interface either by the ifconfig command
or from the device driver. This will
"allow" processes to keep working in
loopback even over an interface that is down.


I think this one offer another solution as it
will allow me to bind the application to a
virtual IP address assigned to lo0 and yet
have it accessible from the network.

Symptom:
IP addresses assigned to loopback interfaces (lo0:)
can not be reached from the network.
Defect Description:
HP-UX does not support virtual loopback
interfaces.
Resolution:
Added support for virtual loopback interfaces.
( SR number: 8606124808 ; Defect: JAGac40200 )

Thanks for taking a look,

Rgds,

Mark.