The Mole #6: Technical Answers from Inside Microsoft - DHCP, Network Monitoring, Text File Import, NT as Bridge?

April 5, 1999

Editors Note The questions and answers below are from the Inside Microsoft column that appears regularly on the TechNet Web site (https://www.microsoft.com/technet). To find out how to submit questions of your own, see the end of this article or go to https://www.microsoft.com/technet/community/columns/insider/default.mspx.

The TechNet Mole provides expert answers from deep within Microsoft to questions from IT professionals. The sixth installment focuses on these issues:

  • Troubleshooting DHCP Misbehavior

  • Monitoring Network Performance

  • Importing Text Files to SQL Server

  • NT as Bridge? Not.

On This Page

Troubleshooting DHCP Misbehavior
Slow Network? Sic Bloodhound on It
Importing Text Files to SQL Server
NT as Bridge? Not.
Got Questions? Mail the Mole

Troubleshooting DHCP Misbehavior

Dear Mole,

Many of our people using laptops (Win 95 or NT 4.0) move from one of our locations to others. The problem we have is that we can't get new IP addresses from different DHCP servers on different segments. The only solution we found is using the IPCONFIG or WINIPCFG commands.

Is there a better solution?

Man with a Broken Lease

Dear MBL,

My friend, your question opens a whole new can of worms. Dynamic Host Configuration Protocol is an elegant answer to the peripatetic client problem--when everything's set up and working properly. There are, however, a whole host (pun intended) of places things can go awry. If you are using the /RELEASE and /RENEW parameters with the IPCONFIG or WINIPCFG commands successfully, your problem could arise from any of the following scenarios for system misbehavior:

  • The client is not issuing a proper DHCPRELEASE packet when being shut down.

  • The DHCPRELEASE packet is being sent from the client but is not being received at the DHCP server.

  • The DHCPRELEASE packet is being received at the server but is not being acted on.

  • A new DHCPDISCOVER packet is not being sent from the client.

  • The DHCPDISCOVER packet is being sent from the client but is not being received at the DHCP server.

  • The DHCPDISCOVER packet is being received at the server but is not being acted on.

  • A new DHCPOFFER packet is not being sent from the server

  • The DHCPOFFER packet is being sent from the server but is not being received at the DHCP client

  • The DHCPOFFER packet is being received at the client but is not being acted on.

  • A new DHCPREQUEST packet is not being sent from the client.

  • The DHCPREQUEST packet is being sent from the client but is not being received at the DHCP server.

  • The DHCPREQUEST packet is being received at the server but is not being acted on.

  • A new DHCPACK packet is not being sent from the server.

  • The DHCPACK packet is being sent from the server but is not being received at the DHCP client.

  • The DHCPACK packet is being received at the client but is not being acted on.

By now, you may be wondering if the DHCP lease process works at all. Be assured that it does. Any one of the failures described above can be indicative of a problem in leasing DHCP addresses across multiple subnets with either a configuration error in the DHCP server or routers, or a communications failure across multiple routers.

There are several issues that you should check to make sure that the DHCP server(s) are properly leasing and releasing addresses.

  • Make sure that the DHCP server(s) have the latest Windows NT 4.0 service pack applied to correct any potential problems that may occur on the server.

  • Are the clients shutting down properly? If not, the address they are using may not be released correctly at the server.

  • As the clients move from one segment to another, are they still attempting to acquire an address from a DHCP server on another segment? There could be an issue of DHCP broadcasts failing to cross a router, which could indicate you need to enable BOOTP forwarding on those routers you want to pass DCHP discover messages.

  • Do the DHCP servers, on the segments where the clients are failing to acquire an address, have enough available addresses to handle new requests? Are the scopes configured correctly?

  • Are there any errors in the System Log in the Event Viewer tool on the various DHCP servers?

  • There is no mention as to which type of client is being used (Windows95/98 or NT). If an NT client fails to acquire a new lease, you can check for errors in the System Log in the Event Viewer tool on the client.

One of the best ways to troubleshoot DHCP activity is to install the Windows Network Monitor (Bloodhound) on the DHCP servers to track the receipt of individual lease requests, issuance, releases, and denials. This will allow you to verify what clients are sending a lease request to the server and whether a lease issuance is being sent. Conversely, you can also install Bloodhound on an affected client to verify that a lease release, request, and receipt are being sent and received.

For further information on using Bloodhound, please refer to the following Microsoft Knowledge Base article:

  • 148942: How to Capture Network Traffic with Network Monitor

For further info on troubleshooting DHCP, you may also wish to read the following Microsoft Knowledge Base articles:

  • 169790: How to Troubleshoot Basic TCP/IP Problems in Windows NT 4.0

  • 153072: Leases Retained in DHCP Database For One Day After Expiration

  • 150565: Creating DHCP Scopes Using DHCP Manager

  • 124026: DHCP Requests Fail on Logically Multihomed Server (Single NIC)

  • 167014: DHCP Client May Fail to Obtain a DHCP-Assigned IP Address

  • 164524: How to Enable the DHCP Logging Feature in Windows NT 4.0 SP 2

  • 145881: How to Use Jetpack.exe to Compact a WINS or DHCP Database

  • 180557: DHCP Clients Unable to Obtain IP Lease from DHCP Server

  • 140859: TCP/IP Routing Basics for Windows NT

  • 139904: How to Configure Your DHCP Server Scope

  • 174051: DHCP Server Fails to Lease Addresses for New Scope

  • 120932: DHCP—Spanning Multiple Subnets

Be patient. Be thorough. And let us know what you find.

Slow Network? Sic Bloodhound on It

Hi Mole,

I have Proliant Pentium 166 Servers, Cat 5 cabling, 100mb NICs, NT4.0 on servers and workstations, ample supply of Ram and disk space, service pack 3 loaded and bios and Compaq SSDs installed, yet the network runs very slow. Any suggestions? Is there some kind of LanAlyser I can use to find the problem?

Jamal

Hey, Jamal:

As you well know, a lot of factors can contribute to poor network performance. Before you tackle the transmission issues, make sure that your hardware (hubs, cable, network adapters) is working properly. This really is a case where one bad apple can spoil the whole bushel, if you take my point.

Beyond hardware, there are two separate steps you can take to diagnose performance issues on your network. The first is to begin tracking server and network performance data using the PerfMon application in the Administrative Tools group. Get up to speed with this light reading from the Microsoft Knowledge Base:

  • 150934: How to Create a Performance Monitor Log for NT Troubleshooting

  • 175847: How to Set Up Data Logging on a Remote Computer

  • 175658: Gathering Information for Troubleshooting Performance Issues

Once you have collected enough information, you can begin to establish benchmarks for expected performance and compare these to future data collections to indicate potential problems. If the Perfmon data indicates a hardware or resource issue, it should easily be diagnosed using this method.

If the data indicates a network performance bottleneck, you may need to use the Microsoft network data capture tool (Bloodhound) to capture and break down individual network packets to pinpoint the problem. Bloodhound, (or NetMon as it is called internally) can collect and display the individual packets that transverse your network, allowing you to examine each individual byte included in each frame. Please note that, in order to collect ALL network data, a computer must be using a card which is capable of running in Promiscuous mode to collect packets intended for addresses other than itself. Otherwise, the network card will only be able to capture data intended for its own MAC address.

For information on how to obtain Bloodhound and how to use the product to track and diagnose network performance issues, refer to the following articles in the Microsoft Knowledge Base:

  • 158744: How to Automate Network Captures with Network Monitor

  • 124838: NICs That Work with Network Monitor

  • 148942: How to Capture Network Traffic with Network Monitor

If neither of these troubleshooting methods helps your network performance, Mole has two other suggestions. Lower your expectations, or throw the whole thing out and start again. (Only kidding.)

Importing Text Files to SQL Server

Dear TechNet Agent:

I'm working with SQL Server 7.0 and I want to import some text files to SQL Server.

I'm writing a script to import dynamically some text files to SQL Server. The idea is: I can import any quantity of tables, it could be one, two, three, etc. I have the table names in a text file named tablas.txt and the name of one table matches the name of the file, for instance, if the table name is forma_1, the corresponding file is forma_1.txt

The method I'm using is, I use bulk insert to import the table names to a table named table_names. I create a cursor in order to scan each table name and import the file.

The problem I have is, I need to use a user variable to take the tablename and the filename, but the bulk insert command seems not work with user variables.

The question is: Is there some way to use user variables with bulk insert? Is there a better way to make the task I described?

I include the script a wrote, maybe the problem is in the code. I also include the result when I run the script.

 /******* SCRIPT **************/
 USE sat_dgti
 GO
 truncate table table_names
 bulk insert sat_dgti..table_names
 from 'd:\tablas.txt'
 DECLARE @NOMBRE sysname
 DECLARE tablas CURSOR FOR
 SELECT * FROM table_names
 OPEN tablas
 FETCH NEXT FROM tablas
 INTO @NOMBRE
 WHILE (@@FETCH_STATUS = 0)
 BEGIN
     DECLARE @ARCHIVO varchar(255)
     SET @ARCHIVO = 'D:\' + @NOMBRE + '.TXT'
     IF NOT EXISTS (Select name from sysobjects
         where name=@NOMBRE and type='U')
     BEGIN
  PRINT "La tabla " + @NOMBRE + "
         no existe en el catálogo.
         Por favor créela y vuelva a
         intentar la exportación."
  CONTINUE
     END
     truncate table sat_dgti..table_name
     IF (@@ERROR <> 0)
     BEGIN
  PRINT "Hubo un error al truncar
         la tabla " + @nombre + ".
         Los datos no serán importados
         a esta tabla."
  CONTINUE
     END
     bulk insert @NOMBRE   /* ERROR HERE */
     from @ARCHIVO   /* ERROR HERE */
     with (
  fieldterminator='|'
     )
     IF (@@ERROR <> 0)
     BEGIN
  PRINT "Hubo un error al importar
         la tabla " + @nombre + ".
         Verifique que el archivo
         correspondiente exista y que
         el contenido sea correcto."
  CONTINUE
     END
     ELSE
     BEGIN
  PRINT 'La importación de la tabla '
     + @nombre + ' fue exitosa.'
     END
     FETCH NEXT FROM abc
     INTO @NOMBRE
 END
 CLOSE tablas
 DEALLOCATE tablas
 GO
 /******* RESULT AFTER CTRL+E **********/
 Server: Msg 170, Level 15, State 1, Line 34
 Line 34: Incorrect syntax near '@NOMBRE'.

Ing. C. Misael Torres Ponce, Consultor MCSE

Hola, Misael:

One solution would be to do something like the following:

 create table myfiles (filename char(100))
 insert into myfiles values('a.txt"')
 <------ note the use of single
 quotes round file plus "
 at end of filename
 declare @test sysname
 declare a cursor for select filename
 from myfiles open a
 fetch next from a into @test
 exec ('bulk insert your_table from
 "d:\' + @test)
 <---- note the " preceding the d:\ close a
 deallocate a

The filename in the table contains the trailing " and the exec statement includes the leading " of the filename to insert from. If you prefer, a buddy in a neighboring burrow puts it this way:

Misael can create a bulk insert TSQL string, then execute that string with exec:

 declare @tbl varchar(255)
   declare @sql varchar(255)
   select @tbl = 'tbl1'
   select @sql = 'bulk insert '
     + @tbl ' from '
     -- build up rest of bulk
     insert command here ...
   exec (@sql)

Note that in both examples, it's essential to include the quotation marks for the code to function properly. As your fourth grade teacher no doubt said, points off if you don't.

NT as Bridge? Not.

Dear Mole,

The topology of our LAN is Token Ring. We want Bell ** Atlantic to install an ISDN on demand 128 k line for connection to the internet. They have recommended a Netopia router, which of course doesn't support Token Ring. We are faced with the choice of converting our Lan to Ethernet to use that router (which is relatively cheap) or purchase an expensive Token Ring Router or bridge, that may be obsolete next year, given the unpopularity of Token Ring. I was talking to a techie at Black Box who has the following unproven theory:

Install an Ethernet NIC in our NT 4.0 Server which has a Token Ring NIC, of course; connect the Netopia ISDN router to the Ethernet NIC and let NT act as the bridge between the two...one hitch though; he doesn't know how to configure NT to support this arrangement, nor do I. Any ideas or is this all far out in left field?

Gregor Samsa

Dear Gregor,

It seems to me that you have not one but two distinct problems.

As to the first, the notion of configuring NT as a bridge between Token Ring and Ethernet networks is pure speculation. I'm reluctant to say never, but I don't believe it can be done. As a router, yes. As a bridge, no. If anyone out there has a proven example to the contrary, please send it along and become a Mole's Hole Hero. (Or Heroine.)

As to your second problem, you either 1) enjoy pretending to be a giant cockroach, or 2) actually are a giant cockroach. In either case, Mole recommends a nice long vacation, during which you read no technical manuals and nothing written by Franz Kafka. Try Kenneth Grahame or Brian Jacques instead.

Got Questions? Mail the Mole

Communicate with Mole at [closed account]. Send him your toughest questions. And if you think you have a better answer than Mole's, or a different one, send that along, as well. Please include the following:

  • Your name

  • Your title

  • Your company

  • Your email address

  • Your question/solution/compliment

Credits

Keith Van Hulle, Mark Wheatley, Tai Yee, Bart Duncan