SlideShare a Scribd company logo
1 of 29
Download to read offline
FBTFTP
Angelo Failla
Production Engineer

Cluster infrastructure team

Facebook Ireland
Facebook’s Python3 open-source framework to build dynamic tftp servers
• A Production Engineer
• Similar to SRE / DevOps

• Based in Facebook Ireland, Dublin
• Since 2011

• Cluster Infrastructure team member
• Owns data center core services
• Owns E2E automation for bare metal
provisioning and cluster management.
Who am I?
“There is no cloud,
just other people’s
computers…”
- a (very wise) person on the interwebz
“… and someone’s got to provision them.”
- Angelo
POPs: Point of PresenceData center locations
POPs locations are fictional
HANDS FREE PROVISIONING:
kernel
OS
initrd
BIOS
UEFI
firmware
bootloader v6/v4DHCP
TFTP
bootloader
config
kickstart
anaconda
RPM's
location
buildcontrol
cyborg
server type
vendormodel
OOB
partitioning
schemas
3rd party
chef
tier
HTTP repos
mysql
inventory sys
kernel
OS
initrd
BIOS
UEFI
firmware
bootloader v6/v4DHCP
TFTP
bootloader
config
kickstart
anaconda
RPM's
location
buildcontrol
cyborg
server type
vendormodel
OOB
partitioning
schemas
3rd party
chef
tier
HTTP repos
mysql
inventory sys
TFTP
It’s common in Data Center/ISP environments
Simple protocol specifications
Easy to implement
UDP based -> produces small code footprint
Fits in small boot ROMs
Embedded devices and network equipment
Traditionally used for netboot (with DHCPv[46])
DHCPv[46] - KEA TFTP NBP
NETBOOT ANACONDA CHEF
REBOOT PROVISIONEDPOWER ON
• fetches config via tftp
• fetches kernel/initrd

(via http or tftp)
• provides NBPs
• provides config files for NBPs
• provides kernel/initrd
• provides network config
• provides path for NBPs binaries
Provisioning phases
30+ years old protocol
me, ~1982 circa
Protocol in a nutshell (RRQ)
CLIENT
RRQ
X
69
X YDAT 1
ACK 1X Y
SERVER
X YDAT N
ACK NX Y
Latency: ~150ms
File size
Block
Size
Latency
Time to
download
80 MB 512 B 150ms 12.5 hours
80 MB 1400 B 150ms 4.5 hours
80 MB
512 B/
1400 B
1ms <1 minute
POP
DC
CLIENT
RRX 69
X YDAT
ACKX Y
SERVER
POPs locations are fictional
A look in the past ~2014 (and its problems)
HW LB
in.tftpd

(active)
in.tftpd

(passive)
Servers
Cluster

VIP
Automation
REPO
rsync 7GBWrite config
• Physical load balancers
• Waste of resources
• Automation needs to know
which server is active
• No stats
• TFTP is a bad protocol in
high latency environments
• Too many moving parts
How did we solve those
problems?
• Supports only RRQ (fetch operation)
• Main TFTP spec[1], Option Extension[2], Block size
option[3], Timeout Interval and Transfer Size Options[4].
• Extensible:
• Define your own logic
• Push your own statistics (per session or global)
We built FBTFTP…
…A python3 framework to build dynamic TFTP servers
[1] RFC1350, [2] RFC2347, [3] RFC2348, [4] RFC2349
BaseServer BaseHandlerClient
transfer session
fork()
server
callback
session
callback
get_handler()
ResponseData
get_response_data()
RRQ
Monitoring Infrastructure
Framework overview
child process
Example:



a simple server serving files
from disk
class FileResponseData(ResponseData):
def __init__(self, path):
self._size = os.stat(path).st_size
self._reader = open(path, 'rb')
def read(self, n):
return self._reader.read(n)
def size(self):
return self._size
def close(self):
self._reader.close()
A file-like class that represents a file served:
BaseServer BaseHandlerClient
transfer session
fork()
server
callback
session callback
get_handler()
ResponseData
get_response_data()
RRQ
Monitoring Infrastructure
child process
class StaticHandler(BaseHandler):
def __init__(self, server_addr, peer, path,
options, root, stats_callback):
super().__init__(

server_addr, peer, path,
options, stats_callback)
self._root = root
self._path = path
def get_response_data(self):
return FileResponseData(

os.path.join(self._root, self._path))
A class that deals with a transfer session:
BaseServer BaseHandlerClient
transfer session
fork()
server
callback
session callback
get_handler()
ResponseData
get_response_data()
RRQ
Monitoring Infrastructure
child process
class StaticServer(BaseServer):
def __init__(
self, address, port, retries, timeout,
root, handler_stats_callback,
server_stats_callback
):
self._root = root
self._handler_stats_callback = 
handler_stats_callback
super().__init__(
address, port, retries, timeout,
server_stats_callback)
def get_handler(self, server_addr, peer, path, options):
return StaticHandler(
server_addr, peer, path, options, self._root,
self._handler_stats_callback)
BaseServer class ties everything together:
BaseServer BaseHandlerClient
transfer session
fork()
server
callback
session callback
get_handler()
ResponseData
get_response_data()
RRQ
Monitoring Infrastructure
child process
def print_session_stats(stats):
print(stats)
def print_server_stats(stats):
counters = stats.get_and_reset_all_counters()
print('Server stats - every {} seconds’.format(
stats.interval))
print(counters)
server = StaticServer(
ip='', port='69', retries=3, timeout=5,
root='/var/tftproot/', print_session_stats,
print_server_stats)
try:
server.run()
except KeyboardInterrupt:
server.close()
The “main”
BaseServer BaseHandlerClient
transfer session
fork()
server
callback
session callback
get_handler()
ResponseData
get_response_data()
RRQ
Monitoring Infrastructure
child process
How do we use it?
tftp
Servers
HTTP

repo
Improvements
• No more physical LBs
• No waste of resources
• Stats!
• TFTP servers are dynamic
• Config files (e.g. grub/ipxe
configs) are generated
• Static files are streamed
• You can hit any server
• No need to rsync data
• Container-friendly
Provisioning

backends tftpfbtftp
local
disk
cache
static files
dynamic

files
requests can

hit any server
Routing TFTP traffic
NetNorad Latency Maps DHCP
LBs are gone: which TFTP server will serve a given client?
NetNorad publishes latency maps periodically, DHCP consumes it.
Read about NetNorad on our blog: http://tinyurl.com/hacrw7c
Location of
server to
provision
Closest

TFTP

server
TFTP
Health checks
Service

discovery
POP1
DCFetches static files
from closest origin
only for cache misses
or if files changed
local

fbtftp
local

fbtftp
POP2
POPs locations are fictional
Thanks for listening!
Feel free to email me at pallotron@fb.com
Project home:

https://github.com/facebook/fbtftp/
Install and play with it: 

$ pip3 install fbtftp
Poster session Tuesday at 14.45:

Python in Production Engineering

More Related Content

What's hot

Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)
Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)
Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)Thomas Graf
 
Scaling Servers and Storage for Film Assets
Scaling Servers and Storage for Film Assets  Scaling Servers and Storage for Film Assets
Scaling Servers and Storage for Film Assets Perforce
 
Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...
Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...
Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...Matthew Ahrens
 
Stackless Python In Eve
Stackless Python In EveStackless Python In Eve
Stackless Python In Evel xf
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPThomas Graf
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking ExplainedThomas Graf
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixBrendan Gregg
 
GTRI Internship Presentation
GTRI Internship PresentationGTRI Internship Presentation
GTRI Internship PresentationJoseph Zuckerman
 
Distributed Tests on Pulsar with Fallout - Pulsar Summit NA 2021
Distributed Tests on Pulsar with Fallout - Pulsar Summit NA 2021Distributed Tests on Pulsar with Fallout - Pulsar Summit NA 2021
Distributed Tests on Pulsar with Fallout - Pulsar Summit NA 2021StreamNative
 
debugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitchdebugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitch어형 이
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThomas Graf
 
[233] level 2 network programming using packet ngin rtos
[233] level 2 network programming using packet ngin rtos[233] level 2 network programming using packet ngin rtos
[233] level 2 network programming using packet ngin rtosNAVER D2
 
zebra & openconfigd Introduction
zebra & openconfigd Introductionzebra & openconfigd Introduction
zebra & openconfigd IntroductionKentaro Ebisawa
 
Vigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick startVigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick startJimmy Tu
 

What's hot (20)

Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)
Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)
Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)
 
Scaling Servers and Storage for Film Assets
Scaling Servers and Storage for Film Assets  Scaling Servers and Storage for Film Assets
Scaling Servers and Storage for Film Assets
 
Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...
Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...
Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...
 
Stackless Python In Eve
Stackless Python In EveStackless Python In Eve
Stackless Python In Eve
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDP
 
SDAccel Design Contest: Xilinx SDAccel
SDAccel Design Contest: Xilinx SDAccel SDAccel Design Contest: Xilinx SDAccel
SDAccel Design Contest: Xilinx SDAccel
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
SoNAS
SoNASSoNAS
SoNAS
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
SDAccel Design Contest: Vivado HLS
SDAccel Design Contest: Vivado HLSSDAccel Design Contest: Vivado HLS
SDAccel Design Contest: Vivado HLS
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at Netflix
 
GTRI Internship Presentation
GTRI Internship PresentationGTRI Internship Presentation
GTRI Internship Presentation
 
Distributed Tests on Pulsar with Fallout - Pulsar Summit NA 2021
Distributed Tests on Pulsar with Fallout - Pulsar Summit NA 2021Distributed Tests on Pulsar with Fallout - Pulsar Summit NA 2021
Distributed Tests on Pulsar with Fallout - Pulsar Summit NA 2021
 
debugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitchdebugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitch
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
 
[233] level 2 network programming using packet ngin rtos
[233] level 2 network programming using packet ngin rtos[233] level 2 network programming using packet ngin rtos
[233] level 2 network programming using packet ngin rtos
 
zebra & openconfigd Introduction
zebra & openconfigd Introductionzebra & openconfigd Introduction
zebra & openconfigd Introduction
 
SDAccel Design Contest: SDAccel and F1 Instances
SDAccel Design Contest: SDAccel and F1 InstancesSDAccel Design Contest: SDAccel and F1 Instances
SDAccel Design Contest: SDAccel and F1 Instances
 
SDAccel Design Contest: Intro
SDAccel Design Contest: IntroSDAccel Design Contest: Intro
SDAccel Design Contest: Intro
 
Vigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick startVigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick start
 

Viewers also liked

Facebook Retrospective - Big data-world-europe-2012
Facebook Retrospective - Big data-world-europe-2012Facebook Retrospective - Big data-world-europe-2012
Facebook Retrospective - Big data-world-europe-2012Joydeep Sen Sarma
 
Facebook's Approach to Big Data Storage Challenge
Facebook's Approach to Big Data Storage ChallengeFacebook's Approach to Big Data Storage Challenge
Facebook's Approach to Big Data Storage ChallengeDataWorks Summit
 
A Survey of Petabyte Scale Databases and Storage Systems Deployed at Facebook
A Survey of Petabyte Scale Databases and Storage Systems Deployed at FacebookA Survey of Petabyte Scale Databases and Storage Systems Deployed at Facebook
A Survey of Petabyte Scale Databases and Storage Systems Deployed at FacebookBigDataCloud
 
Data Warehouse Evolution Roadshow
Data Warehouse Evolution RoadshowData Warehouse Evolution Roadshow
Data Warehouse Evolution RoadshowMapR Technologies
 
Hw09 Rethinking The Data Warehouse With Hadoop And Hive
Hw09   Rethinking The Data Warehouse With Hadoop And HiveHw09   Rethinking The Data Warehouse With Hadoop And Hive
Hw09 Rethinking The Data Warehouse With Hadoop And HiveCloudera, Inc.
 
Facebook - Jonthan Gray - Hadoop World 2010
Facebook - Jonthan Gray - Hadoop World 2010Facebook - Jonthan Gray - Hadoop World 2010
Facebook - Jonthan Gray - Hadoop World 2010Cloudera, Inc.
 
Storage Infrastructure Behind Facebook Messages
Storage Infrastructure Behind Facebook MessagesStorage Infrastructure Behind Facebook Messages
Storage Infrastructure Behind Facebook Messagesyarapavan
 
Creating a Culture of Data @ Facebook - TCCEU13
Creating a Culture of Data @ Facebook - TCCEU13Creating a Culture of Data @ Facebook - TCCEU13
Creating a Culture of Data @ Facebook - TCCEU13Andy Kriebel
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology StackHusain Ali
 
What's behind facebook
What's behind facebookWhat's behind facebook
What's behind facebookAjen 陳
 
Πώς να φτιάξετε ένα ψηφιακό παζλ
Πώς να φτιάξετε ένα ψηφιακό παζλΠώς να φτιάξετε ένα ψηφιακό παζλ
Πώς να φτιάξετε ένα ψηφιακό παζλMarilia
 
αλλαγή προτύπου Blogger
αλλαγή προτύπου Bloggerαλλαγή προτύπου Blogger
αλλαγή προτύπου BloggerMarilia
 
Παρουσίαση Νίκου Γκάτσου Ευτυχίας
Παρουσίαση Νίκου Γκάτσου ΕυτυχίαςΠαρουσίαση Νίκου Γκάτσου Ευτυχίας
Παρουσίαση Νίκου Γκάτσου ΕυτυχίαςMarilia
 
Передача технологій та ліцензування -Практика (Падучак Богдан Михайлович )
Передача технологій та ліцензування -Практика (Падучак Богдан Михайлович )Передача технологій та ліцензування -Практика (Падучак Богдан Михайлович )
Передача технологій та ліцензування -Практика (Падучак Богдан Михайлович )Constantine Zerov
 
Τα ψηλά βουνά @ 45 8 4 2016
Τα ψηλά βουνά @ 45 8 4 2016Τα ψηλά βουνά @ 45 8 4 2016
Τα ψηλά βουνά @ 45 8 4 2016Marilia
 

Viewers also liked (20)

The internship
The internshipThe internship
The internship
 
thrift-20070401
thrift-20070401thrift-20070401
thrift-20070401
 
ADER RRHH PRESENTACIÓN CORPORATIVA
ADER RRHH PRESENTACIÓN CORPORATIVAADER RRHH PRESENTACIÓN CORPORATIVA
ADER RRHH PRESENTACIÓN CORPORATIVA
 
Facebook Retrospective - Big data-world-europe-2012
Facebook Retrospective - Big data-world-europe-2012Facebook Retrospective - Big data-world-europe-2012
Facebook Retrospective - Big data-world-europe-2012
 
Facebook's Approach to Big Data Storage Challenge
Facebook's Approach to Big Data Storage ChallengeFacebook's Approach to Big Data Storage Challenge
Facebook's Approach to Big Data Storage Challenge
 
A Survey of Petabyte Scale Databases and Storage Systems Deployed at Facebook
A Survey of Petabyte Scale Databases and Storage Systems Deployed at FacebookA Survey of Petabyte Scale Databases and Storage Systems Deployed at Facebook
A Survey of Petabyte Scale Databases and Storage Systems Deployed at Facebook
 
Project Voldemort
Project VoldemortProject Voldemort
Project Voldemort
 
Data Warehouse Evolution Roadshow
Data Warehouse Evolution RoadshowData Warehouse Evolution Roadshow
Data Warehouse Evolution Roadshow
 
Hw09 Rethinking The Data Warehouse With Hadoop And Hive
Hw09   Rethinking The Data Warehouse With Hadoop And HiveHw09   Rethinking The Data Warehouse With Hadoop And Hive
Hw09 Rethinking The Data Warehouse With Hadoop And Hive
 
Facebook - Jonthan Gray - Hadoop World 2010
Facebook - Jonthan Gray - Hadoop World 2010Facebook - Jonthan Gray - Hadoop World 2010
Facebook - Jonthan Gray - Hadoop World 2010
 
Storage Infrastructure Behind Facebook Messages
Storage Infrastructure Behind Facebook MessagesStorage Infrastructure Behind Facebook Messages
Storage Infrastructure Behind Facebook Messages
 
Creating a Culture of Data @ Facebook - TCCEU13
Creating a Culture of Data @ Facebook - TCCEU13Creating a Culture of Data @ Facebook - TCCEU13
Creating a Culture of Data @ Facebook - TCCEU13
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology Stack
 
What's behind facebook
What's behind facebookWhat's behind facebook
What's behind facebook
 
Πώς να φτιάξετε ένα ψηφιακό παζλ
Πώς να φτιάξετε ένα ψηφιακό παζλΠώς να φτιάξετε ένα ψηφιακό παζλ
Πώς να φτιάξετε ένα ψηφιακό παζλ
 
αλλαγή προτύπου Blogger
αλλαγή προτύπου Bloggerαλλαγή προτύπου Blogger
αλλαγή προτύπου Blogger
 
Παρουσίαση Νίκου Γκάτσου Ευτυχίας
Παρουσίαση Νίκου Γκάτσου ΕυτυχίαςΠαρουσίαση Νίκου Γκάτσου Ευτυχίας
Παρουσίαση Νίκου Γκάτσου Ευτυχίας
 
Передача технологій та ліцензування -Практика (Падучак Богдан Михайлович )
Передача технологій та ліцензування -Практика (Падучак Богдан Михайлович )Передача технологій та ліцензування -Практика (Падучак Богдан Михайлович )
Передача технологій та ліцензування -Практика (Падучак Богдан Михайлович )
 
Net neutrality
Net neutralityNet neutrality
Net neutrality
 
Τα ψηλά βουνά @ 45 8 4 2016
Τα ψηλά βουνά @ 45 8 4 2016Τα ψηλά βουνά @ 45 8 4 2016
Τα ψηλά βουνά @ 45 8 4 2016
 

Similar to FBTFTP: an opensource framework to build dynamic tftp servers

Copper: A high performance workflow engine
Copper: A high performance workflow engineCopper: A high performance workflow engine
Copper: A high performance workflow enginedmoebius
 
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...Chris Fregly
 
Fluentd - RubyKansai 65
Fluentd - RubyKansai 65Fluentd - RubyKansai 65
Fluentd - RubyKansai 65N Masahiro
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container EraSadayuki Furuhashi
 
Technical Overview of Apache Drill by Jacques Nadeau
Technical Overview of Apache Drill by Jacques NadeauTechnical Overview of Apache Drill by Jacques Nadeau
Technical Overview of Apache Drill by Jacques NadeauMapR Technologies
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryoguest40fc7cd
 
Oracle High Availabiltity for application developers
Oracle High Availabiltity for application developersOracle High Availabiltity for application developers
Oracle High Availabiltity for application developersAlexander Tokarev
 
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...InfluxData
 
Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...
Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...
Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...InfluxData
 
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Puppet
 
Spark Summit EU talk by Sital Kedia
Spark Summit EU talk by Sital KediaSpark Summit EU talk by Sital Kedia
Spark Summit EU talk by Sital KediaSpark Summit
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Michael Renner
 
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022Stefano Stabellini
 
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...Chris Fregly
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning InfrastructurePerforce
 
Fluentd and Embulk Game Server 4
Fluentd and Embulk Game Server 4Fluentd and Embulk Game Server 4
Fluentd and Embulk Game Server 4N Masahiro
 
Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop AutomationRui Lapa
 
Dynamic Hadoop Clusters
Dynamic Hadoop ClustersDynamic Hadoop Clusters
Dynamic Hadoop ClustersSteve Loughran
 

Similar to FBTFTP: an opensource framework to build dynamic tftp servers (20)

Copper: A high performance workflow engine
Copper: A high performance workflow engineCopper: A high performance workflow engine
Copper: A high performance workflow engine
 
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
 
Fluentd - RubyKansai 65
Fluentd - RubyKansai 65Fluentd - RubyKansai 65
Fluentd - RubyKansai 65
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container Era
 
Technical Overview of Apache Drill by Jacques Nadeau
Technical Overview of Apache Drill by Jacques NadeauTechnical Overview of Apache Drill by Jacques Nadeau
Technical Overview of Apache Drill by Jacques Nadeau
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryo
 
Oracle High Availabiltity for application developers
Oracle High Availabiltity for application developersOracle High Availabiltity for application developers
Oracle High Availabiltity for application developers
 
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
 
Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...
Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...
Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...
 
Terraform training 🎒 - Basic
Terraform training 🎒 - BasicTerraform training 🎒 - Basic
Terraform training 🎒 - Basic
 
Using Netconf/Yang with OpenDalight
Using Netconf/Yang with OpenDalightUsing Netconf/Yang with OpenDalight
Using Netconf/Yang with OpenDalight
 
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
 
Spark Summit EU talk by Sital Kedia
Spark Summit EU talk by Sital KediaSpark Summit EU talk by Sital Kedia
Spark Summit EU talk by Sital Kedia
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014
 
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
 
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure
 
Fluentd and Embulk Game Server 4
Fluentd and Embulk Game Server 4Fluentd and Embulk Game Server 4
Fluentd and Embulk Game Server 4
 
Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop Automation
 
Dynamic Hadoop Clusters
Dynamic Hadoop ClustersDynamic Hadoop Clusters
Dynamic Hadoop Clusters
 

Recently uploaded

Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsMonica Sydney
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样ayvbos
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...meghakumariji156
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Balliameghakumariji156
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理F
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样ayvbos
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 

Recently uploaded (20)

Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 

FBTFTP: an opensource framework to build dynamic tftp servers

  • 1. FBTFTP Angelo Failla Production Engineer
 Cluster infrastructure team
 Facebook Ireland Facebook’s Python3 open-source framework to build dynamic tftp servers
  • 2. • A Production Engineer • Similar to SRE / DevOps
 • Based in Facebook Ireland, Dublin • Since 2011
 • Cluster Infrastructure team member • Owns data center core services • Owns E2E automation for bare metal provisioning and cluster management. Who am I?
  • 3. “There is no cloud, just other people’s computers…” - a (very wise) person on the interwebz “… and someone’s got to provision them.” - Angelo
  • 4.
  • 5.
  • 6.
  • 7. POPs: Point of PresenceData center locations POPs locations are fictional
  • 11. TFTP
  • 12. It’s common in Data Center/ISP environments Simple protocol specifications Easy to implement UDP based -> produces small code footprint Fits in small boot ROMs Embedded devices and network equipment Traditionally used for netboot (with DHCPv[46])
  • 13. DHCPv[46] - KEA TFTP NBP NETBOOT ANACONDA CHEF REBOOT PROVISIONEDPOWER ON • fetches config via tftp • fetches kernel/initrd
 (via http or tftp) • provides NBPs • provides config files for NBPs • provides kernel/initrd • provides network config • provides path for NBPs binaries Provisioning phases
  • 14. 30+ years old protocol me, ~1982 circa
  • 15. Protocol in a nutshell (RRQ) CLIENT RRQ X 69 X YDAT 1 ACK 1X Y SERVER X YDAT N ACK NX Y
  • 16. Latency: ~150ms File size Block Size Latency Time to download 80 MB 512 B 150ms 12.5 hours 80 MB 1400 B 150ms 4.5 hours 80 MB 512 B/ 1400 B 1ms <1 minute POP DC CLIENT RRX 69 X YDAT ACKX Y SERVER POPs locations are fictional
  • 17. A look in the past ~2014 (and its problems) HW LB in.tftpd
 (active) in.tftpd
 (passive) Servers Cluster
 VIP Automation REPO rsync 7GBWrite config • Physical load balancers • Waste of resources • Automation needs to know which server is active • No stats • TFTP is a bad protocol in high latency environments • Too many moving parts
  • 18. How did we solve those problems?
  • 19. • Supports only RRQ (fetch operation) • Main TFTP spec[1], Option Extension[2], Block size option[3], Timeout Interval and Transfer Size Options[4]. • Extensible: • Define your own logic • Push your own statistics (per session or global) We built FBTFTP… …A python3 framework to build dynamic TFTP servers [1] RFC1350, [2] RFC2347, [3] RFC2348, [4] RFC2349
  • 21. Example:
 
 a simple server serving files from disk
  • 22. class FileResponseData(ResponseData): def __init__(self, path): self._size = os.stat(path).st_size self._reader = open(path, 'rb') def read(self, n): return self._reader.read(n) def size(self): return self._size def close(self): self._reader.close() A file-like class that represents a file served: BaseServer BaseHandlerClient transfer session fork() server callback session callback get_handler() ResponseData get_response_data() RRQ Monitoring Infrastructure child process
  • 23. class StaticHandler(BaseHandler): def __init__(self, server_addr, peer, path, options, root, stats_callback): super().__init__(
 server_addr, peer, path, options, stats_callback) self._root = root self._path = path def get_response_data(self): return FileResponseData(
 os.path.join(self._root, self._path)) A class that deals with a transfer session: BaseServer BaseHandlerClient transfer session fork() server callback session callback get_handler() ResponseData get_response_data() RRQ Monitoring Infrastructure child process
  • 24. class StaticServer(BaseServer): def __init__( self, address, port, retries, timeout, root, handler_stats_callback, server_stats_callback ): self._root = root self._handler_stats_callback = handler_stats_callback super().__init__( address, port, retries, timeout, server_stats_callback) def get_handler(self, server_addr, peer, path, options): return StaticHandler( server_addr, peer, path, options, self._root, self._handler_stats_callback) BaseServer class ties everything together: BaseServer BaseHandlerClient transfer session fork() server callback session callback get_handler() ResponseData get_response_data() RRQ Monitoring Infrastructure child process
  • 25. def print_session_stats(stats): print(stats) def print_server_stats(stats): counters = stats.get_and_reset_all_counters() print('Server stats - every {} seconds’.format( stats.interval)) print(counters) server = StaticServer( ip='', port='69', retries=3, timeout=5, root='/var/tftproot/', print_session_stats, print_server_stats) try: server.run() except KeyboardInterrupt: server.close() The “main” BaseServer BaseHandlerClient transfer session fork() server callback session callback get_handler() ResponseData get_response_data() RRQ Monitoring Infrastructure child process
  • 26. How do we use it? tftp Servers HTTP
 repo Improvements • No more physical LBs • No waste of resources • Stats! • TFTP servers are dynamic • Config files (e.g. grub/ipxe configs) are generated • Static files are streamed • You can hit any server • No need to rsync data • Container-friendly Provisioning
 backends tftpfbtftp local disk cache static files dynamic
 files requests can
 hit any server
  • 27. Routing TFTP traffic NetNorad Latency Maps DHCP LBs are gone: which TFTP server will serve a given client? NetNorad publishes latency maps periodically, DHCP consumes it. Read about NetNorad on our blog: http://tinyurl.com/hacrw7c Location of server to provision Closest
 TFTP
 server TFTP Health checks Service
 discovery
  • 28. POP1 DCFetches static files from closest origin only for cache misses or if files changed local
 fbtftp local
 fbtftp POP2 POPs locations are fictional
  • 29. Thanks for listening! Feel free to email me at pallotron@fb.com Project home:
 https://github.com/facebook/fbtftp/ Install and play with it: 
 $ pip3 install fbtftp Poster session Tuesday at 14.45:
 Python in Production Engineering