2 network protocols – Sensoray 2600 User Manual

Page 7

Advertising
background image

2600 Family Instruction Manual

2

Chapter 1 : Introduction

1.2 Network Protocols

The MM implements a high-performance 16-bit UDP/IP stack
in firmware. This stack includes standard network protocols
that are supported by virtually all operating systems:

• IP - foundation for other supported network protocols.

• UDP - used to convey all gateway and server traffic

between the MM and its Ethernet client. UDP is
employed because it enables significantly higher
performance than TCP and because embedded networks
are more reliable than general-purpose LANs and WANs.

• ICMP - provides support for network diagnostics such as

“ping” utilities.

• ARP - provides address resolution service for the Ethernet

client.

In addition, the MM firmware includes a multi-threaded server
process that runs on top of UDP to enable it to provide I/O and
communications services to one or more Ethernet clients.

1.2.1 UDP Encapsulation

The User Datagram Protocol (UDP) is used to transport
commands and replies between the Ethernet client and the
MM. A command packet is the payload portion of a UDP
datagram that is sent from the client to the MM. A response
packet
is the payload portion of a UDP datagram that is sent
from the MM to the client.

Every command/response packet (see Figure 2) is encapsulated
in a single UDP payload. The UDP payload is completely
populated by the encapsulated command/response packet. The
MM determines the total number of bytes in a command packet
by examining the UDP payload length in the command
packets’s UDP header. In a similar fashion, the Ethernet client
may determine the size of the response packet by means of the
response packet’s UDP header.

Figure 2: UDP Datagram Structure

Since Ethernet is the physical layer employed by the MM, the
maximum size of a framed UDP/IP packet is limited to 1500
bytes. In a particular application, however, the practical upper
limit of packet size may be less than 1500 bytes due to
real-time constraints dictated by the application system.

1.2.2 UDP Port Numbers

The MM listens at five different UDP ports. Each of these
ports is dedicated to a specific communication resource on the
MM as shown in Table 1.

The IOM gateway, and therefore all connected IOMs, are
accessed through a single UDP port (port 10000). Each serial
communication port is independently accessible by means of
its own dedicated UDP port.

The Ethernet client specifies the UDP port that will be used,
and hence the resource that will be accessed, when it sends a
UDP datagram to the MM.

When the MM receives a UDP datagram at any of its five
supported UDP ports, the MM assumes the datagram contains
a command packet and processes it accordingly. For example,
any UDP datagrams addressed to UDP port 10001 will be
directed to the first serial communication port on the MM. The
MM directs each response packet to the command originator’s
IP address and UDP port number.

Any UDP datagram that is directed to the MM’s IP address,
but has an unsupported UDP port number, will be dropped.

1.2.3 Resource Threads

Each of the MM’s five communication resources is allocated a
dedicated thread in the MM’s local execution environment.
These threads may (but are not required to) correspond to
separate execution threads running on the Ethernet client.

Up to five resource threads can be made to execute
concurrently, one per resource. For example, one thread might
be communicating with a serial I/O device while at the same
time another thread is interacting with the IOM gateway.

A resource thread is launched upon receipt of a command
packet. The thread to be launched is determined by the UDP
port number associated with the command packet. A resource
thread is terminated upon transmission of its affiliated response
packet or in response to a hardware reset on the MM.

Each resource is limited to a single thread in the MM’s
environment. The client may issue a command packet to a
resource that is currently executing its thread, but the
command packet will be queued and not acted upon until the
original thread terminates. This feature makes it possible for
multiple Ethernet clients to access the module network.

UDP Datagram

Command Packet

Response Packet

UDP Header

UDP Payload

Command Packet

Response Packet

Table 1: UDP Port Numbers Used by the MM

UDP Port

MM Communication Resource

10000

IOM gateway

10001

MM serial communication port 1

10002

MM serial communication port 2

10003

MM serial communication port 3

10004

MM serial communication port 4

Advertising