Important update: Arm Announces End of Life Timeline for Mbed. This site will be archived in July 2026. Read the full announcement.
NetTool
Table of Contents
NetTool¶
Purpose¶
The purpose of the NetTool project is to demonstrate the use of raw structures and memory maps to achieve raw ethernet, ip, arp, icmp, tcp, and udp input and output. The demonstration tool can ping, identify, and perform a TCP port scan of a host connected via ethernet.
Program¶
Import program NetTool
This is a low-level network debugging utility that utilizes raw packet i/o to construct and deconstruct tcp, udp, ipv4, arp, and icmp packets over ethernet.
Last commit 12 Oct 2010 by Kyle Lemons
Memory Maps¶
NetTool provides C++ structure memory maps for numerous on-wire formats, including Ethernet, IP, TCP, UDP, ICMP, and ARP. In order for them to work nicely in the host environment, accompanying functions are provided to fix the endianness of the memory so that the stuructures can be created and used easily.
IP¶
Import program
Data Fields
The demo program interprets IP version 4 (IPv4) packets and processes them based on their protocol. If they are TCP, UDP, or ICMP, they are processed further.
TCP¶
Import program
Data Fields
TCP packets are processed and a TCP port scan can be performed by adding a line with "portscan" to the command text file.
UDP¶
Import program
Data Fields
UDP packets are processed by the dmeo program, but not used.
ICMP¶
The demo program can (by adding "ping" on a line by itself to the command file) send a ping every 30 seconds to the host computer.
ARP¶
Import program
Data Fields
The demo program interprets ARP requests and announces in order to determine an IP address for itself and to instruct the host how to communicate with the device. When the host announces an IP address, the next IP address is chosen and used as the device IP.
Demo Program¶
Hardware¶
The only peripheral used by the demo program is an ethernet jack. One can be obtained from SparkFun. The Cool Components Workshop Board also has the necessary parts on it. The configuration, logging, and status reports are all available through the MBED flash drive when attached to any computer via USB.
PC Setup¶
The demo program does not emulate DHCP, so the interface that is connected to the MBED via ethernet should be configured with a static IP address. Consult your operating system documentation for how to do this.
Configuration¶
The demonstration program reads a file off of the MBED flash drive called "ntcmd.txt" which has the following general format:
# comment command
The known commands are:
- ping
- portscan
- identify
Commands¶
ping
The ping command sends a ping to the attached host every 30 seconds and writes the status of its replies to the file "ping.txt" for each ping (the file is overwritten every time).
portscan
The port scan command sends a TCP connection request to every legal port on the attached host system and writes the results of the port scan to the file "portscan.txt".
identify
The identify command writes the host IP address and MAC address to the file "identity.txt".
Log¶
All major actions and status reports by the tool are written to "nettool.log".