1
Micriµm
© Copyright 2005-2007, Micriµm
All Rights reserved
µC/TTCP
Test TCP
User’s Manual
www.Micrium.com
Empowering Embedded Systems
2
Table of Contents
1.00 Introduction 3
1.01 Directories and Files 3
2.00 Network setup 5
3.00 PCATTCP 6
3.01 Network Analyzer (Sniffer) 7
4.00 µC/TTCP 8
4.01 µC/TTCP command line 8
4.02 TCP Transmit Test 10
4.03 TCP Receive Test 12
4.04 UDP Transmit Test 14
4.05 UDP Receive Test 16
5.00 µC/TTCP 18
5.01 TTCP Code, ttcp.c 18
5.02 TTCP startup code : main() 19
5.03 TTCP startup code : AppStartTask() 20
6.00 µC/TTCP module limitations 21
6.01 IP transmit fragmentation 21
6.02 Target performance 21
References 22
Contacts 22
3
1.00 Introduction
Test TCP or TTCP, is a test tool to perform TCP/IP or UDP/IP performance tests. TTCP is a command-
line sockets-based benchmarking tool for measuring performance between two systems. It was originally
developed in 1984 by Mike Muuss and Terry Slattery for the BSD operating system. The original TTCP
and sources are in the public domain, and copies are available from many anonymous FTP sites.
This document describes how to configure and use the µC/TTCP module in a µC/TCP-IP and µC/OS-II
environment.
We used the Cogent CSB337 single-board computer and IAR’s Embedded Workbench to demonstrate
the examples but other embedded platforms and tool chains can be used.
1.01 Directories and Files
The code and documentation of the µC/TTCP module are placed in a directory structure according to
“AN-2002, µC/OS-II Directory Structure”. Specifically, the files are placed in the following directories:
\Micrium\Software\uC-TTCP\Doc
This directory contains the µC/TTCP documentation files, including this one.
\Micrium\Software\uC-TTCP\Source
This directory contains the µC/TTCP source files (ttcp.c and ttcp.h).
\Micrium\Software\uC-LIB
This directory contains the µC/LIB source files, the Micrium version of the C library most used
utilities. The goal of this library is to ease a certification process by providing the source code and
documentation for all the functions. This directory contains:
lib_def.h
lib_mem.c
lib_mem.h
lib_str.c
lib_str.h
\Micrium\Software\uC-CPU
This directory contains the µC/CPU source files (cpu_def.h). This file provides definition for
byte alignment, endianess and critical section handling.
\Micrium\Software\uC-CPU\ARM\IAR
This directory contains the files to configure standard data types, cpu word configuration, critical
section configuration and cpu data types for the IAR compiler used for this sample project.
(cpu.h and cpu_a.s)
\Micrium\Software\EvalBoards\Cogent\CSB337\IAR\uC-APPs\Ex1
This directory contains the source code for Example #1 running on a Cogent CSB337 with IAR
tools. This directory contains:
app_cfg.c
includes.h
net_cfg.h
os_cfg.h
4
• app_cfg.c contains the application OS task priorities and stack space;
• includes.h contains a master include file used by the application;
• net_cfg.h is the µC/TCP-IP configuration file;
• os_cfg.h is the µC/OS-II configuration file;
This directory also contains the IAR EWARM 4.31a project workspace files:
Ex1.ewd
Ex1.ewp
Ex1.eww
\Micrium\Software\EvalBoards\Cogent\CSB337\IAR\BSP
This directory contains the Board Support Package (BSP) files and linker file for the project and
target development board used for the example used to demonstrate TTCP. This directory
contains:
bsp.c
bsp.h
CSB33z_lnk_ram.xcl
net_bsp.c
• bsp.c contains the board support functions for Interrupts, Timers, LEDs and Serial port;
• bsp.h contains the header definition for bsp.c;
• CSB33x_lnk_ram.xcl is the linker file for the IAR tool;
• net_bsp.c contains the low level interface functions for the Ethernet controller used in the sample
project;
5
2.00 Network setup
Even if TTCP stands for Test TCP, the TTCP module can perform the following tests:
• Transmitting TCP segments : also called TCP Client mode
• Receiving TCP segments : also called TCP Server mode
• Transmitting UDP datagrams : also called UDP Client mode
• Receiving UDP datagrams : also called UDP Server mode
TTCP always work in a peer to peer configuration.
In developing µC/TTCP we were always running on a Cogent CSB337 and we were using PCATTCP on
a PC.
F2-1
Network set-up
The target system is running Micrium µC/TTCP.
The Windows station also needs to run a TTCP application. The next section describes the Windows
TTCP implementation Micrium has selected.
`
Windows system
PCATTCP and Packet Capture (Sniffer)
10.10.10.101
Ethernet Hub or Switch
Cogent CSB337
10.10.10.64
JTAG
RS-232
`
Development system
Debugger and Termnial Window