samplicator(8)

πŸ“¦ version 1.3.8rc1+git.20171112, in opensuse-leap 16.0

πŸ’… samplicator(8) β€” like, the whole manual, bestie

okay so before we even start: this is the samplicator page from section 8 of the manual, and it's genuinely one of the most useful little gremlins in networking. sit down, grab a boba, we're learning packet stuff 🧚✨


🌸 NAME 🌸

samplicator β€” a UDP packets forwarder and duplicator. yes. both. it forwards AND duplicates, it's an overachiever and we love that for it 🫢


✨ SYNOPSIS ✨

samplicator [-p port] [-s address] [-d level] [-b size] [-n] [-S] [-x delay] [-c config] [-f] [-h] A.B.C.D[/port[/freq][,ttl]]

that's the whole shape of it. flags, then one destination spec at the end. the destination spec is doing a lot of work tbh, we'll get to it πŸ’€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: samplicator is a simple program. it listens for UDP datagrams β€” think NetFlow, sFlow, SNMP Trap, Syslog, the whole lil friend group β€” on a network port, and then it sends copies of those datagrams on to a set of destinations. iconic behaviour, no notes πŸ‘‘

and then it gets extra, because optionally it can do sampling, meaning: instead of forwarding every single packet, it forwards only 1 in N. so you're not drowning your poor downstream collector, you're giving it a tasteful curated feed. slay.

another option, and this one is main character energy fr: it can "spoof" the IP source address, so that the copies appear to come from the original source rather than from the relay. so downstream thinks it's talking directly to the origin. sneaky. effective. 🌈


πŸŽ€ OPTIONS πŸŽ€

these are the command-line options the server accepts. one bullet per flag, no skips, we don't do that here:

  • -p port β€” UDP port to accept flows on. default is 2000. πŸ“
  • -s address β€” interface address to accept flows on. default is any (so, like, all of them, she's flexible).
  • -d level β€” debug level. more level, more lore.
  • -b size β€” set socket buffer size. default is 65536.
  • -n β€” don't compute the UDP checksum (leave it at 0). living dangerously, honestly πŸ’€
  • -S β€” maintain (spoof) source addresses. this is the shapeshifter one ✨
  • -x delay β€” transmit delay in microseconds. yes, *micro*seconds. she's precise.
  • -c config β€” specify a config file to read. (there's a whole CONFIG section below, don't worry, we'll get there 🫢)
  • -f β€” fork program into background. bye bestie, she's going to live in the bg now.
  • -h β€” print this usage message and exit. the classic cry-for-help flag.

and then the positional bits, which are also extremely important so don't scroll past them:

  • A.B.C.D β€” is the receiver's IP address.
  • port β€” is the UDP port to send to. default is 2000.
  • freq β€” is the sampling rate. default is 1.
  • ttl β€” is the sending packets TTL value. default is 64.
ngl the destination argument is a little nest of slashes and commas: A.B.C.D[/port[/freq][,ttl]]. read it slowly, it's fine, i promise 😭

πŸ’œ CONFIG πŸ’œ

the config file has its own lil grammar, and it's this:

A.B.C.D[/E.F.G.H]: receiver

let's break down the players:

  • A.B.C.D β€” is the senders IP address. (yes, it says "senders". we're quoting the vibe here.)
  • E.F.G.H β€” is a mask to apply to the sender. default is 255.255.255.255.
  • receiver β€” is the IP address of receiver. the final destination, the end of the journey, the chosen one ⭐

πŸ”₯ NOTES πŸ”₯

  • samplicator currently only supports IPv4. so if you came here looking for IPv6, she is not ready for that conversation yet πŸ™ˆ
  • receivers specified on the command line will get all packets.
  • receivers specified in the config will get only packets with a matching source.

that distinction is lowkey the whole personality of the program, so, like, remember it πŸ’…


🌸 FILES 🌸

  • /usr/sbin/samplicate

(yes, spelled like that, exactly like that, we do not correct it, we respect it πŸ‘‘)


🌟 AUTHOR 🌟

samplicator was originally written by Simon Leinen <simon.einen@gmail.com>.

this manual page was written by Vladimir Pavljuchenkov <spiderx@spiderx.dp.ua> for Gentoo Linux (and may be used by others).

both of them? legends. absolute icons. we stan πŸŒˆπŸ’–


πŸŽ€ the lil sign-off πŸŽ€

that's the whole page, bestie β€” this was samplicator(8) from the samplicator source, dated February 25, 2013. old but gold, fr fr. now go forward some packets πŸ’…βœ¨πŸ¦‹