Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ARM).Porting TCP-IP programmer's guide.Ver 1.4.pdf
Скачиваний:
31
Добавлен:
23.08.2013
Размер:
2.79 Mб
Скачать

Introduction

1.3ARM TCP/IP requirements

Before beginning a port, you must ensure that the necessary resources are available in the target environment. There must be:

a processor with spare CPU capacity (see CPU requirements on page 1-9) with an operating system

a debug monitor

RAM

a network interface.

The exact size of these resources varies depending on the features you plan to implement, the performance you require, and how many simultaneous users you need to support.

The following is a brief summary of services that ARM TCP/IP requires from the system:

at least one network interface device

a timer that ticks at least once a second

memory, processing power, and operating system requirements, which are detailed in this section.

1.3.1Memory requirements

It is not possible to provide exact memory requirements, however an estimate can be obtained by examining the results provided by the examples. The values provided in Table 1-1 on page 1-8 are from the MailDemo example (maildemo on page 12-6) using IP, TCP, and PPP. The code was compiled for the ARM7TDMI processor core with the ARM Software Development Toolkit, version 2.50 and was optimized for code size rather than speed.

The majority of the ipport.h build options (such as, routing, NPDEBUG, NET_STATS, and DHCP) are not defined, so the sizes shown in the table below are smaller than if they had been defined. Packet buffers, which are allocated from the heap at initialization time, are not included in these figures.

Note

The values in Table 1-1 may change with subsequent releases because the code is subject to continuous development.

ARM DUI 0079B

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

1-7

Introduction

Table 1-1 ARM7TDMI memory requirements (values shown in bytes)

 

ARM

Thumb

 

 

 

 

 

 

code and

code and

Read-

Zero-init

ARM

Thumb

RAM

 

read-only

read-only

write data

data

ROM

ROM

 

 

 

data

data

 

 

 

 

 

 

 

 

 

 

 

 

 

ARP

2392

1668

28

224

2420

1696

252

 

 

 

 

 

 

 

 

DHCP client

2284

1548

52

300

2336

1600

352

 

 

 

 

 

 

 

 

DNS

3224

2376

40

3276

3264

2416

3316

 

 

 

 

 

 

 

 

ICMP

1588

1100

4

104

1592

1104

108

 

 

 

 

 

 

 

 

IP

7372

5068

72

772

7444

5140

844

 

 

 

 

 

 

 

 

UDP

4812

3492

24

1472

4836

3516

1496

 

 

 

 

 

 

 

 

Sockets API

9028

6028

0

0

9028

6028

0

 

 

 

 

 

 

 

 

TCP

18208

12556

208

332

18416

12764

540

 

 

 

 

 

 

 

 

Miscellaneous

10956

8476

328

4188

11284

8804

4516

routines

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Totals

59864

42312

756

10668

60620

43068

11424

 

 

 

 

 

 

 

 

The compilers place read-only data items, such as strings and constants, into the read-only code area. Therefore, the memory requirements for the code area include these constant data items. When designing your system, you will need to estimate the amount of ROM and RAM required:

The ROM requirement is the sum of the read-only area and the read-write data (the read-write data has pre-initialized values).

The RAM requirement is the sum of the read-write data and the zero-init data, plus the dynamic memory requirements of the system (for example, network buffers).

TCP and sockets use a large portion of memory. Systems that require only IP and User Datagram Protocol (UDP) services (such as routers and SNMP agents) can remove the TCP and sockets layers to reduce memory requirements.

1-8

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

ARM DUI 0079B

Introduction

1.3.2CPU requirements

It is not possible to provide exact processing power requirements. An SNMP agent must be able to reply to SNMP management station requests before the station times out. If the station sends only one request per second and allows one second for the reply, even the slowest processor or micro-controllers should be adequate. However, in practice, the stations sometimes send packets in bursts and the agent CPU may have tasks other than SNMP to perform.

It is recommended that you consider similar systems when you assess your processing power requirements. For embedded agents, the example code is intended to provide a starting point. Protocols can be tested under loads on the various available processors. To determine the effect of heavy network traffic on the performance of the system, other processes can be run simultaneously with the stack.

Table 1-2 contains throughput performance figures that have been obtained by using the ARMulator in conjunction with the Loopback example (see loopback on page 12-5). The Loopback code simulates a perfect network interface (either Ethernet or PPP). This simulation allows the performance of the TCP, UDP, and PPP code to be measured, independent of the network interfaces.

The Loopback code sends and receives a number of fixed-size packets, and the ARMulator is used to count the number of cycles required. This information is collated for multiple runs using different packet sizes, different numbers of packets, and different protocols.

For the purposes of these benchmark figures, it has been assumed that a perfect 32-bit, zero wait state memory interface is in use, that is:

I Cycles = S Cycles = N Cycles = 1 CPU Clock Cycle

It is recommended that you rerun these benchmarks, applying values for I, S, and N that are used by your target system. These values are set in the process.pl Perl script.

The values in Table 1-2 represent Kbits per second per MHz of CPU dedicated to this task. For example, to achieve 128Kb per second of TCP throughput using PPP on an ARM7TDMI-based system with a packet size of 100 bytes, you require 128/10.78, or about 12MHz of CPU performance.

ARM DUI 0079B

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

1-9

Introduction

Table 1-2 Throughput performance using ARMulator and the Loopback example (values shown in KB)

Packet

MAC

MAC

MAC

MAC

PPP

PPP

PPP

PPP

TCP

TCP

UDP

UDP

TCP

TCP

UDP

UDP

size

ARM

Thumb

ARM

Thumb

ARM

Thumb

ARM

Thumb

 

 

 

 

 

 

 

 

 

 

4

2.65

2.26

5.33

4.54

0.81

0.68

1.98

1.66

 

 

 

 

 

 

 

 

 

10

6.62

5.57

13.06

11.40

1.96

1.64

4.51

3.82

 

 

 

 

 

 

 

 

 

33

21.51

18.35

43.41

36.62

5.70

4.78

11.39

9.51

 

 

 

 

 

 

 

 

 

100

63.40

54.11

124.90

106.10

12.87

10.78

20.25

16.89

 

 

 

 

 

 

 

 

 

333

193.00

162.40

361.10

305.50

23.66

19.77

29.02

24.17

 

 

 

 

 

 

 

 

 

1000

462.60

393.00

775.20

661.90

31.71

26.45

33.88

28.27

 

 

 

 

 

 

 

 

 

1-10

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

ARM DUI 0079B