1835255 Members
3858 Online
110078 Solutions
New Discussion

Re: tcpdrop for HP-UX

 
Richard Munn
Frequent Advisor

tcpdrop for HP-UX

I have a program called tcpdrop written for OSF (Tru64 UNIX) which forces a TCP connection to be closed. We use this to trigger an artifical connection failure to test that the two ends of a TCP connection recover properly without pulling the network down.

We now need to do the same thing for HP-UX but this is provinf to be a problem. Under OSF1 it pretty easy, you have access to various system tables with the table call and you can send it a control block with the IP addresses of the src/dst and the ports. A matching connection in the TCP stack will then receive the state action (i.e. delete) and the connections will be removed causing the connection to abruptly fail.

But I can't seem to find a similar interface on HP-UX.
6 REPLIES 6
Michael Steele_2
Honored Contributor

Re: tcpdrop for HP-UX

Refer to the 'ndd' and 'ifconfig' commands. You can up/down a lan or plumb/unplumb a lan with 'ifconfig' and 'ndd' has some disabling arguements that will down the network if a condition is detected. '-h' for help.

ndd -h supported
ndd -h unsupported

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90129/B2355-90129_top.html&con=/hpux/onlinedocs/B2355-90129/00/02/209-con.html&toc=/hpux/onlinedocs/B2355-90129/00/02/209-toc.html&searchterms=parameter%7cndd&queryid=20030728-183915

You might find 'tcpdump' or 'etheral' sniffers helpful, but these are suppose to be passive reporting utilities.

http://hpux.cict.fr/hppd/hpux/Networking/Admin/tcpdump-3.6.2/readme.html

Support Fatherhood - Stop Family Law
Richard Munn
Frequent Advisor

Re: tcpdrop for HP-UX

This looks promising. The unsupported tcp_discon looks a likely candidate but there is not help as to what other parameters go with this option (unless it is used to kill all connections which I don't want to so). Also I need to do this on a set 10.20 systems as well and I don't think ndd is available under 10.20 (???)
Tim Adamson_1
Honored Contributor

Re: tcpdrop for HP-UX

Hi Richard,

ndd was introduced in HP-UX 10.30. You just missed out. ndd replaced the nettune command. So have a look at netttune on 10.20.

Cheers!

Yesterday is history, tomorrow is a mystery, today is a gift. That's why it's called the present.
Ron Kinner
Honored Contributor

Re: tcpdrop for HP-UX

ndd equivalent on 10.20 is nettune (-l to list the options) but it doesn't have anything which could help you that I can see. lanadmin has an interface reset command which might drop the connection or you could try using lanadmin to changw the MAC on the fly. I suppose if the speed were set to 10 on both sides of the interface setting it to 100 would kill it.

ifconfig can be used to down the interface or even change its ip address.

Probably could do the same thing a lot easier by shutting down the port on the switch. Or by playing with a router that passed the packet.

Ron
Richard Munn
Frequent Advisor

Re: tcpdrop for HP-UX

OK I got the ndd suggestion sorted out on 11.11 and it works perfectly. Had a look at nettune on 10.20 but it does not seem to have anything that looks like the tcp_status or tcp_discon objects, unless it's not showing everything.
rick jones
Honored Contributor

Re: tcpdrop for HP-UX

Indeed, there is nothing even as unsupported as tcp_discon on 10.20, nor will there be any enhancements to 10.20. 11.11 and later is where things are happening now. 10.20 is officially off HP support at this point.

It sounds like you know what you are doing with the testing to deal with connection drop, but please do not get into the habit of using tcp_discon anywhere else. Some mis/abuse it to workaround their apps not setting SO_REUSEADDR.

A rather different possibility, and equally unsupported :) would be to use dummynet. That could be configured to introduce delays, packet losses, etc on a TCP connection. SMOP to make that connection-specific. ftp://ftp.cup.hp.com/dist/networking/tools/
there is no rest for the wicked yet the virtuous have no pillows