Sending data with PACKET_MMAP and PACKET_TX_RING is slower than “normal” (without)

Many interfaces to the linux kernel are not well documented. Or even if they seem well documented, they can be pretty complex and that can make it hard to understanding what the functional or, often even harder, nonfunctional properties of the interface are. For this reason, my advice to anyone wanting a solid understanding of … Read more

UDP checksum calculation

The UDP checksum is performed over the entire payload, and the other fields in the header, and some fields from the IP header. A pseudo-header is constructed from the IP header in order to perform the calculation (which is done over this pseudo-header, the UDP header and the payload). The reason the pseudo-header is included … Read more

Why does a SOAP message have to be sent over HTTP?

Overview SOAP is a messaging protocol and in a nutshell is just another XML language. Its purpose is the data exchange over networks. Its concern is the encapsulation of these data and the rules for transmitting and receiving them. HTTP is an application protocol and SOAP messages are placed as the HTTP payload. Although there … Read more

How can I determine network and broadcast address from the IP address and subnet mask?

Let’s write both in binary: 130.45.34.36 = 10000010.00101101.00100010.00100100 255.255.240.0 = 11111111.11111111.11110000.00000000 A bitwise AND between the two would give us the network address: 10000010.00101101.00100010.00100100 (ip address) AND 11111111.11111111.11110000.00000000 (subnet mask) = 10000010.00101101.00100000.00000000 = 130.45.32.0 (the resulting network address) A bitwise OR between the network address and the inverted subnet mask would give us the broadcast … Read more

Adding support for IPv6 in IPv4 client/server apps – sin6_flowinfo and sin6_scope_id fields?

The best way to go is to use getaddrinfo(). Pseudo code: struct addrinfo *restrict hints = { .ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM }; struct addrinfo * res, r; if (0 == getaddrinfo(“foo.bar.baz”, “http”, &hints, &res)) { for (r=res; r; r=r->ai_next) { sock = socket(r->ai_family, r->ai_socktype, r->ai_protocol); connect(sock, r->ai_addr, r->ai_addrlen); if error: continue break } … Read more

techhipbettruvabetnorabahisbahis forumueduedueduseduedusedusedusedusedusedu