Time to Live (TTL) is a number that indicates how many hops (router passes) the packet can make before it dies. Usually, at each router, a packet is analyzed, and based on the information present at that router on other neighboring routers, a choice is made as to which route is best. The packet is then forwarded to that next router. In this configuration, a packet may well go round. There is also flooding as another method, which implies sending a copy of the packet to each neighboring router; then, only the target machine consumes the packet. Other packets will keep roaming. TTL is a number, typically 255, which decreases each time a packet passes a router. This way, redundant packets will ultimately die once the TTL reaches zero.
The header checksum is a number used for error detection and correction during packet transmission. The data in the packet is fed into a mathematical algorithm. The resulting sum travels with the data in the packet. Upon reception, this sum is calculated again using the same algorithm. If it is the same as the original sum, the data is good. Otherwise, it is considered corrupt, and the packet discarded.
The payload is the actual data being carried. Notice that data payload can be up to 64 KiloBytes, which is enormous compared to the totality of the header bits.
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.
Internet Protocol being a layer-3 protocol (OSI) takes data Segments from layer-4 (Transport) and divides it into packets. IP packet encapsulates data unit received from above layer and add to its own header information.
The encapsulated data is referred to as IP Payload. IP header contains all the necessary information to deliver the packet at the other end.
IP header includes many relevant information including Version Number, which, in this context, is 4. Other details are as follows −
Do'stlaringiz bilan baham: |