home *** CD-ROM | disk | FTP | other *** search
- ;*************************************************************************
- ;** **
- ;** PDCLKSET **
- ;** **
- ;** **
- ;** Copyright (C) 1991 Jan.Engvald @ LDC.lu.se **
- ;** **
- ;** This program is free software; you can redistribute it and/or modify**
- ;** it under the terms of the GNU General Public License as published by**
- ;** the Free Software Foundation, version 1. **
- ;** **
- ;** This program is distributed in the hope that it will be useful, **
- ;** but WITHOUT ANY WARRANTY; without even the implied warranty of **
- ;** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
- ;** GNU General Public License for more details. **
- ;** **
- ;** You should have received a copy of the GNU General Public License **
- ;** along with this program; if not, write to the Free Software **
- ;** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **
- ;** **
- ;*************************************************************************
- ;** USING PDCLKSET TO SET THE PC SOFTWARE CLOCK **
- ;*************************************************************************
- ;** **
- ;** PDCLKSET sets the time and date of the PC clock using a TIME server.**
- ;** To do so, the following information is required: **
- ;** **
- ;** - This clients unique IP number. **
- ;** - The IP number of an UDP/IP time server (most Unix systems). **
- ;** - The time zone offset from UTC (GMT) at this place. **
- ;** - If daylight saving (summer) time is used, which algorithm to use. **
- ;** **
- ;** All the above info can be supplied as arguments to PDCLKSET. If any **
- ;** of the first three are missing, it will send a BOOTP request to try **
- ;** to find the missing info. If you are not using BOOTP you probably **
- ;** must use gateway and mask arguments too. Except for client IP number**
- ;** and network mask, arguments to PDCLKSET override BOOTP info. **
- ;** Using a BOOTP server is highly recommended, freeware code exists **
- ;** for Unix systems and MSDOS PCs. **
- ;** **
- ;** BOOTP can not supply which dst algorithm to use; also, zone offset **
- ;** can't always be trusted. So, in practice, zone offset and dst algo- **
- ;** rithm (if applicable) are required arguments. On the other hand, **
- ;** these parameters will stay the same all around the year, no need to **
- ;** change the setup. **
- ;** **
- ;** If PDCLKSET finds more than one time server (sum of arguments and **
- ;** BOOTP fields) and the first one does not answer, it will try the **
- ;** other servers. The same applies for gateways. **
- ;** **
- ;** It is very hard to get accurate info on all the dst algorithms used **
- ;** all over the world, so the one you choose, you should test out. Use **
- ;** the alter argument to add or subtract time and days, and check that **
- ;** the dst switch occurs correctly. When using the alter argument, the **
- ;** date and time is displayed as usual, but the PC clock is not set. **
- ;** If you find any errors, mail me the correct info to my mail address **
- ;** below. If you want to, you can customize your own dst algorithm, **
- ;** see detailed info below. **
- ;** **
- ;** PDCLKSET talks to the network card via a packet driver. If you have **
- ;** more than one packet driver, it will use the first one (lowest **
- ;** packet interrupt number) unless you use the pktintno argument. **
- ;** If you use a NDIS (LanManager) or ODI driver with your LAN card you **
- ;** can still use PDCLKSET, just load DIS_PKT or ODIPKT on top of your **
- ;** driver (available in pub/msdos/pktdrvr on many ftp archives). **
- ;** I have only tested PDCLKSET with Ethernet or Ethernet simulating **
- ;** packet drivers. I have one report that it works with S&K FDDI **
- ;** interfaces, if so it should work for token ring too, but I've got **
- ;** no confirmation on that. **
- ;** **
- ;** Running through remote bridges or slip links may require longer **
- ;** than default timeouts. Add the number of extra seconds you need **
- ;** with the argument LongerTimeout= time. **
- ;** **
- ;** If you want to omit the "End of pdclkset..." msg, add Flag=128 **
- ;** **
- ;** In AUTOEXEC.BAT you should first load the packet driver, then call **
- ;** PDCLKSET. It is very small (14 kbyte) and executes fast, so you will**
- ;** not notice any delay. PDCLKSET is not memory resident and does not **
- ;** use any CONFIG.SYS devices, so no memory is wasted. Use TERMIN.COM **
- ;** if you want to unload the packet driver. See call syntax below. **
- ;** Note: If you always log into a Novell server after a boot, you **
- ;** don't need this program, the PC clock will be set from the server. **
- ;** However, if you are the supervisor, use PDCLKSET+SRVTIME to set it **
- ;** (available at msdos.ftp.sunet.se:pub/network/novelutl/srvtime). **
- ;** **
- ;*************************************************************************
- ;** USING PDCLKSET TO SET A TIMEZONE VARIABLE **
- ;*************************************************************************
- ;** **
- ;** PDCLKSET can also assign the proper normal or dls timezone name to **
- ;** an environment variable (TZ is used by most systems). Argument **
- ;** "Zone= #" will assign numeric zones to TZ (like TZ=+0100). If you **
- ;** want anything else, use the alternative syntax, e.g. **
- ;** "Zone= tzone=MET,METDST" will set TZONE=MET or METDST. **
- ;** **
- ;*************************************************************************
- ;** SYNTAX AND EXAMPLES FOR TIMESETTING **
- ;*************************************************************************
- ;** **
- ;** (time is [- | +] [<hours>h] [<minutes>m] [<seconds>[s]] ) **
- ;** **
- ;** pdclkset (displays a usage message) or **
- ;** **
- ;** pdclkset b[ootp] (only if dst not used) or **
- ;** **
- ;** pdclkset [o[ffset]=time] **
- ;** **
- ;** [d[aylightsave]=PAC | USA | CUB | CHIL | BRZ | GBR | **
- ;** W_EU | M_EU | E_EU | LIBY | EGY | TURK | **
- ;** ISR | IRAN | PRC | ROK | AUS | TASM | **
- ;** NSW | LHI | NZE | **
- ;** FrTime,FrWeekDay,FrDayOfYear, **
- ;** ToTime,ToWday,ToDayOfYr,AddTime] **
- ;** **
- ;** [z[onename]= # | varible=normalname,dlsname **
- ;** **
- ;** [i[pnr]=n.n.n.n] [t[imservers]=n.n.n.n[,n.n.n.n[,...]]] **
- ;** **
- ;** [m[ask]=n.n.n.n g[ateways]=n.n.n.n[,n.n.n.n[,...]]] **
- ;** **
- ;** [p[ktintno]=hexnr] [a[lter]=days,time] [f[lags]=flagnr] **
- ;** **
- ;** [l[ongertimeout]=time] **
- ;** **
- ;** **
- ;** All arguments to pdclkset must be on the same line, no continuation.**
- ;** For arguments to BAT files, use ":" instead of "=" and ";" instead **
- ;** of "," . **
- ;** **
- ;** Valid flags for this mode: **
- ;** 128 = half quiet (skip the End of pdclkset line if no errors) **
- ;** **
- ;** Examples: **
- ;** **
- ;** pdclkset o= -1h d=M_EU z=# (my IP nr and timeserver(s) from BOOTP)**
- ;** **
- ;** pdclkset offs=6h dst=USA zonename= tz=CST,CDT (sets TZ=CST or CDT) **
- ;** **
- ;** pdclkset o=8h d=PAC ip=123.45.6.7 ts=123.45.6.8 (BOOTP not used)**
- ;** **
- ;** pdclkset o=-9h30m t=1.2.3.4 i=2.3.4.5 g=2.3.4.1 m=255.255.255.0 **
- ;** **
- ;** **
- ;** Part of an AUTOEXEC.BAT file may look like this: **
- ;** **
- ;** \net\smc_wd -w 0x7c 3 0x280 0xd000 (install packet driver) **
- ;** \net\winpkt 0x7c (install winpkt driver) **
- ;** \net\pdclkset o=-1h d=M_EU z=# (set PC clock and TZ) **
- ;** **
- ;** If you don't want to keep the paket drivers in memory, add the **
- ;** following line: **
- ;** **
- ;** \net\termin 0x7c (remove packet drivers) **
- ;** **
- ;** If you just need timesetting, use pdclksml instead of pdclkset. **
- ;** **
- ;*************************************************************************
- ;** USING PDCLKSET FOR NETWORK TESTING (PING/ECHO) **
- ;*************************************************************************
- ;** **
- ;** There is also a buildt in ping client and server. If you just want **
- ;** to enable the server, add a "flag=1" argument and the PDCLKSET **
- ;** termination will be delayd and it responds to incoming pings until **
- ;** you hit any key. If you want to send pings, use the echo argument. **
- ;** When you then hit any key, it stops sending but still collects **
- ;** responses. It terminates when hiting a second key (there may be a **
- ;** delay to ensure all responses have arrived first). When pinging, **
- ;** it displays real time statistics on delay and error rate (nice!). **
- ;** PDCLKSET sets the hardware timer to enable millisecond accurate **
- ;** timing; if your PC does not like this (e.g. SoftPC for Mac), add **
- ;** argument "flag=16". **
- ;** **
- ;** A typical ping call look like: **
- ;** **
- ;** pdclkset echo=ping.lu.se,34,256 **
- ;** **
- ;** The display will look like this: **
- ;** **
- ;** Calling nameserver(s)... got reply in 115 ms. **
- ;** **
- ;** Ping with packet size 34 and interval 256 ms to 130.235.128.100: **
- ;** **
- ;** ------ Packets ------ | --- Delay ms --- | Packet | Load | Time **
- ;** transmit receive diff | this min avg max | loss | kb/s | s **
- ;** 187 184 3. 87 27 36 517 1.6042 % 5 41 **
- ;** **
- ;** **
- ;** You can use IP packet sizes from 34 to 1500. If you use a **
- ;** negative size, it will sweep packet sizes from 34 up to abs(size) **
- ;** and unless you hit ESC at termination an error size distribution **
- ;** table is displayd. You can then see if packets are lost randomly or **
- ;** in bursts or if there is a pattern, like odd or big sizes. (Only **
- ;** sizes 34 and up are used, but the number of out of sequence packets **
- ;** are indicated in the size 22 position, the number of repeated **
- ;** packets in the size 24 position and the number of lost packets are **
- ;** in the size 26 position.) Using the minsize parameter you can sweep **
- ;** a certain range, e g echo=host,-1500,128,1,1,1400 will sweep from **
- ;** size 1400 up to size 1500 bytes. **
- ;** While a few network errors only show up at a certain size, the **
- ;** default 34-50 sweep is good in most cases and does not load links **
- ;** unnecessarily. Sweeping is very effective for detecting queue **
- ;** limits in routers and bridges, but then you should sweep up to at **
- ;** least size 600 and with only a few milliseconds interval. **
- ;** **
- ;** The ping packet data is by default starting at 0x101 and incremented**
- ;** by one for each word in the packet. Using the optional data and inc **
- ;** fields you can fill with other values, like 0,0 or 0xffff,0 which **
- ;** are useful for WAN modem link tests. **
- ;** **
- ;** Packets are transmitted at a constant rate depending on interval, **
- ;** which can be from 0 and up to 28000. The interval unit is now 1.0 **
- ;** milliseconds (Note: ver 1.33 had 55 ms units!). To get a finer **
- ;** interval grain, you may use a decimal point and one decimal digit. **
- ;** This way you can get intervals from 0.0 up to 3500.0 ms, and the **
- ;** inteval unit is rather close to 0.1 ms. As a safety for accidental **
- ;** loading, if you wan't intervals less than 128 ms you must add a **
- ;** Flag=1 argument. The default interval is 220 ms. **
- ;** **
- ;** When pinging in a wide area network environment, watch the load **
- ;** figure not to overload slow links (showing the load caused by this **
- ;** ping activity + server activity + broadcasts, and calibrated for **
- ;** half duplex media such as Ethernet or LocalTalk). It requires just **
- ;** a 20 MHz 386 to load an Ethernet to 9.9 Mb/s! The document **
- ;** "Measured Capacity of an Ethernet: Myths and Reality" by Boggs, **
- ;** Mogul and Kent, available at gatekeeper.dec.com in directory **
- ;** pub/DEC/WRL/research-reports as file WRL-TR-88.4.ps.Z, is a good **
- ;** source to read to understand how Ethernet behaves at such loads. **
- ;** **
- ;** The destination host must run IP and you can use its IP number or **
- ;** its domain name if you have a name server. **
- ;** **
- ;** Diff is the difference between sent and received packets, and if **
- ;** not zero either packets are lost or are in transit. If there are **
- ;** network errors, watching how receive and diff increments tell you **
- ;** how the errors are distributed in time (temporary total blocking or **
- ;** just random drops) down to tenths of a second (very useful!). **
- ;** Blocking indicates serious errors, else it can be just high load. **
- ;** **
- ;** If there turns up a number between packets received and diff, it is **
- ;** the number of packets dropped due to no buffers available. This can **
- ;** occur if the ping server is not as fast as the ping client and it **
- ;** uses sub-millisecond intervals. **
- ;** **
- ;** If there turns up an apostrophe, double music note or dot after the **
- ;** diff value, it indicates that packets have returned out of sequence **
- ;** (may occur if there are multiple routes to the destination), been **
- ;** duplicated or lost, respectively. Apostrophe + dot combine to **
- ;** exclamation mark. You can see the number of each error in the **
- ;** size 22/24/26 error distribution. **
- ;** **
- ;** The delay values are useful to characterize link loads. After a **
- ;** while, the min value approaches the delay on an unloaded link. If **
- ;** the average value is significantly higher, the link is loaded. If **
- ;** the max value is significantly higher than the avg value, the load **
- ;** is bursty. The "this" field shows the current delay. **
- ;** **
- ;** Packet loss is simply 100*diff/transmit, when you have stopped **
- ;** pinging. During the pinging, however, there can be many packets in **
- ;** transit giving a non-zero diff. So instead the packet loss is **
- ;** computed using an intelligent algorithm that can compensate for **
- ;** long turnaround delays and most out of sequence cases. **
- ;** **
- ;** If the host you are pinging don't drop packets (many do, a 386 with **
- ;** PDCLKSET doesn't), the packet loss as a symptom of network health **
- ;** is as follows: **
- ;** **
- ;** 0.01 % or less : your network is most probably healthy. **
- ;** 0.01 % to 0.1 % : there are some minor faults but nobody will **
- ;** notice any delays. **
- ;** 0.1 % to 1 % : you will notice delays more or less often. **
- ;** 1 % or more : frequent delays, very annoying. **
- ;** **
- ;** Some packet drivers, like smc_wd.com, give 0.0000 % lost packets on **
- ;** a healthy network. This enables you to trace beginning component **
- ;** degradation (oxidizing contacts, drifting IC circuits, etc) long **
- ;** before they cause any trouble to real traffic. **
- ;** **
- ;** The display is updated five times a second. To avoid unpleasant **
- ;** value flickering, when a packet is just sent, diff is temporarily **
- ;** one less than it should be. When a packet has arrived it is back to **
- ;** normal. All values (except the "this" and the load values) are **
- ;** accumulated or averaged during the complete time since pdclkset was **
- ;** last started. The time field tells you this elapsed time. **
- ;** **
- ;** Using udpecho= instead of echo= will send UDP echo instead of icmp **
- ;** echo (ping) packets. Add flag=64 if you want UDP discard packets, **
- ;** useful for saturated bottleneck throughput measurements. **
- ;** **
- ;** Argument f=1 will continue sending despite some send errors. **
- ;** **
- ;** If you don't run a BOOTP server, the i= (and n=) arguments are **
- ;** needed and also m= and g= if any traffic goes through a router. **
- ;** **
- ;** **
- ;** Syntax: **
- ;** **
- ;** pdclkset e[cho]= name | n.n.n.n [,size[,interval[,data,inc[,min]]]] **
- ;** **
- ;** [i[pnr]=n.n.n.n] [n[ameservers]=n.n.n.n[,n.n.n.n[,...]]] **
- ;** **
- ;** [m[ask]=n.n.n.n g[ateways]=n.n.n.n[,n.n.n.n[,...]]] **
- ;** **
- ;** [p[ktintno]=hexnr] [f[lags]=flagnr] **
- ;** **
- ;** [l[ongertimeout]=time] **
- ;** **
- ;** u[dpecho]= name | n.n.n.n [,size[,intrvl[,data,inc[,min]]]]**
- ;** **
- ;** Valid flags for server mode (no echo= or udpecho= argument): **
- ;** 1 = Ping/Echo server (delay termination) **
- ;** 16 = Not enough IBM compatible PC, use DOS interrupts **
- ;** 128 = half quiet (skip the End of pdclkset line) **
- ;** 512 = Stress the packet driver using upcall sends for ping serv **
- ;** 4096 = Allow frame size up to 4096 (IP size 4082 bytes) **
- ;** **
- ;** Valid flags for client mode (echo= or udpecho= arguments): **
- ;** 1 = Allow short (<128 ms) intervals; also continue despite errs **
- ;** 16 = Not enough IBM compatible PC, use DOS interrupts **
- ;** (32 = Use 0.1 ms interval unit instead of 1.0 ms) **
- ;** 64 = For udpecho= argument, send discard instead of echo packets **
- ;** 128 = half quiet (skip the End of pdclkset line) **
- ;** 512 = Stress the packet driver using upcall sends for ping serv **
- ;** 1024 = Stop if duplicated, lost or nonconsecutive packets seen **
- ;** 4096 = Allow frame size up to 4096 (IP size 4082 bytes) **
- ;** **
- ;** **
- ;** Examples: **
- ;** **
- ;** pdclkset echo= nic.ddn.mil (ping client, auxilary info from BOOTP) **
- ;** **
- ;** pdclkset e= 1.2.3.4 i= 2.3.4.5 g= 2.3.4.1 m= 255.255.255.0 **
- ;** **
- ;** pdclkset echo= host.on.this.net ip= 111.22.33.4 ns= 111.22.33.5 **
- ;** **
- ;** pdclkset udpecho= ping.lu.se (UDP echo client) **
- ;** **
- ;** pdclkset flags= 1 (ping and UDP echo server) **
- ;** **
- ;** pdclkset flags= 1 ip= 2.3.4.5 g= 2.3.4.1 m= 255.255.255.0 **
- ;** **
- ;*************************************************************************
- ;** USING PDTBUILD TO GENERATE TABLES WITH ALL IP HOSTS **
- ;*************************************************************************
- ;** **
- ;** The PDTBUILD program, which is included in the ZIP package, looks **
- ;** at all ARP broadcasts and generates a table with all the IP hosts **
- ;** on this (sub)net. Each entry has IP number, Ethernet address and **
- ;** host name, the latter which it asks a name server for. Two files **
- ;** are generated, IPTBL.TXT and HWTBL.TXT, which are suitable as input **
- ;** to LANwatch or a LANalyzer or other monitors. It should preferably **
- ;** be run for a complete day or longer. When started, if IPTBL.TXT **
- ;** exists it will read it in and update with what it sees on the net. **
- ;** It can handle up to 4094 hosts. Use BIGSORT for sorting (available **
- ;** from oak.oakland.edu:pub/msdos/textutl) **
- ;** **
- ;** In the comment field, an A means authorative answer, N is non- **
- ;** authorative answer from nameserver. 0 means host not registered **
- ;** for reverse lookup (in-addr.arpa domain). - means name not found. **
- ;** < and = denotes Ethernet duplicates for same IP address. >, = and + **
- ;** denotes IP duplicates for same Ethernetaddress (+ is used for a **
- ;** gateway pdclkset know of). The last number on each line is how many **
- ;** ARP broadcasts we have seen from this address (so BIGSORT /R /+71 **
- ;** will sort the most used hosts first). **
- ;** **
- ;** You can speed up address collection by adding flag=8. This will **
- ;** start ARP probing, a process that cycles through all IP addresses in**
- ;** the (sub)net and sends an ARP request for each address. The speed **
- ;** is 9 ARP requests per second, slowing down to two per second when **
- ;** nameserver requests are needed. It is rather successful in ignoring **
- ;** ARP replies from proxy ARP gateways (otherwise it would table a lot **
- ;** of fake hosts). Be careful with ARP probing, some programs (eg KA9Q **
- ;** NET) may be hard to start when sprayed with ARP broadcasts. **
- ;** **
- ;** You can run echo (ping) in parallell with tablebuilding (and the **
- ;** ARP probing), although the screen display is somewhat garbled. If **
- ;** you don't ping, the display will show the accumulated number of ARP **
- ;** broadcasts and the time of day; also the current ARP probe IP addr. **
- ;** **
- ;** If you don't run a BOOTP server, the i= and n= arguments are needed **
- ;** and also m= and g= if the nameserver is behind a router. **
- ;** **
- ;** The tblbuild code is a quick hack, undocumented, but works for me. **
- ;** Pdtbuild includes all the functionality of pdclkset. **
- ;** **
- ;** Syntax: **
- ;** **
- ;** pdtbuild f[lags]=flagnr **
- ;** **
- ;** [i[pnr]=n.n.n.n] [n[ameservers]=n.n.n.n[,n.n.n.n[,...]]] **
- ;** **
- ;** [m[ask]=n.n.n.n g[ateways]=n.n.n.n[,n.n.n.n[,...]]] **
- ;** **
- ;** [p[ktintno]=hexnr] [l[ongertimeout]=time] **
- ;** **
- ;** Valid flags for table building mode: **
- ;** 2 = Enable table building (required for this mode) **
- ;** 4 = Use LANwatch table syntax instead of LANalyzer syntax **
- ;** 8 = Use IP nr probing **
- ;** 16 = Not enough IBM compatible PC, use DOS interrupts **
- ;** 128 = half quiet (skip the End of pdclkset line) **
- ;** 256 = Write fixed length IP numbers (good for sorting) **
- ;** **
- ;** **
- ;** Examples: **
- ;** **
- ;** pdtbuild flags= 2 i=2.3.4.5 n=2.3.4.6 (LANalyzer table builder) **
- ;** **
- ;** pdtbuild flags= 2 i=2.3.4.5 n=1.2.3.4 g=2.3.4.1 m=255.255.255.0 **
- ;** **
- ;** pdtbuild flags= 2+4+256 (LANwatch table builder, sort compatible) **
- ;** **
- ;** pdtbuild flags= 2+8 (table building with probing) **
- ;** **
- ;*************************************************************************
- ;** HISTORY **
- ;*************************************************************************
- ;** **
- ;** Ver 0.85: Beta release. **
- ;** **
- ;** Ver 1.02: First official release. **
- ;** Removed 386-only instructions. Numerous minor changes. **
- ;** Corrected the Pacific daylight algorithm. **
- ;** **
- ;** Ver 1.10: Selected release with support for one gateway. **
- ;** **
- ;** Ver 1.27: Major rewrite of the UDP/IP library to make it mostly RFC **
- ;** compliant. Multi gateway and multi timeserver support. **
- ;** Fixed hangs on argument syntax errors. **
- ;** Added comments and documentation to the code. **
- ;** Added ping server and client function. **
- ;** **
- ;** Ver 1.28: Added fragment reassembly. **
- ;** Added PDTBUILD application to automatically generate **
- ;** hardware and IP tables by watching network traffic. **
- ;** **
- ;** Ver 1.29: Added SQID (Source Quench Introduced Delay) **
- ;** All time compares changed to js/jns instead of jl/jge, **
- ;** avoiding wrong handling once every hour. **
- ;** **
- ;** Ver 1.30: Added timezone environment variable handling (SET TZ=...).**
- ;** Timeserver not needed to ping or build tables. **
- ;** **
- ;** Ver 1.31: Ping delays now millisecond accurate. **
- ;** **
- ;** Ver 1.32: Corrected check on illegal ping packet size. **
- ;** Ping display cleaned up and overhead reduced. **
- ;** Corrected BufAlloc error when out of buffers. **
- ;** **
- ;** Ver 1.33: Fixed PDTBUILD error when not tablebuilding. Ping **
- ;** enhancements: Time server not needed, added elapsed ping **
- ;** time field, send error messages displayed. **
- ;** **
- ;** Ver 1.34: Made a table for arg decode. Negative ping size will now **
- ;** sweep from 28 up to abs(size). Also odd sizes work. **
- ;** Added code in AdjTo16bits to avoid divide overflow. **
- ;** **
- ;** Ver 1.35: Made performance improvements. A 386SX with 16-bit WD **
- ;** card can now handle 2000 pkts/s short packets (send + **
- ;** receive) or load to 7 Mb/s (long packets). Echo interval **
- ;** is now in units of milliseconds (actually 0.858 ms) **
- ;** instead of 55 ms ticks. Added traffic load field in the **
- ;** display. Added several debug checks. **
- ;** **
- ;** Ver 1.36: Made documentation changes for the above new features. **
- ;** **
- ;** Ver 1.37: Added domain name resolver for ping. Corrected a bug in **
- ;** fragment reassembly. Changed length input to SendUdpPkt. **
- ;** Found bug preventing inactivity timeout for remote hosts. **
- ;** **
- ;** Ver 1.38: TblBuild redesigned to be able to detect both IP and **
- ;** hardware address duplicates. Corrected a bug when out of **
- ;** buffers trying to send unreachables. **
- ;** **
- ;** Ver 1.39: TblBuild enhanced with an active probe function to speed **
- ;** up address collection. **
- ;** **
- ;** Ver 1.40: udpecho= will send udp echo instead of icmp echo packets. **
- ;** Flag=1 will continue sending despite of send errors. **
- ;** Fixed bug limiting pdtbuild to 2047 hosts, now 4094. **
- ;** Added test on no nameserver when nameservers needed. **
- ;** Fixed sometimes inaccurate "active this run" in pdtbuild. **
- ;** **
- ;** Ver 1.41: Added LongerTimeout= argument to run on slow links. **
- ;** **
- ;** Ver 1.42: Fixed IS_386 wrongly set for 8088/8086 (bug introduced in **
- ;** ver 1.35 caused hangs or bad checksum on PC XTs). **
- ;** **
- ;** Ver 1.43: Try to handle the case with high speed CPUs overflowing **
- ;** some network cards or packet drivers. **
- ;** **
- ;** Ver 1.44: Show in front of diff the packets dropped due to no bufs. **
- ;** Server mode now displays packets and load statistics. **
- ;** With flag=32 the interval is in units of 0.1 ms. **
- ;** With flag=64 udp= will send discard packets. **
- ;** **
- ;** Ver 1.45: Fixed display of junk characters if the time server IP **
- ;** had all 12 digits in the "Clock set to ..." message. **
- ;** **
- ;** Ver 1.46: Added Flag=128 to suppress "End of pdclkset" message. **
- ;** **
- ;** Ver 1.50: Enhanced Flag= documentation. Flag=256 zero fills IP **
- ;** numbers to fixed length suitable for sorting. Nicer **
- ;** display when tablebuilding. The tables now shows the **
- ;** number of ARP requests from each host so you can sort on **
- ;** the most important hosts. Subdirectory for source code. **
- ;** **
- ;** Ver 1.51: Increased stacksize to fix some pdtbuild hangs, also **
- ;** always check stack overflow. Make ";" equivalent to "," **
- ;** (useful for BAT-file arguments, ":" is equiv to "="). **
- ;** Flag=512 will cause sends during packet driver upcalls **
- ;** in server mode (to see if the driver can handle it). **
- ;** **
- ;** Ver 1.52: Count the number of out of sequence, repeated or lost **
- ;** packets. Flag=1024: stop sending after above errors. **
- ;** Change size default to -50, giving a 34-50 size sweep. **
- ;** **
- ;** Ver 1.53: Fixed so that undefined send errors dont print garbage. **
- ;** **
- ;** Ver 2.00: Increased number of full size buffers from 27 do 300+ by **
- ;** converting all the code to use far addresses for buffers. **
- ;** The above change needed for ping servers on a VERY loaded **
- ;** network, where I've now seen up to 160 buffers in the **
- ;** send queue waiting for collisions to finnish. Packet loss **
- ;** computed differently during pinging to give a more stable **
- ;** value at long delays. Ping throughput up by 10 - 20 % by **
- ;** removing instructions and change register usage and **
- ;** enhance the checksum routine. Lots of small changes. The **
- ;** code change may have introduced bugs. There is definitely **
- ;** one in tablebuilding. Flag=4096 enables IP sizes up to **
- ;** 4082 (for Token Ring). Fixed a bug that gave a not **
- ;** completely correct port or protocol unreachable packet. **
- ;** Added a min-size parameter for size sweeping. **
- ;** Added a lot of useful debug code. **
- ;** **
- ;** ver 2.01: Found the tablebuilding bug. The source code restructured **
- ;** to appear in a more logical order. DOS interrupt bottle- **
- ;** necks replaced, giving a 40 % throughput increase! The **
- ;** code is now 100% MAC hardware address length independent. **
- ;** Interval may now have a decimal point and digit. Added **
- ;** special handling for true SLIP and Token Ring (untested, **
- ;** no source routing). Moved the EchoDisplay calls to **
- ;** Somethig2Do, giving a more stable and accurate load **
- ;** figure. Source quench code now use millisecond instead of **
- ;** tick resolution, giving a more even load. **
- ;** **
- ;** ver 2.02: Made documentation changes for the above 2.x features. **
- ;** **
- ;** ver 2.03: Fixed server mode bug causing divide overflow or hangs. **
- ;** **
- ;** ver 2.04: Changed default echo interval to equal display interval, **
- ;** giving better display rythm. Echo interval algorithm **
- ;** changed to be more accurate and CPU speed independent. **
- ;** Fixed tablebuild bug causing display not always updated. **
- ;** **
- ;** ver 2.05: Changed buffer allocation to leave room for COMMAND.COM **
- ;** so you can recall the previous command with the F3 key. **
- ;** **
- ;** ver 2.06: Fixed a hang that could occur after a long while running **
- ;** ping client or server. **
- ;** **
- ;** ver 2.07: Ping display line was not advanced after other print. **
- ;** **
- ;*************************************************************************
- ;** ACKNOWLEDGMENTS **
- ;*************************************************************************
- ;** **
- ;** The checksum routine used is a modified NCSA Telnet version. **
- ;** The dst algorithm was modelled after PCIP SETCLOCK (thanks Drew!), **
- ;** but enhanced to use parameters from a table. **
- ;** The dst algorithm table was derived from a comp.sources.unix 1989 **
- ;** posting by ado@ncifcrf.gov of localtime.c and related routines **
- ;** and tables, and a later update (very useful data, thanks!). **
- ;** The master environment is found using Pat's code. **
- ;** The millisecond timer is based on code from Dean Pentcheff. **
- ;** The DateTimeCalc routine is my own invention. **
- ;** The packet driver interface routines were copied from the Crynwr **
- ;** packet driver distribution, without which this project would not **
- ;** have been possible (thanks Russ!). **
- ;** **
- ;** The small UDP/IP library was written by me, and can probably be **
- ;** used in other small assembler applications. It is now fully RFC **
- ;** compliant, except for a few small cases mentioned in the code. It **
- ;** DOES handle IP type of service, fragment reassembly, source quench **
- ;** throttling, sending port and protocol unreachables, multiple **
- ;** default gateways, etc. **
- ;** **
- ;*************************************************************************
- ;** WHERE TO GET IT FROM **
- ;*************************************************************************
- ;** **
- ;** Current version of PDCLKSET can be obtained by anonymous FTP from **
- ;** ftp.lu.se:/pub/network/pdclkset/pdclkxxx.zip or from **
- ;** msdos.ftp.sunet.se:pub/network/pdclkset/pdclkxxx.zip or from Novell **
- ;** server LUSTORFS/ARC:PUB\NETWORK\PDCLKSET\PDCLKxxx.ZIP **
- ;** (Netware access only in Lund and around). **
- ;** Major releases will also be available on the Simtel20 archive and **
- ;** its mirror sites (like oak.oakland.edu, wuarchive.wustl.edu and **
- ;** ftp.funet.fi) in the msdos.pktdrvr directory. **
- ;** **
- ;* *
- ;* Jan Engvald, Lund University Computing Center *
- ;* ____________________________________________________________________ *
- ;* Address: Box 783 E-mail: Jan.Engvald@ldc.lu.se *
- ;* S-220 07 LUND Earn/Bitnet: xjeldc@seldc52 *
- ;* SWEDEN (Span/Hepnet: Sweden::Gemini::xjeldc) *
- ;* Office: Soelvegatan 18 VAXPSI: psi%2403732202020::xjeldc *
- ;* Telephone: +46 46 107458 (X.400: C=se; A=""; P=Sunet; O=lu; *
- ;* Telefax: +46 46 138225 OU=ldc; S=Engvald; G=Jan) *
- ;* Telex: 33533 LUNIVER S *
- ;* *
- ;*************************************************************************
-
- ; Note: If you want to assemble this code yourself, you need Turbo ASM
- ; (at least MASM 5.1 does not like comments on structure calls!).
- ; Also, some files from the Crynwr packet driver collection are needed.
-
- ;************************************************************************
- ;* Compile time constants *
- ;************************************************************************
-
- .lfcond
- PRGVERSION equ ' v2.07'
- TBLBUILD equ 0
- PINGCLIENT equ 1
- ; DEBUG values above 5 degrade throughput a lot.
- DEBUG equ 0
-
- MN equ 60 ; seconds in a minute
- HR equ 60*MN ; seconds in an hour
-
- SUN equ 0 ; Sunday
- SAT equ 6 ; Saturday
- DAT equ 0ffh ; Specific date follows
-
- FEB2W equ 31+2*7 ; Feb 2nd week
- MAR1W equ 31+28+1*7 ; Mar 1st week
- MAR2W equ 31+28+2*7 ; Mar 2nd week
- MAR3W equ 31+28+3*7 ; Mar 2rd week
- MARLW equ 31+28+31 ; Mar last week
- APR01 equ 31+28+31+1 ; Apr 1
- APR03 equ 31+28+31+3 ; Apr 3
- APR07 equ 31+28+31+7 ; Apr 7
- APR1W equ 31+28+31+1*7 ; Apr 1st week
- APR2W equ 31+28+31+2*7 ; Apr 2nd week
- APR14 equ 31+28+31+14 ; Apr 14
- APR18 equ 31+28+31+18 ; Apr 18
- APRNL equ 31+28+31+30-7 ; Apr next last week
- APR23 equ 31+28+31+23 ; Apr 23
- APR26 equ 31+28+31+26 ; Apr 26
- MAY01 equ 31+28+31+30+1 ; May 1
- MAY2W equ 31+28+31+30+2*7 ; May 2nd week
- AUG28 equ 31+28+31+30+31+30+31+28 ; Aug 28
- SEP01 equ 31+28+31+30+31+30+31+31+1 ; Sep 1
- SEP08 equ 31+28+31+30+31+30+31+31+8 ; Sep 8
- SEP12 equ 31+28+31+30+31+30+31+31+12 ; Sep 12
- SEP2W equ 31+28+31+30+31+30+31+31+2*7 ; Sep 2nd week
- SEP17 equ 31+28+31+30+31+30+31+31+17 ; Sep 17
- SEP20 equ 31+28+31+30+31+30+31+31+20 ; Sep 20
- SEP3W equ 31+28+31+30+31+30+31+31+3*7 ; Sep 3rd week
- SEP30 equ 31+28+31+30+31+30+31+31+30 ; Sep 30
- SEPLW equ 31+28+31+30+31+30+31+31+30 ; Sep last week
- OCT01 equ 31+28+31+30+31+30+31+31+30+1 ; Oct 1
- OCT2W equ 31+28+31+30+31+30+31+31+30+2*7 ; Oct 2nd week
- OCT24 equ 31+28+31+30+31+30+31+31+30+24 ; Oct 18 - 24
- OCT4W equ 31+28+31+30+31+30+31+31+30+4*7 ; Oct 4th week
- OCT29 equ 31+28+31+30+31+30+31+31+30+29 ; Oct 23 - 29
- OCTLW equ 31+28+31+30+31+30+31+31+30+31 ; Oct last week
- NOV13 equ 31+28+31+30+31+30+31+31+30+31+13 ; Nov 5 - 13
-
- AlgE struc
- AlgName db "EUR " ;; Name of dst algorithm
- AlgFromTime dw 2*HR ;; local standard time dst start
- AlgFromWeekDay dw SUN ;; weekday dst start
- AlgFromWeek dw MARLW ;; last day-of-year dst start
- AlgUntilTime dw 2*HR ;; local standard time dst end
- AlgUntilWeekDay dw SUN ;; weekday dst end
- AlgUntilWeek dw SEPLW ;; last day-of-year dst end
- AlgAddAmount dw 1*HR ;; dst advance amount
- AlgEntryLen equ $-AlgName
- AlgE ends
-
- AlgData struc
- AUSA AlgE <"USA ", 2*HR,SUN,APR1W, 1*HR,SUN,OCTLW, HR> ;; USA Canada Mexico
- ACub AlgE <"CUB ", 0*HR,SUN,MAY2W,-1*HR,SUN,OCT2W, HR> ;; Cuba
- AChl AlgE <"CHIL", 0*HR,SUN,OCT2W,-1*HR,SUN,MAR2W, HR> ;; Chile
- ABrz AlgE <"BRZ ", 2*HR,SAT,OCT4W, 1*HR,SAT,FEB2W, HR> ;; Brazil
- AGBR AlgE <"GBR ", 1*HR,SUN,MARLW, 1*HR,SUN,OCT29, HR> ;; United Kingdom
- AWEu AlgE <"W_EU", 1*HR,SUN,MARLW, 1*HR,SUN,SEPLW, HR> ;; West Europe
- AMEu AlgE <"M_EU", 2*HR,SUN,MARLW, 2*HR,SUN,SEPLW, HR> ;; Central Europe + SU
- AEEu AlgE <"E_EU", 3*HR,SUN,MARLW, 3*HR,SUN,SEPLW, HR> ;; East Europe
- ALby AlgE <"LIBY", 2*HR,DAT,APR01, 1*HR,DAT,SEP30, HR> ;; Libya
- AEgy AlgE <"EGY ", 2*HR,DAT,MAY01, 1*HR,DAT,OCT01, HR> ;; Egypt
- ATur AlgE <"TURK", 1*HR,SUN,MARLW, 0*HR,SUN,SEPLW, HR> ;; Turkey
- AIra AlgE <"IRAN", 2*HR,SUN,MARLW, 1*HR,SUN,SEP3W, HR> ;; Iran
- APRC AlgE <"PRC ", 2*HR,SUN,APR2W, 2*HR,SUN,SEP2W, HR> ;; People Rep of China
- AROK AlgE <"ROK ", 2*HR,SUN,MAY2W, 2*HR,SUN,OCT2W, HR> ;; Rep of Korea
- AAus AlgE <"AUS ", 2*HR,SUN,OCTLW, 2*HR,SUN,MAR3W, HR> ;; South Australia
- ATas AlgE <"TASM", 2*HR,SUN,OCT24, 2*HR,SUN,MAR3W, HR> ;; Tasmania
- ANSW AlgE <"NSW ", 2*HR,SUN,OCTLW, 2*HR,SUN,MAR1W, HR> ;; New South Wales
- ALHI AlgE <"LHI ", 2*HR,SUN,OCTLW, 2*HR,SUN,MAR1W, 30*MN> ;; LHI (Australia)
- ANZe AlgE <"NZE ", 2*HR,SUN,OCTLW, 2*HR,SUN,MAR1W, HR> ;; New Zealand
-
- ; All entries below this line are indexed by year modulo 4
-
- APa0 AlgE <"PAC ", 2*HR,SUN,APR1W, 1*HR,SUN,NOV13, HR> ;; Pacific presidential
- APa1 AlgE <"PAC ", 2*HR,SUN,APR1W, 1*HR,SUN,OCTLW, HR> ;; Pacific non-pres
- APa2 AlgE <"PAC ", 2*HR,SUN,APR1W, 1*HR,SUN,OCTLW, HR> ;; Pacific non-pres
- APa3 AlgE <"PAC ", 2*HR,SUN,APR1W, 1*HR,SUN,OCTLW, HR> ;; Pacific non-pres
-
- ; All entries above this line are cyclic and will last forever
- ; All entries below this line are non-cyclic, they only last 4 years
-
- AIs0 AlgE <"ISR ", 0*HR,DAT,APR14,-1*HR,DAT,SEP08, HR> ;; Israel 1996
- AIs1 AlgE <"ISR ", 0*HR,DAT,APR18,-1*HR,DAT,SEP12, HR> ;; Israel 1993
- AIs2 AlgE <"ISR ", 0*HR,DAT,APR03,-1*HR,DAT,AUG28, HR> ;; Israel 1994
- AIs3 AlgE <"ISR ", 0*HR,DAT,APR23,-1*HR,DAT,SEP17, HR> ;; Israel 1995
-
- if 0 ; as years go by, replace entries above from below with same label
- AIs1 AlgE <"ISR ", 0*HR,DAT,MAY04,-1*HR,DAT,SEP28, HR> ;; Israel 1997
- AIs2 AlgE <"ISR ", 0*HR,DAT,APR19,-1*HR,DAT,SEP13, HR> ;; Israel 1998
- AIs3 AlgE <"ISR ", 0*HR,DAT,APR11,-1*HR,DAT,SEP05, HR> ;; Israel 1999
- AIs0 AlgE <"ISR ", 0*HR,DAT,APR30,-1*HR,DAT,SEP24, HR> ;; Israel 2000
- AIs1 AlgE <"ISR ", 0*HR,DAT,APR15,-1*HR,DAT,SEP09, HR> ;; Israel 2001
- AIs2 AlgE <"ISR ", 0*HR,DAT,APR07,-1*HR,DAT,SEP01, HR> ;; Israel 2002
- AIs3 AlgE <"ISR ", 0*HR,DAT,APR27,-1*HR,DAT,SEP21, HR> ;; Israel 2003
- AIs0 AlgE <"ISR ", 0*HR,DAT,APR18,-1*HR,DAT,SEP12, HR> ;; Israel 2004
- AIs1 AlgE <"ISR ", 0*HR,DAT,MAY01,-1*HR,DAT,SEP25, HR> ;; Israel 2005
- AIs2 AlgE <"ISR ", 0*HR,DAT,APR23,-1*HR,DAT,SEP17, HR> ;; Israel 2006
- AIs3 AlgE <"ISR ", 0*HR,DAT,APR15,-1*HR,DAT,SEP09, HR> ;; Israel 2007
- AIs0 AlgE <"ISR ", 0*HR,DAT,APR27,-1*HR,DAT,SEP21, HR> ;; Israel 2008
- AIs1 AlgE <"ISR ", 0*HR,DAT,APR19,-1*HR,DAT,SEP13, HR> ;; Israel 2009
- endif
- AlgData ends
-
- WARNYEAR equ 1997 ; acyclic data invalid year
-
- ;************************************************************************
-