Usually, the system takes over such work as constructing IP packet headers.

But in some cases, you want to design them in a non-standard way, for example, by specifying the address of another system as the sender's address or by simulating non-standard protocol behavior that causes a failure in the remote system.
Consider creating raw IP protocol layer packets from applications. The creation requires super user rights - root in *nix, administrator in NT/Win2K. On Win9x systems, any application can do this. In addition, winsock version 2.2 or higher is required in Win. A raw IP packet is sent from the application using the socket, setsockopt and sendto functions. Socket and sendto are called once, and sendto can be used any number of times to send any number of packets.
Socket call parameters: Socket(AF_INET, SOCK_RAW, IPPROTO_RAW). This means creating a descriptor that is not designed to automatically fill in IP-level headers. With other parameters, IP-level headers can be filled in automatically, and higher-level data is constructed by the application.
If the application calling this function does not have super user rights, then the socket function with these parameters returns an error. Next, set the descriptor parameter: setsockopt(fd, IPPROTO_IP, IP_HDRINCL, one,sizeof(one)). Fd - socket descriptor, IPPROTO_IP - IP level parameter management, IP_HDRINCL - the send buffer must start with the IP level header. One is a variable that should contain the value 1.The IP-level packet body can contain any data, usually higher-level protocols.
This data is not processed during packet transmission, it is processed only by the system for which it is intended. To send, the entire IP packet must be placed in a buffer and the sendto function must be called. The address specified in the sendto parameters has no special meaning, does not have to match the address inside the IP packet, and is used only to select which network interface to use to send the packet.An IP packet consists of a header containing a specific set of fields and a body. The packet is protected from distortion by a checksum located inside the header. If the checksum is incorrect, sendto returns an error. The IP packet header (ipv4) contains information about the sender's and recipient's address, data about the higher-level protocol, the protocol version itself (4), header length, data length, and packet lifetime.The sender's address is generally needed in order to know who to send the package can't be delivered responses to.
In addition, it can be used by higher-level protocols. For example, the TCP header does not contain the sender and recipient addresses, but takes them from the IP headers. Data about a lower-level protocol is needed to determine which protocol was used. In principle, it would be logical to place this information inside the body of the IP packet, but that's how the creators decided.The protocol version is provided in case a newer protocol similar to IP version 4 appears. Such a protocol already exists (IP version 6), but has not yet become widespread.
The lifetime (TTL, time to live) of a packet means the number of transfers from router to router that can survive the packet. Each router must reduce the TTL value by 1 and recalculate the checksum during packet transmission. Packets with TTL value=0 are ignored.
The lifetime field is needed in order to avoid endless packet forwarding with incorrectly configured routing.Examples of designing RAW packages for *nix in order to carry out an attack can be found on http://www.technotronic . Жители Белогорска устанавливают melbet приложение и проверяют счёт одной кнопкой. Связаться с операторами можно по телефону 8 (800) 775-43-21.