The ping Command Host Connectivity

The finger command on the host shows only the relevant lines are presented: finger Login Name TTY Idle When Where bjl B.J.L. pts10 3 Sat 14:29 rashost08.example.net ..... Keeping this command output in mind, the following script will extract the assigned DNS record it is equivalent to an IP address of the established dial−in connection, and launch the desired X−based application xnb on the users PC. cat xnb2pc binksh −p This script starts XNB session at the user PC Once the user connects via modem, and upon a successful authentication, an ip address is assigned to the established dial−in connection this address varies among different connections. To launch an XNB session the DISPLAY variable must be defined appropriately. The other requirement is a running Xterminal client on PC for example Exceed This line extracts corresponding DNS record; it cleans everything in the line in front of the DNS record, as well as all trailling spaces CONN = finger | grep rashost | grep bjl | sed −n 1p | sed s..rashostrashostg | sed s g export DISPLAY = {CONN}:0.0 The DISPLAY variable is specified Everything seems to be ready for the XNB launch usrxnbpathbinxnb −display DISPLAY

21.2 Host Connectivity

In a network, the essential condition is that the connectivity between hosts must be provided. It is obvious that without full host connectivity, none of the network applications can be accomplished. A break in the host connectivity is a very common cause for network application failure. Checking the host connectivity is also the most frequent, and usually the first step, in tracing problems related with network applications. UNIX provides a certain number of applicable commands for this purpose; two of them are ping and traceroute.

21.2.1 The ping Command

The ping command tests whether a remote host can be reached from the system where ping was activated. This simple function is extremely useful for testing network connections, and in determining whether further testing should be done. If ping shows that packets can travel to the remote host and back, the problem you seek to identify might be in the upper protocol layers; if packets cannot make the round−trip, lower protocol layers are probably at fault. The basic format of the ping command some variations are possible on different flavors is: ping hostname [packetsize] [count] 509 hostname The hostname or IP address of the remote host being tested. packetsize Defines the size in bytes of the test packets. The default is 56 bytes. count The number of packets to be sent in the test. Otherwise, ping continues to send test packets until you interrupt it usually with Ctrl−C; in most cases five packets should be sufficient for a test. Here is an example, ping−ing the host acf4.nyu.edu at the NYU campus from the host patsy.hunter.cuny.edu at the Hunter College campus: ping −s acf4.nyu.edu 56 5 PING acf4.nyu.edu: 56 data bytes 64 bytes from ACF4.NYU.EDU 128.122.128.14: icmp_seq = 0. time = 73.ms 64 bytes from ACF4.NYU.EDU 128.122.128.14: icmp_seq = 1. time = 61.ms 64 bytes from ACF4.NYU.EDU 128.122.128.14: icmp_seq = 2. time = 79.ms 64 bytes from ACF4.NYU.EDU 128.122.128.14: icmp_seq = 3. time = 89.ms 64 bytes from ACF4.NYU.EDU 128.122.128.14: icmp_seq = 4. time = 70.ms −−−−ACF4.NYU.EDU PING Statistics−−−− 5 packets transmitted, 5 packets received, 0 packet loss round−trip ms minavgmax = 617489 The −s option is included for the SunOSSolaris flavors to display packet−by−packet statistics. Other ping implementations do that by default. If the packet loss is high, or the response time is very slow, or packets are arriving out of order, then there could be a network problem. If this happens on a wide area network, there is nothing to worry about. TCPIP is designed for unreliable networks, and some wide area networks suffer a lot of packet loss. On a local area network, however, that indicates some trouble. In a high throughput local network, or a network with few routing steps also known as hops, the round−trip time should be near zero; there should be no or small packet loss, and the packet should arrive in order. If these parameters are not met, there is a problem with the network resources. The most frequent problems are: improper cable termination, a bad cable segment, or a bad piece of active hardware such as repeater, bridge, hub, switch, or transceiver. If this is a case, further testing and searching for problem could be directed to those areas. When the ping testing completely fails, ping displays an error message, such as: −unknown host The remote host cannot be resolved by name service; try to ping with a hosts IP address to locate the problem. −network unreachable The local system does not have a route to the remote system; try again and after that, look at the routing table and default gateway. Ping−ing takes some time, especially if a designated host is not reachable; ping retries multiple times with the host, waiting for a response until timeout occurs. This is why some flavors also includes a fast−ping command etcfping, which tries only once and generates a corresponding response. The main advantage of the ping command is that it relies on lower ISO OSI model layers physical, data link, and network, and in that way could make a sharp distinction between the host connectivity and problems on higher layers transport, session, presentation, or application. ping is using ICMP protocol Internet control message protocol, and it makes it completely independent of the TCPIP stack so typical for all network applications. Briefly, ping can only address a host, and check the connectivity with the specified host; there is no way to check an application by using 510

21.2.2 The traceroute Command