On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTIP-32
RTIP-32 Programming Manual
Introduction
TCP/IP Networking
IP Packet Types
Sockets, IP, and Port Addresses
Blocking and Non-Blocking Sockets
MTU, MSS, and DCU
Fragmentation
UDP
TCP
IGMP
Routing Table
ARP
NAT
Programming with RTIP-32
Demo Programs
PPP
DHCP Client
DHCP Server
FTP Client
FTP Server
TFTP Client
TFTP Server
Telnet Client
Telnet Server
Web Server
SNMP Agent
POP3 Client
SMTP Client
SNTP Client
SMB Server
SMB Client
SMB3 Server
SMB3 Client
WLAN Driver
RTIP-32 Reference Manual
RTPEG-32
RTUSB-32
|
IP Packet Types
RTIP-32 supports the following packet types:
- UDP. UDP is an unreliable transport system used to transfer data between machines. When data is sent, the only thing that is guaranteed is the packet was sent out on the wire. Any reliability checking needs to be done at the application layer (or by using TCP). Also, UDP preserves message boundaries set by sends, i.e. if send is called twice with data sizes 1000 and 2000 then two packets will be sent of sizes 1000 and 2000 (assuming the MTU size for the network is large enough). If send is called with a data size larger than the MTU value, the packet will be fragmented. When the remote host calls receive twice with sizes 100 and 150, the first call will return the first 100 bytes of the 1000 byte packet and throw away the last 900 bytes. The second call will return the first 150 bytes of the 2000 byte packet and throw away the last 1850 bytes.
- RAW. RAW is similar to UDP. The only differences are:
- The UDP protocol field has a fixed value whereas RAW sockets can bind to any protocol number.
- UDP packets have a protocol header; RAW packets do not.
- RAW data which is read, includes the IP header; UDP data read does not include IP or UDP headers.
- RAW input packets are delivered to all sockets of the same protocol type and IP address whereas UDP packets are delivered to only one connected or listener socket with matching IP and port address.
- TCP. TCP is a reliable transport system. When data is sent, it is guaranteed the remote host will get the data. Also, TCP is a stream protocol, i.e. TCP does not maintain boundaries between sends. For example, if send is called twice with sizes 1000 and 2000, all 3000 bytes will be sent but not necessarily in two packets of data size 1000 and 2000. It is possible that a single packet with a data size of 3000 bytes will be sent or even six packets with a data size of 500, or other combinations. This is transparent to the application layer. When the remote host calls receive, data will be returned without discarding any data.
- ICMP. ICMP is a protocol used to send control and error information between hosts. Error messages include destination unreachable (address specified in message does not exist), parameter problem (one of the fields in a message was invalid), etc. Control messages include source quench (slow down transmission of packets) and PING messages (echo requests/responses). PING messages are invaluable as a method to determine whether a remote host is alive. See function cb_error_report_fnc which summarizes all ICMP messages except PING.
- IGMP. IGMP is a protocol which provides multicast router information about multicast addresses on a network. This allows the multicast router to forward multicast packets to remote networks. RTIP-32 is not a multicast router but does support host side IGMP. The host side IGMP sends reports when it joins a multicast group and in response to queries from a multicast router. See Section IGMP for more information.
TCP/IP Networking
Sockets, IP, and Port Addresses
|