User`s guide

KwikNet Low Level Services
K
A
DAK
133
4.4 ICMP Protocol
KwikNet includes support for the subset of Internet Control Message Protocol (ICMP)
services it needs for proper operation of any of the protocols which can be utilized with
KwikNet and are dependent on ICMP.
KwikNet does not issue or reply to timestamp or information requests.
KwikNet supports ICMP destination unreachable datagrams. If such a datagram is
received, KwikNet updates its routing tables to reflect the fact that the specified destination
has been declared unreachable through a particular network interface. If KwikNet discards
an IP datagram because it cannot be handled properly, an ICMP destination unreachable
message is sent to the host from which the rejected IP datagram was received.
If you are using the KwikNet SNMP Agent, KwikNet maintains counts of the various ICMP
datagrams which it sends and receives. These ICMP statistics can be accessed within the
MIBs managed by the SNMP Agent.
ICMP and Raw Sockets
Your application can use the Treck raw sockets API to read ICMP echo requests and
ICMP address mask requests. Your application will receive a duplicate of the received
packet. You must not issue a reply because KwikNet will have already done so.
This feature is enabled by a configuration parameter in the KwikNet Network Parameter
File used in the construction of the KwikNet Library as described in Chapter 2.3. When
you define your KwikNet configuration, simply check the option box labeled "Receive
ICMP datagrams via raw sockets
" in the Sockets region of the TCP property page.
Using PING
KwikNet always replies to an ICMP echo request (a PING) with an ICMP echo reply. You
can use the Treck raw socket API to read these PING requests.
Treck provides a separate PING service which you can use to initiate the sending of
periodic PINGs (ICMP echo request datagrams) to a specific foreign host. You access
this service using the PING API described in Chapter 6 of the Treck TCP/IP User
Manual.