The D.SignT TCP/IP stack for the D.Module2.DM642 has been specifically tailored for DSP systems. No underlying RTOS (real-time operating system) is required, but the software can nevertheless be executed as a task in any RTOS.
The "working horse" of the TCP/IP stack is function net_isq(). This function handles all the background tasks, e.g. ARP requests, IP fragmentation, TCP-handshake, etc. net_isq() must be called regularly in your program - either as a part of your main program loop, a timer-initiated periodic call, or as a periodic task. This allows to grant your signal-processing tasks as much CPU time as required, and leave the remainder to network communications.
Special care has been taken to minimize memory transfer operations. Whereas most TCP/IP stacks use so-called netbuffers for intermediate data storage, the D.SignT TCP/IP stack transmits and receives data directly from and to user-provided buffers, avoiding additional memory copy operations.
This approach guarantees optimum performance, but programmers used to the Berkeley socket architecture for TCP/IP stacks must observe some differences in the receive and transmit functions and in establishing a TCP connection.
The maximum number of connections is only limited by the available memory. Whereas an operating-system based TCP/IP stack will create child processes to handle multiple network connections virtually simultaneous, the D.SignT TCP/IP stack processes multiple connections sequentially. This involves slightly increased connection times, but since DSP applications do not need to handle hundreds of simultaneous connections in parallel (like a PC web server for example) no adverse side effects will be noticeable.
To use the D.SignT TCP/IP library with ARP, ICMP, IP, UDP, TCP, DHCP and DNS support in your program, include file net.h and link the library net.lib to your project.
In addition to this required basis protocols, the following libraries must be included if necessary to enable higher protocols
Refer to RFC1122 for feature details
IP Layer ===================================================== FEATURE | | -------------------------------------------------| |- | | Implement IP and ICMP |x| Handle remote multihoming in application layer | | Support local multihoming | | Meet gateway specs if forward datagrams |x| Configuration switch for embedded gateway |x| Config switch default to non-gateway |x| Auto-config based on number of interfaces |x| Able to log discarded datagrams | | Record in counter | | | | Silently discard Version != 4 |x| Verify IP checksum, silently discard bad dgram |x| Addressing: | | Subnet addressing (RFC-950) |x| Src address must be host's own IP address |x| Silently discard datagram with bad dest addr |x| Silently discard datagram with bad src addr |x| Support reassembly |x| Retain same Id field in identical datagram |x| | | TOS: | | Allow transport layer to set TOS |x| Pass received TOS up to transport layer |x| Use RFC-795 link-layer mappings for TOS | | TTL: | | Send packet with TTL of 0 | | Discard received packets with TTL < 2 | | Allow transport layer to set TTL | | Fixed TTL is configurable |x| | | IP Options: | | Allow transport layer to send IP options | | Pass all IP options rcvd to higher layer | | IP layer silently ignore unknown options |x| Security option | | Send Stream Identifier option | | Silently ignore Stream Identifer option |x| Record Route option | | Timestamp option | | Source Route Option: | | Originate & terminate Source Route options | | Datagram with completed SR passed up to TL | | Build correct (non-redundant) return route | | Send multiple SR options in one header | | | | ICMP: | | Silently discard ICMP msg with unknown type |x| Include more than 8 octets of orig datagram | | Included octets same as received | | Demux ICMP Error to transport protocol | | Send ICMP error message with TOS=0 | | Send ICMP error message for: | | - ICMP error msg | | - IP b'cast or IP m'cast | | - Link-layer b'cast | | - Non-initial fragment | | - Datagram with non-unique src address | | Return ICMP error msgs (when not prohibited) | | | | Dest Unreachable: | | Generate Dest Unreachable (code 2/3) | | Pass ICMP Dest Unreachable to higher layer | | Higher layer act on Dest Unreach | | Interpret Dest Unreach as only hint | | Redirect: | | Host send Redirect | | Update route cache when recv Redirect | | Handle both Host and Net Redirects | | Discard illegal Redirect | | Source Quench: | | Send Source Quench if buffering exceeded | | Pass Source Quench to higher layer | | Higher layer act on Source Quench | | Time Exceeded: pass to higher layer | | Parameter Problem: | | Send Parameter Problem messages | | Pass Parameter Problem to higher layer | | Report Parameter Problem to user | | | | ICMP Echo Request or Reply: |x| Echo server and Echo client |x| Echo client |x| Discard Echo Request to broadcast address | | Discard Echo Request to multicast address | | Use specific-dest addr as Echo Reply src | | Send same data in Echo Reply |x| Pass Echo Reply to higher layer |x| Reflect Record Route, Time Stamp options | | Reverse and reflect Source Route option | | | | ICMP Information Request or Reply: | | ICMP Timestamp and Timestamp Reply: | | Minimize delay variability | | Silently discard b'cast Timestamp | | Silently discard m'cast Timestamp | | Use specific-dest addr as TS Reply src | | Reflect Record Route, Time Stamp options | | Reverse and reflect Source Route option | | Pass Timestamp Reply to higher layer | | Obey rules for "standard value" | | | | ICMP Address Mask Request and Reply: | | Addr Mask source configurable | | Support static configuration of addr mask | | Get addr mask dynamically during booting | | Get addr via ICMP Addr Mask Request/Reply | | Retransmit Addr Mask Req if no Reply | | Assume default mask if no Reply | | Update address mask from first Reply only | | Reasonableness check on Addr Mask | | Send unauthorized Addr Mask Reply msgs | | Explicitly configured to be agent | | Static config=> Addr-Mask-Authoritative flag | | Broadcast Addr Mask Reply when init. | | | | ROUTING OUTBOUND DATAGRAMS: | | Use address mask in local/remote decision | | Operate with no gateways on conn network | | Maintain "route cache" of next-hop gateways | | Treat Host and Net Redirect the same | | If no cache entry, use default gateway |x| Support multiple default gateways | | Provide table of static routes | | Flag: route overridable by Redirects | | Key route cache on host, not net address | | Include TOS in route cache | | | | Able to detect failure of next-hop gateway | | Assume route is good forever | | Ping gateways continuously | | Ping only when traffic being sent | | Ping only when no positive indication | | Higher and lower layers give advice | | Switch from failed default g'way to another | | Manual method of entering config info | | | | REASSEMBLY and FRAGMENTATION: | | Able to reassemble incoming datagrams |x| At least 576 byte datagrams |x| EMTU_R configurable or indefinite | | Transport layer able to learn MMS_R | | Send ICMP Time Exceeded on reassembly timeout | | Fixed reassembly timeout value |x| | | Pass MMS_S to higher layers | | Local fragmentation of outgoing packets |x| Else don't send bigger than MMS_S | | Send max 576 to off-net destination | | All-Subnets-MTU configuration flag | | | | MULTIHOMING: | | Reply with same addr as spec-dest addr | | Allow application to choose local IP addr | | Silently discard d'gram in "wrong" interface | | Only send d'gram through "right" interface | | | | SOURCE-ROUTE FORWARDING: | | Forward datagram with Source Route option | | Obey corresponding gateway rules | | Update TTL by gateway rules | | Able to generate ICMP err code 4, 5 | | IP src addr not local host | | Update Timestamp, Record Route options | | Configurable switch for non-local SRing | | Defaults to OFF | | Satisfy gwy access rules for non-local SRing | | If not forward, send Dest Unreach (cd 5) | | | | BROADCAST: | | Broadcast addr as IP source addr |x| Receive 0 or -1 broadcast formats OK | | Config'ble option to send 0 or -1 b'cast | | Default to -1 broadcast |x| Recognize all broadcast address formats |x| Use IP b'cast/m'cast addr in link-layer b'cast | | Silently discard link-layer-only b'cast dg's | | Use Limited Broadcast addr for connected net | | | | MULTICAST: | | Support local IP multicasting (RFC-1112) |x| Support IGMP (RFC-1112) | | Join all-hosts group at startup | | Higher layers learn i'face m'cast capability | | | | INTERFACE: | | Allow transport layer to use all IP mechanisms | | Pass interface ident up to transport layer |x| Pass all IP options up to transport layer | | Transport layer can send certain ICMP messages | | Pass spec'd ICMP messages up to transp. layer | | Include IP hdr+8 octets or more from orig. | | Able to leap tall buildings at a single bound | | UDP Layer ===================================================== FEATURE | | -------------------------------------------------| |- | | UDP send Port Unreachable |x| | | IP Options in UDP | | - Pass rcv'd IP options to applic layer |x| - Applic layer can specify IP options in Send |x| - UDP passes IP options down to IP layer |x| | | Pass ICMP msgs up to applic layer |x| | | UDP checksums: | | - Able to generate/check checksum |x| - Silently discard bad checksum |x| - Sender Option to not generate checksum |x| - Default is to checksum |x| - Receiver Option to require checksum |x| | | UDP Multihoming | | - Pass spec-dest addr to application | | - Applic layer can specify Local IP addr | | - Applic layer specify wild Local IP addr | | - Applic layer notified of Local IP addr used | | | | Bad IP src addr silently discarded by UDP/IP |x| Only send valid IP source address |x| UDP Application Interface Services | | Full IP interface of 3.4 for application |x| - Able to spec TTL, TOS, IP opts when send dg |x| - Pass received TOS up to applic layer |x| TCP Layer ===================================================== FEATURE | | -------------------------------------------------| |- | | Push flag | | Aggregate or queue un-pushed data |x| Sender collapse successive PSH flags |x| SEND call can specify PUSH | | If cannot: sender buffer indefinitely | | If cannot: PSH last segment |x| Notify receiving ALP of PSH |x| Send max size segment when possible |x| | | Window | | Treat as unsigned number |x| Handle as 32-bit number | | Shrink window from right | | Robust against shrinking window |x| Receiver's window closed indefinitely | | Sender probe zero window |x| First probe after RTO |x| Exponential backoff |x| Allow window stay zero indefinitely |x| Sender timeout OK conn with zero wind | | | | Urgent Data | | Pointer points to last octet | | Arbitrary length urgent data sequence | | Inform ALP asynchronously of urgent data | | ALP can learn if/how much urgent data Q'd | | | | TCP Options | | Receive TCP option in any segment |x| Ignore unsupported options |x| Cope with illegal option length |x| Implement sending & receiving MSS option |x| Send MSS option unless 536 | | Send MSS option always |x| Send-MSS default is 536 | | Calculate effective send seg size | | | | TCP Checksums | | Sender compute checksum |x| Receiver check checksum |x| | | Use clock-driven ISN selection |x| | | Opening Connections | | Support simultaneous open attempts |x| SYN-RCVD remembers last state |x| Passive Open call interfere with others |x| Function: simultan. LISTENs for same port |x| Ask IP for src address for SYN if necc. |x| Otherwise, use local addr of conn. |x| OPEN to broadcast/multicast IP Address | | Silently discard seg to bcast/mcast addr |x| | | Closing Connections | | RST can contain data |x| Inform application of aborted conn |x| Half-duplex close connections | | Send RST to indicate data lost |x| In TIME-WAIT state for 2xMSL seconds |x| Accept SYN from TIME-WAIT state | | | | Retransmissions | | Jacobson Slow Start algorithm |x| Jacobson Congestion-Avoidance algorithm |x| Retransmit with same IP ident |x| Karn's algorithm | | Jacobson's RTO estimation alg. | | Exponential backoff |x| SYN RTO calc same as data |x| Recommended initial values and bounds |x| | | Generating ACK's: | | Queue out-of-order segments | | Process all Q'd before send ACK |x| Send ACK for out-of-order segment |x| Delayed ACK's |x| Delay < 0.5 seconds |x| Every 2nd full-sized segment ACK'd |x| Receiver SWS-Avoidance Algorithm |x| | | Sending data | | Configurable TTL |x| Sender SWS-Avoidance Algorithm |x| Nagle algorithm |x| Application can disable Nagle algorithm |x| | | Connection Failures: | | Negative advice to IP on R1 retxs |x| Close connection on R2 retxs |x| ALP can set R2 |x| Inform ALP of R1<=retxs<R2 |x| Recommended values for R1, R2 |x| Same mechanism for SYNs |x| R2 at least 3 minutes for SYN | | | | Send Keep-alive Packets: |x| - Application can request |x| - Default is "off" | | - Only send if idle for interval |x| - Interval configurable |x| - Default at least 2 hrs. | | - Tolerant of lost ACK's |x| | | IP Options | | Ignore options TCP doesn't understand |x| Time Stamp support | | Record Route support | | Source Route: | | ALP can specify | | Overrides src rt in datagram | | Build return route from src rt | | Later src route overrides | | | | Receiving ICMP Messages from IP | | Dest. Unreach (0,1,5) => inform ALP | | Dest. Unreach (0,1,5) => abort conn | | Dest. Unreach (2-4) => abort conn | | Source Quench => slow start | | Time Exceeded => tell ALP, don't abort | | Param Problem => tell ALP, don't abort | | | | Address Validation | | Reject OPEN call to invalid IP address | | Reject SYN from invalid IP address |x| Silently discard SYN to bcast/mcast addr |x| | | TCP/ALP Interface Services | | Error Report mechanism |x| ALP can disable Error Report Routine |x| ALP can specify TOS for sending |x| Passed unchanged to IP |x| ALP can change TOS during connection |x| Pass received TOS up to ALP |x| FLUSH call | | Optional local IP addr parm. in OPEN | |