Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
TLEM(1)			    General Commands Manual		       TLEM(1)

NAME
       tlem -- high speed, netmap based	link emulator (similar to dummynet)

SYNOPSIS
       tlem  [-i  port]	 [-B  bandwidth]  [-D delay] [-L loss] [-R reordering]
	     [-Q queue-size] [-C cpu-placement]	[-G gateway]  [-b  batch-size]
	     [-w   wait-link]	[-s   session-name]   [-a]   [-v]   [-q]  [-r]
	     [-M max-bw,max-delay,max-hold]

DESCRIPTION
       tlem implements a high speed bidirectional link emulator	between	netmap
       ports, capable of supporting rates up to	20 Mpps	/ 40 Gbit in each  di-
       rection.	  tlem	use  two  threads  per direction to achieve high speed
       while maintaining packet	ordering, and can enforce queue	size and  rate
       limitation, introduce deterministic or random delays and	packet losses,
       in a way	similar	to the popular dummynet(4) emulator.

       tlem differs from dummynet in the following ways:
          tlem	 only connects netmap ports, whereas dummynet sits between the
	   IP layer and	the network interface;
          tlem	does not provide packet	filtering,  whereas  dummynet  selects
	   traffic using the ipfw firewall;
          tlem	is 20-40 times faster than the in-kernel dummynet;
          tlem	 runs entirely in userspace, hence it is much easier to	modify
	   and extend.

       Command line options are	listed below. The -B, -D, -L, -Q  options  can
       omitted	(in  which  case  default values are used), specified once (in
       which case they affect both directions),	or twice (once per direction).

       -i port
	       Name of the netmap port.	It must	be supplied exactly  twice  to
	       identify	the two	ports that must	be interconnected.  Any	netmap
	       port  type  (physical  interface,  VALE	switch,	 pipe, monitor
	       port...)	 can be	used.

       -B bps |	constant,bps | ether,bps
	       Desired bandwidth, default to 0 (which means infinite)  if  not
	       specified.  bps is a floating point number optionally follow by
	       a  character  (k,  K,  m, M, g, G) that multiplies the value by
	       10^3, 10^6 and 10^9 respectively.  constant  (can  be  omitted)
	       means that the bandwidth	will be	computed with reference	to the
	       actual  packet  size  (excluding	CRC and	framing).  ether indi-
	       cates that the ethernet framing (160 bits) and  CRC  (32	 bits)
	       will be included	in the computation of the packet size.

       -D dt | constant,dt | uniform,dmin,dmax | exp,dmin,davg
	       Additional delay	in transmission, with constant,	uniform	or ex-
	       ponential distribution, defaults	to 0.  dt, dmin, dmax, avg are
	       times  expressed	 as floating point numbers optionally followed
	       by a character (s, m, u,	n) to indicate seconds,	 milliseconds,
	       microseconds, nanoseconds.  The delay is	adjusted so that there
	       is never	packet reordering.

       -L x | plr,x | ber,x
	       Optional	 packet	 or  bit error rate, defaults to 0.  Simulates
	       packet or bit errors, causing offending packets to be  dropped.
	       x is a floating point number indicating the packet or bit error
	       rate.

       -R const,p,t
	       Optional	packet reordering, defaults to none.  With probability
	       p incoming packets are hold for the given t amount of time. The
	       probability and time are	expressed as in	the loss and delay ar-
	       guments.

       -Q size
	       Queue size, size	is a number optionally followed	by k, K, m, M,
	       g,  G to	specify	the queue size in bytes, Kilobytes, Megabytes,
	       Gigabytes.  The queue is	used to	buffer incoming	packets	before
	       bandwidth limitations are applied.

       -C a[,b[,c,d]]
	       Indicates the cores on which the	four threads should be placed.
	       One, two	or four	values can be specified.

       -G ipv4-address
	       Indicates the optional default gateways to be  used  in	route-
	       mode.

       -w wait-link
	       indicates  the  number  of seconds to wait before transmitting.
	       It defaults to 2, and may be useful when	 talking  to  physical
	       ports  to  let link negotiation complete	before starting	trans-
	       mission.

       -s session-file
	       Enables client/server mode. The first  instance	of  tlem  that
	       successfully  creates and/or locks the session-file becomes the
	       server. Other tlem instances that use the same session-file  do
	       not  start  new emulations, but rather send their parameters to
	       the server. This	feature	can be used to dynamically change  the
	       emulation  parameters  of a running emulation. Please note that
	       the internal buffers are	not re-allocated,  and	therefore  the
	       dynamic	emulated delay and bandwidth can never exceed the val-
	       ues used	initially by the server. Alternatively,	the -M	option
	       can  be	used when starting the server to set the maximum band-
	       width, delay and	hold-time that can be accepted in  client  re-
	       quests.

       -a      Only  useful  in	client/server mode. Ask	the server to shutdown
	       and wait	until it terminates.

       -v      Increase	verbosity.

       -q      Decrease	verbosity.

       -b batch-size
	       Maximum batch size to use during	transmissions.	tlem  normally
	       transmits packets one at	a time,	but it may use larger batches,
	       up  to  the  value  specified with this option, when running at
	       high rates.

       -r      Enable route-mode.

       -M max-bw,max-delay,max-hold

	       Set the maximum bandwidth, delay	 and  packet-reordering	 hold-
	       time. The parameters are	only meaningful	for the	server process
	       when operating in client/server mode (see the -s	option).

OPERATION
       tlem  creates  two threads per direction, binds them to specific	cores,
       and uses	them to	read and write to the netmap ports.  A fifth thread is
       used to periodically display the	amount of traffic flowing in  each  of
       the two directions.

       The input thread	reads from a netmap port, and for each packet computes
       the  time  when it should exit the transmit queue according to the emu-
       lated bandwidth;	drops the packet if the	queue is full; further applies
       random drops according to the loss probability specified;  and  finally
       computes	 the transmit time applying the	additional delay.  Packets an-
       notated with their transmit  time  are  copied  in  a  large  in-memory
       buffer.	The output thread spins	on the buffer, doing short sleeps, un-
       til packets reach their transmit	time.

ROUTE-MODE
       In route-mode tlem operates as an IPv4 router between the  two  subnets
       at its ends, replying to	and sending the	necessary ARP messages and up-
       dating  the destination MAC addresses. The IP addresses and subnets are
       obtained	from the ports,	so this	mode cannot be used with software-only
       netmap ports like ephemeral VALE	ports and pipes.

       There are some limitations: unresolved destinations are sent as	broad-
       casts  until  resolution;  packets destined to the same subnet as their
       incoming	port are dropped; TTL is not  decremented.   Each  subnet  may
       also  optionally	 have  a default gateway: for each direction, incoming
       packets not destined to either of the two known subnets are sent	to the
       default gateway of the output port, if specified,  and  dropped	other-
       wise.

PERFORMANCE
       We  have	 measured speeds in excess of 20 Mpps and 40 Gbit/s per	direc-
       tion on a modern	i7 CPU with 4 cores.  The accuracy in delays is	in the
       order of	30-50us	provided that C	states higher than  C1	are  disabled,
       and  the	 CPU  clock  is	set to the maximum speed.  Performance depends
       heavily on memory speed and suitable NICs with native  netmap  drivers.
       See the paper below for more details.

SEE ALSO
       http://info.iet.unipi.it/~luigi/netmap/

       Luigi  Rizzo,  Giuseppe Lettieri, TLEM, very high speed link emulation,
       AsiaBSDCon 2016,	Tokyo, March 2016  http://info.iet.unipi.it/~luigi/re-
       search.html

AUTHORS
       tlem has	been written by	Luigi Rizzo at the Universita` di Pisa,	Italy.
       Route  mode and client/server operation has been	added by Giuseppe Let-
       tieri at	the Univerista`	di Pisa, Italy.

       This work has received funding from the European	Union's	 Horizon  2020
       research	 and  innovation programme 2014-2018 under grant agreement No.
       644866, and from	East Cost Datacom Inc.,	Rockledge, FL, USA.

FreeBSD	ports 15.quarterly     February	13, 2020		       TLEM(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=tlem&sektion=8&manpath=FreeBSD+Ports+15.0.quarterly>

home | help