One of our customers noticed a problem with our Switch List Editor in the Managed Switch Port Mapping Tool. The list ordering relies on a column in a table that we'll call ListIndex. The DDL for the table had defined the column as [ListIndex] TEXT. The index being saved in the column was the numbers zero through however many rows there are for that set of entries (this is not the main constraint column, just an indexing column within a set of rows).
If you did:
'SELECT * FROM theTable WHERE mainConstraintCol='rowSet' ORDER BY ListIndex ASC'
we expected to get a set of rows indexed 0, 1, 2, 3, 4 etc. in that order. That worked fine until there were more than 10 entries in a set of rows. Then the sorting would be 0, 1, 10, 11, 12, 13, 14, 2, 3, 4, 5, 6, 7, 8, 9. Obviously it is the creect sorting if the column is of type TEXT, but wrong since we are interested in the numbers themselves.
The solution was to change the DDL to this: [ListIndex] NUMBER (or INTEGER). That way the ORDER BY sorting ends up correctly in numeric order for lists larger than 10: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, etc.
Changing the DDL works OK if you are creating the table every time, but this table is persistent between application sessions. Because SQLite (to my knowledge) has no ALTER TABLE method for changing an existing table DDL Type from TEXT to NUMBER, I had to do the create temp table, copy contents from original, DROP the original table and recreate it correctly, then copy the temp table contents back to the original. A pain, but functional method. I would be interested in any other simpler methods.
Moral of this story is to be sure of your column typing when you define a table in SQLite especially if you are depending on the contents of that column to index something else.
SQLite: www.sqlite.org
Managed Switch Port Mapping Tool: www.SwitchPortMapper.com
Wednesday, April 24, 2013
SQLite Discussion - Sorting Order: TEXT vs NUMBER
Labels:
DDL,
SQLite,
Switch List,
Switch Port Mapper
| Reactions: |
Switch Port Mapper 2.07 Released
The latest version 2.07 of the Managed Switch Port Mapping Tool was released on April 22, 2013. The purpose of this release was to correct a problem with Switch Lists, more specifically the Switch List editor and the execution engine. The issue only was apparent when you had more than 9 switches in a list. If you had 10 or more, the sort order of the switches in the editor and the execution engine was like this: 0, 1, 10, 11, 12, 2, 3, 4, 5 etc. instead of 0, 1, 2, 3, 4, 5 etc.
As a result of working with the Switch List Editor, I discovered it was saving to the database fairly inefficiently (slowly), so I made some changes to speed that up and so it is much faster now when you press the OK button to close the editor.
It was suggested by a user that we include a method for copying a whole results grid row to the clipboard and that was added, however, it may not appear quite as you expect because if there are more than one MAC address in a cell, a CR-LF is added to the copied text for each one.
As usual, we keep updating SQLite DLL to match the latest version and the MAC Address to Manufacturer database was also updated.
Get it at www.SwitchPortMapper.com or follow the instructions in Help/Check for Update.
As a result of working with the Switch List Editor, I discovered it was saving to the database fairly inefficiently (slowly), so I made some changes to speed that up and so it is much faster now when you press the OK button to close the editor.
It was suggested by a user that we include a method for copying a whole results grid row to the clipboard and that was added, however, it may not appear quite as you expect because if there are more than one MAC address in a cell, a CR-LF is added to the copied text for each one.
As usual, we keep updating SQLite DLL to match the latest version and the MAC Address to Manufacturer database was also updated.
Get it at www.SwitchPortMapper.com or follow the instructions in Help/Check for Update.
Labels:
new release,
Switch Port Mapper
| Reactions: |
Thursday, April 11, 2013
USB Version of the Managed Switch Port Mapper
We have offered NetScanTools Pro as a fully portable application running from a USB Flash Drive since 2006 and now the Managed Switch Port Mapping Tool has joined it.
The Switch Port Mapper can now run from a USB Flash Drive using a special compiled version. It retains all the same features as the 'installed' version yet now is fully portable so that you can run it on any Windows XP or later machine that offers a USB 2.0 or 3.0 port. Simply plug in the flash drive, navigate to the executable and start it. And it doesn't require 'Run as administrator'!
We are shipping it on a fast USB 3.0 (compatible with USB 2.0) 16 GB flash drive and for those who already have their own fast flash drive, we can supply a fileset that you can put on it yourself with assistance from our tech support.
The advantages of having the Switch Port Mapper on a USB Flash Drive - not requiring installation - are immense. Network Techs can take it to offsite locations and quickly map a switch.
As far as we know, we are the ONLY company offering Switch Port Mapping software both as fully portable USB flash drive software and as installed on a Windows computer.
Interested?
www.SwitchPortMapper.com
The Switch Port Mapper can now run from a USB Flash Drive using a special compiled version. It retains all the same features as the 'installed' version yet now is fully portable so that you can run it on any Windows XP or later machine that offers a USB 2.0 or 3.0 port. Simply plug in the flash drive, navigate to the executable and start it. And it doesn't require 'Run as administrator'!
We are shipping it on a fast USB 3.0 (compatible with USB 2.0) 16 GB flash drive and for those who already have their own fast flash drive, we can supply a fileset that you can put on it yourself with assistance from our tech support.
The advantages of having the Switch Port Mapper on a USB Flash Drive - not requiring installation - are immense. Network Techs can take it to offsite locations and quickly map a switch.
As far as we know, we are the ONLY company offering Switch Port Mapping software both as fully portable USB flash drive software and as installed on a Windows computer.
Interested?
www.SwitchPortMapper.com
| Reactions: |
Packet Generator Scripting Improvements
NetScanTools Pro v11.42 introduced two major improvements to the Packet Generator scripting:
The first is a 'debugging' window. This new window, located below the main controls on the Packet Generator page serves the primary purpose of showing the command processing during scripting - if you have Enable Script Debugging Messages checked. The other purpose for it is to show certain errors when they occur.
The second improvement is the addition of five new packet reset commands. These commands are intended to be used just prior to modifying packet parameters followed by sending the packets. They reset the TCP, UDP, ICMP, CDP and ARP packet headers to known states - primarily zero. The commands are:
!TCP_RESET_PACKET - resets the TCP header
!UDP_RESET_PACKET - resets the UDP header
!ICMP_RESET_PACKET - resets the ICMP header
!CDP_RESET_PACKET - resets the CDP header and presets some fields to non-zero values
!ARP_RESET_PACKET - resets the ARP header and presets some fields to non-zero values
This is detailed in the Help file (press F1 while viewing the Packet Generator) under the topic Packet Generator - Scripting.
Be sure to use these before defining header parameters and sending packets.
The first is a 'debugging' window. This new window, located below the main controls on the Packet Generator page serves the primary purpose of showing the command processing during scripting - if you have Enable Script Debugging Messages checked. The other purpose for it is to show certain errors when they occur.
The second improvement is the addition of five new packet reset commands. These commands are intended to be used just prior to modifying packet parameters followed by sending the packets. They reset the TCP, UDP, ICMP, CDP and ARP packet headers to known states - primarily zero. The commands are:
!TCP_RESET_PACKET - resets the TCP header
!UDP_RESET_PACKET - resets the UDP header
!ICMP_RESET_PACKET - resets the ICMP header
!CDP_RESET_PACKET - resets the CDP header and presets some fields to non-zero values
!ARP_RESET_PACKET - resets the ARP header and presets some fields to non-zero values
This is detailed in the Help file (press F1 while viewing the Packet Generator) under the topic Packet Generator - Scripting.
Be sure to use these before defining header parameters and sending packets.
Labels:
NetScanTools Pro,
packet generator
| Reactions: |
WinPcap 4.1.3 for Windows 8
As you may already be aware, the folks at winpcap.org finally did an upgrade to the WinPcap driver. Version 4.1.3 supports Windows 8 - in other words the installer will not balk at Win 8 like the 4.1.2. installer did. And they did a couple of minor bug fixes in the process.
So if you have Wireshark or NetScanTools Pro and want to use them on Windows 8, please visit http://www.winpcap.org/ to get 4.1.3.
So if you have Wireshark or NetScanTools Pro and want to use them on Windows 8, please visit http://www.winpcap.org/ to get 4.1.3.
| Reactions: |
Monday, March 25, 2013
NetScanTools Pro v11.42 Released
NetScanTools Pro v11.42 was released on March 14, 2012 and includes the packet generator scripting improvements along with a few other minor changes. There was one change that was also quite important: the inclusion of the newest WinPcap 4.1.3 release. This version of WinPcap formally supports Windows 8.
These changes were also put into the most recent demo version posted on March 25.
These changes were also put into the most recent demo version posted on March 25.
Labels:
NetScanTools Pro,
new release
| Reactions: |
Tuesday, March 5, 2013
Packet Generator Scripting Tips
After a recent tech support exchange, I felt that I should add a few more tips about using the NetScanTools Pro Packet Generator in scripting mode.
It's important to note that parameters or values shown on the main Packet Generator window can be overridden by script commands. In other words, the values shown, like Time To Live will be used in the packet unless you override the parameter with the TTL=64 command.
And more importantly there are a few parameters that you should override to be sure the packet you are sending is correctly sent. Those are the values and settings shown in the packet definition windows that appear when you press Send Now, no scripting.
For example when using a script to send UDP packets, you must specify source and destination ports, whether or not to override the UDP Length and Checksum with their corresponding values and the data payload you wish to send. So for UDP, you need to use these commands prior to doing a SEND directive - don't rely on defaults because there are none:
UDP_SOURCE_PORT=
UDP_DEST_PORT=
UDP_OVERRIDE_CHECKSUM=0 or 1
if 1, then specify UDP_OVERRIDE_CHECKSUM_VALUE
UDP_OVERRIDE_LENGTH=0 or 1
if 1, then specify UDP_OVERRIDE_LENGTH_VALUE
UDP_DATAFROMFILE=1 or 0
if UDP_DATAFROMFILE is 1, then set UDP_DATAFILEPATH to the fully qualified exact path of your data file you want sent. If UDP_DATAFROMFILE is 0, then you must specify UDP_DATA.
These values you set will remain during the running of the script. So if you need to change just one or two parameters, you do not have to change them all.
Sending a TCP packet requires even more default values.
Header flags:
TCP_FIN=0 or 1
TCP_SYN=0 or 1
TCP_RST=0 or 1
TCP_PSH=0 or 1
TCP_ACK=0 or 1
TCP_URG=0 or 1
TCP_ECN=0 or 1
TCP_CWR=0 or 1
Header Fields:
TCP_SEQUENCE
TCP_ACKNOWLEDGE
TCP_WINDOW
TCP_URGENT
TCP_MSS
TCP_SACK
TCP_WINDOW_SCALING
Ports:
TCP_SOURCE_PORT=
TCP_DEST_PORT=
Misc:
TCP_OVERRIDE_CHECKSUM=0 or 1
if 1, then specify TCP_OVERRIDE_CHECKSUM_VALUE
TCP_DATAFROMFILE=1 or 0
if TCP_DATAFROMFILE is 1, then set TCP_DATAFILEPATH to the fully qualified exact path of your data file you want sent. If TCP_DATAFROMFILE is 0, then you must specify TCP_DATA.
All of the above values are fully documented in the help file. Press the F1 key while viewing the Packet Generator Tool or click on Help/Help Topics. Then navigate to Manual Tools > Packet Generator > Packet Generator Scripting. Expand the 'Setting Parameters' grouping to see the parameters and their required values.
Like I said earlier, you only need to set each of these once in your script then send the packet(s), then change only the parameters you need to change before sending the next packet.
This applies to the other types of packets that can be sent. Reminder: You may need to disable your firewall for the packets to actually be sent. Use Wireshark or our Packet Capture tool to verify that you are sending them.
Coming in v11.42 - a way to see errors and debug scripts.
It's important to note that parameters or values shown on the main Packet Generator window can be overridden by script commands. In other words, the values shown, like Time To Live will be used in the packet unless you override the parameter with the TTL=64 command.
And more importantly there are a few parameters that you should override to be sure the packet you are sending is correctly sent. Those are the values and settings shown in the packet definition windows that appear when you press Send Now, no scripting.
For example when using a script to send UDP packets, you must specify source and destination ports, whether or not to override the UDP Length and Checksum with their corresponding values and the data payload you wish to send. So for UDP, you need to use these commands prior to doing a SEND directive - don't rely on defaults because there are none:
UDP_SOURCE_PORT=
UDP_DEST_PORT=
UDP_OVERRIDE_CHECKSUM=0 or 1
if 1, then specify UDP_OVERRIDE_CHECKSUM_VALUE
UDP_OVERRIDE_LENGTH=0 or 1
if 1, then specify UDP_OVERRIDE_LENGTH_VALUE
UDP_DATAFROMFILE=1 or 0
if UDP_DATAFROMFILE is 1, then set UDP_DATAFILEPATH to the fully qualified exact path of your data file you want sent. If UDP_DATAFROMFILE is 0, then you must specify UDP_DATA.
These values you set will remain during the running of the script. So if you need to change just one or two parameters, you do not have to change them all.
Sending a TCP packet requires even more default values.
Header flags:
TCP_FIN=0 or 1
TCP_SYN=0 or 1
TCP_RST=0 or 1
TCP_PSH=0 or 1
TCP_ACK=0 or 1
TCP_URG=0 or 1
TCP_ECN=0 or 1
TCP_CWR=0 or 1
Header Fields:
TCP_SEQUENCE
TCP_ACKNOWLEDGE
TCP_WINDOW
TCP_URGENT
TCP_MSS
TCP_SACK
TCP_WINDOW_SCALING
Ports:
TCP_SOURCE_PORT=
TCP_DEST_PORT=
Misc:
TCP_OVERRIDE_CHECKSUM=0 or 1
if 1, then specify TCP_OVERRIDE_CHECKSUM_VALUE
TCP_DATAFROMFILE=1 or 0
if TCP_DATAFROMFILE is 1, then set TCP_DATAFILEPATH to the fully qualified exact path of your data file you want sent. If TCP_DATAFROMFILE is 0, then you must specify TCP_DATA.
All of the above values are fully documented in the help file. Press the F1 key while viewing the Packet Generator Tool or click on Help/Help Topics. Then navigate to Manual Tools > Packet Generator > Packet Generator Scripting. Expand the 'Setting Parameters' grouping to see the parameters and their required values.
Like I said earlier, you only need to set each of these once in your script then send the packet(s), then change only the parameters you need to change before sending the next packet.
This applies to the other types of packets that can be sent. Reminder: You may need to disable your firewall for the packets to actually be sent. Use Wireshark or our Packet Capture tool to verify that you are sending them.
Coming in v11.42 - a way to see errors and debug scripts.
Labels:
NetScanTools Pro,
packet generator,
tips
| Reactions: |
Subscribe to:
Posts (Atom)