Networking on z/OS
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


Diagnostic TCP/IP commands

Networking on z/OS

Commands used to display TCP/IP and network information include NETSTAT, PING, and TRACERTE.

The following commands can be issued from an ISPF/TSO session. By omitting the TSO prefix, the same commands can be entered at a UNIX System Services prompt. However, the command must be in lower case. The UNIX command options for Netstat are shown in parentheses.
TSO NETSTAT ROUTE
Displays routing information (-r).
TSO NETSTAT HOME
Displays the home IP addresses for the IP stack (-h).
TSO NETSTAT DEV
Displays the device status for the defined network interfaces (-d).
TSO NETSTAT STATS
Displays performance statistics (-S).
TSO NETSTAT VIPADCFG
Displays dynamic VIPA configuration data (-F).
TSO NETSTAT SOCKETS
Displays sockets based on client name (-s).
TSO NETSTAT CONN
Displays information for all TCP/IP connections (-c).
Alternatively, these commands can be issued at the z/OS console using a syntax such as:
DISPLAY TCPIP,tcpproc,NETSTAT,ROUTE
Other commands that are available for network diagnostics (either from a ISPF/TSO environment or from UNIX System Services) are:
PING
This command can be very useful in determining whether IP connectivity exists. Excellent options are LENGTH and COUNT:
  • With LENGTH, you can try various packet sizes.
  • With COUNT, you can determine the number of times to execute the ping.

Note that this command uses ICMP ECHO packets–and some routers may be configured to not respond to ICMP ECHO requests. For this reason, a ping can fail in some instances when, for instance, a TCP connection might work fine.

TRACERTE
With this command you can find the last router a packet can reach in a disrupted network, or you can verify if packets flow over a planned route.

Figure 1 illustrates a sample of these commands placed into a batch job. The batch output can be kept for further analysis.

Figure 1. Statistics JCL
 //NETSTAT  JOB 1,REGION=0M                         
 //NETSTAT  EXEC PGM=IKJEFT01                       
 //SYSPRINT DD SYSOUT=*                             
 //SYSTSPRT DD DSN=hlq.NETSTAT.OUTPUT,DISP=SHR
 //SYSTERM  DD DUMMY                                
 //SYSTSIN  DD *
  NETSTAT CONFIG
  NETSTAT DEV
  NETSTAT ROUTE
  NETSTAT STATS
  NETSTAT BYTE
  NETSTAT SOCKETS
  NETSTAT CLIENT
  PING 127.0.0.1
 /*

Notice the program executed in this sample, IKJEFT01. IKJEFT01 executes in TSO, which means this NETSTAT command is really running in a batch TSO environment.

Figure 2 shows NETSTAT ROUTE command output.

Figure 2. NETSTAT ROUTE output
 Destination         Gateway          Flags     Refcnt  Interface  
 -----------         -------          -----     ------  ---------  
 Default             9.12.4.92        UGS       000001  OSA23A0LNK 
 9.12.4.0/23         0.0.0.0          US        000000  OSA23A0LNK 
 9.12.4.20/32        0.0.0.0          UH        000000  OSA23A0LNK 
 9.12.4.21/32        0.0.0.0          UH        000000  STAVIPA1LNK
 10.1.100.0/24       0.0.0.0          US        000000  IQDIOLNK0A016404 
 10.1.100.4/32       0.0.0.0          H         000000  EZASAMEMVS 
 10.1.100.4/32       0.0.0.0          UH        000000  IQDIOLNK0A016404 
Following is an explanation of the flags in the NETSTAT output.
Flag U
This flag indicates that the route entry is up and running or ACTIVE. If there is no U, then the route entry is defined but not active. This may be because the device is in a NOT ACTIVE status.
Flag G
This flag indicates that the route entry specifies an indirect route. That means the destination indicated on the route entry is behind a router from this z/OS system. If there is no G, then the route entry specifies a direct route. That means the destination indicated on the route entry is on the same local network.
Flag H
This flag indicates that the destination field in this route entry specifies a host route. That means this route is used only if the destination IP address of a datagram exactly matches all 32 bits (255.255.255.255) in the route entry destination field.

If there is no H, then the destination field in this route entry specifies a network route. That means this route is used only if the destination IP address of a datagram exactly matches all the network bits (less than 32 bits, for example, 255.255.255.0) in the route entry destination field.

Flag S
Indicates the route is a static route that cannot be replaced by a routing daemon (such as OMPROUTE).

Figure 3 shows the command output from a NETSTAT HOME command.

Figure 3. NETSTAT HOME output
 Home address list:                                
 Address          Link             Flg             
 -------          ----             ---             
 9.12.4.20        OSA23A0LNK       P               
 9.12.4.21        STAVIPA1LNK                      
 10.1.100.4       EZASAMEMVS                       
 10.1.100.4       IQDIOLNK0A016404                 
 10.1.100.4       EZAXCF47                         
 10.1.100.4       EZAXCF48 
 10.1.100.4       EZAXCF52         
 10.1.100.4       EZAXCF49         
 10.1.100.4       EZAXCF54         
 10.1.100.4       EZAXCF55         
 10.1.100.4       EZAXCF69         
 127.0.0.1        LOOPBACK 
Flag P
This flag indicates the link OSA23A0LNK is the primary interface. The primary interface can be significant for any applications that make a request to TCP/IP asking for the default IP address. This address is not used for routing purposes.

The interfaces beginning with EZAXCF all have the same IP address and represent various dynamic XCF links to other TCP/IP stacks running on other LPARs within the sysplex.





Copyright IBM Corporation 1990, 2010