Frame Intertransmission Delay for Different Frame Sizes

For some analysis I plotted the inter-frame delay in microseconds within the transmitter must send a frame to archive the desired transmission rate. For a 10Gbit network adapter and a 10 byte frame the time between subsequent transmission must be 0.008 microseconds (or 8 nanoseconds or 8e^-09^ seconds) The illustration with a logarithmic y scale: Not really thrilling or exciting, I generated the images to illustrate the difficulties to generate a bandwidth exact bytestream where the operating system as well as hardware components are working at the edge....

July 27, 2010 · 1 min · Hagen Paul Pfeifer

Interactive TCP Traffic and Delayed ACKs

Interactive TCP traffic - like telnet - is often single byte character interactions: a pressed key, encoded via a char data type, is transmitted to the server, processed at the server side and echoed back to the client. These days telnet can be considered as antiquated because of security shortcomings and the Secure SHell step into telnets shoes. The one byte transmission is expanded to a ~32 byte chunk because of cryptography overhead....

July 21, 2010 · 4 min · Hagen Paul Pfeifer

UDP TX and RX Delays

The following image illustrates the accumulated delays during the transmission of UDP packets. Starting with a 1 second sleep with theoretical no delay, but practical delay of ~200 microseconds on a un-busy box till due to timer granularity and concurrent processes (not in this scenario), till transmission delays via intermediate routers, NIC interrupt moderation and finally RX side scheduler latency. !http://blog.jauu.net/2010/07/20/UDP-TX-and-RX-Delays/udp-rx-tx-delay-thumb.png!

July 20, 2010 · 1 min · Hagen Paul Pfeifer

Increasing TCPs Initial Congestion Window

Noting really special today, … except that it is time for another debate about the increase of the initial CWND from currently max. 4 to N. Where N differs from month to month and vendor to vendor. Currently standard TCP is not seasoned to meet the new network environments. There are still networks with a BDP from 1980 - MANET, Sensor Networks and so on are typical examples. Google press ahead the thematic mainly because a increased initial CWND instantly enhance the user experience for a typical web session....

July 15, 2010 · 1 min · Hagen Paul Pfeifer

UDP TX Buffer Behaviour and Egress Queueing

UDP sockets - if corking is disabled - always push packets directly to the lower layers. In the case of IPv4, @ip_output()@ will forward the packet to Netfilter where the firewall rules are applied. @ip_finish_output()@ calls @ip_finish_output2()@ which on his part calls neigh_hh_output() which put the cached layer 2 Ethernet header in front of skb and finally call @dev_queue_xmit()@. @dev_queue_xmit()@ queues the packet in the local egress queue - default is a FIFO queue (@pfifo_fast@) but sophisticated queuing strategies are available and often selected....

July 13, 2010 · 3 min · Hagen Paul Pfeifer

CRC 16 CCITT Performance

The CRC-16-CCITT is a cyclic redundancy check - one among many - defined and derived from polynomial x^16^ + x^12^ + x^5^ + 1. It is used by X.25, HDLC, XMODEM, bluetooth, phy header verification and many others. During some analysis I stumbled across the following implementation: unsigned char ser\_data; static unsigned int crc; crc = (unsigned char)(crc >> 8) | (crc << 8); crc ^= ser\_data; crc ^= (unsigned char)(crc & 0xff) >> 4; crc ^= (crc << 8) << 4; crc ^= ((crc & 0xff) << 4) << 1; The expression @(crc « 8) « 4@ quizzicaled me a little bit because @crc«12@ seems more efficient and is mainly equivalent....

July 12, 2010 · 2 min · Hagen Paul Pfeifer

When the CRC and TCP Checksum Disagree

This post recycles the title of a famous paper from “Craig Partridge and Jonathan Stone”:http://www.cc.gatech.edu/classes/AY2002/cs8803d_spring/papers/checksum.pdf from 2000. Traces shows that between 1 packet in 1100 and 1 packet in 32000 fails the TCP checksum - even thought a link layer CRC was used. The TCP/UDP checksum is also ineffective at detecting bus specific errors since these errors with simple summations tend to be self canceling. The paper is worth to read it: it talk about the sources of errors, how TCP react and how to reduce the error rate....

July 11, 2010 · 3 min · Hagen Paul Pfeifer

Bluethooth Over WiFi

Bluetooth (IEEE 802.15.1) is a clean wireless industry standard using the ISM band (between 2,402 GHz and 2,480 GHz). Version 2.0 + EDR (Enhanced Data Rate) provides a practical data transfer rate up to 2.1 megabits per second. This sounds huge compared to Version 1.0 but practical is can be really awkward if you want to transfer large files. Version 3 of the core specification add a clever extension to increase the data rate: it enables the possibility to use the (hopefully available) WiFi link to transfer data....

July 8, 2010 · 1 min · Hagen Paul Pfeifer

Tracing and Time Measurements

In user-space the answer is often simple: use @gettimeofday@ if microseconds resolution is sufficing. Another often used mechanism is to use the time stamp counter - but as mentioned in another blog-post in the lion share of all use cases the advice is often too narrow because of clock variances in SMP/CMP systems and hibernation issues. #define rdtscll(val) \ \_\_asm\_\_ \_\_volatile\_\_("rdtsc" : "=A" (val)) In kernel-space the timing capabilities are a little bit more complex and several functions are provided....

July 7, 2010 · 1 min · Hagen Paul Pfeifer

Libhashish Cacheline Optimization for SMP Systems

Today I spoted some cacheline misses triggered due to some false sharings in libhashish My CPU model (athlon 64 X2 dual-core) has the following cache and memory structure: instruction cache, data cache, instruction TLB, data TLB, L2 data TLB, L2 instruction TLB and a unified L2 cache, each core (no shared L3-Cache): L1-DTLB: 4K byte pages, fully associative 32 entries (2M/4M pages: 8 entries) L1-ITLB: 4K byte pages, fully associative 32 entries (2M/4M pages: 8 entries) L2 DTLB: 4K byte pages, 4-way associative....

July 1, 2010 · 5 min · Hagen Paul Pfeifer