|By Colin Walker||
|February 13, 2012 06:05 AM EST||
F5 uses TCL as the interpreter for iRules. Many people often ask why that is. This questions is usually followed up by an immediate, "Why not Perl?" or "Why not Java" or "Why not <fill in my preferred language of choice>?". I understand the question, and frankly I'm a Perl guy from way back myself, so when I first landed at F5 and started devouring all things iRules, I was curious about the same thing. Since then I've discussed this topic with some of F5's best, in my opinion, and have come to understand that there are many solid reasons for choosing the runtime that we use.
When asked "Why TCL?" my standard response centers around varying degrees of discussing:
These all remain true today, and I will expand on each of them in hopes of illuminating our position with TCL and iRules, and why the Perl lover in me was, and is to this day, convinced that we made the right choice.
Before I delve into the above list, first let me give some history of how we originally got to TCL in the first place. Originally, back in the days of dinosaurs and BIG-IP v3.0, when iRules was introduced as a technology within F5, we used a custom syntax. We hand rolled commands and utility functions, and relied on no particular language to achieve this, other than C, which is the base for pretty much everything that runs on our box, and frankly darn near everywhere else. This was all well and good, but as any F5 historian knows, the world changed a lot for us in v9.
For version 9 we tore up pretty much everything on the drawing board. Heck, we tore up the drawing board and started fresh. Even still, the plan was to go forward with the same approach, I.E. custom roll commands to be used within iRules and rely on no outside language to achieve this. At this point, though, some testing was done and a shocking result surfaced. In testing TCL against the custom built commands, TCL was actually faster in many cases. (More about how and why in a bit.) This left us with a very interesting fact: TCL was both faster and more feature rich than our hand rolled commands. That made the choice pretty simple.
Now then, on to the reasons why TCL was and still is a solid choice for iRules. From the list above, let’s start with speed.
We talk about it all the time. iRules are fast. Think of the fastest thing you can think of, a speeding bullet perhaps. Now think faster. No, faster than that. Seriously, blazingly fast. Why so much emphasis on speed? Because it lies at the core of everything that we do.
I’m one of the first people to say that it’s not all about speeds and feeds, as it were, when talking about ADC solutions from a broad perspective. That is not to be confused with the concept that speed is not important. Speed, in fact, is absolutely paramount when speaking from a granular level. The faster the granular functions are; packet interrogation, re-writing, routing, forwarding, IP translation, the faster each atomic function is, the less resources are utilized on such things. This leaves more power available as overhead to build and complete complex logical functions. Building business logic into the network could be costly to a point of making it prohibitive if it weren’t for the fact that each minute operation being performed behind the scenes were streamlined to the nth degree. So when it comes to iRules or any programmable interface for the network, speed is absolutely paramount.
That’s all well and good, but how does TCL fit into that? In testing TCL against other, heavier languages such as Perl and Python, we deemed pretty quickly two things:
1) TCL was far, far faster for our purposes than any of the other widely available options at the time, which is still the case with the exception of perhaps Lua.
2) Other options had large amounts of commands that we would either not need, or explicitly did not want to include for either security or performance reasons.
So out of the box TCL is a faster choice for our needs. If that weren’t enough, however, we also have to take into account the fact that we need to heavily modify the functionality of the language. For our purposes we both add and rip out large chunks of commands and functionality. We need to make things network aware, event driven (which, by the way, TCL explicitly is, and most other languages are not), add the notion of suspending/parking commands, ensure that garbage collection doesn’t occur in the middle of processing network traffic, and generally twist the language into something that understands what we are doing. TCL is very easy to modify in all of these ways, compared to other options, so this one more way in which it is a good fit for our needs.
Also keep in mind that the reality is, we’re only using a very small slice of what is available in whatever language iRules makes use of. This is because the vast majority of iRules commands are actually custom functions being performed within the TMM. Things like the HTTP:: commands, the table command, class, iStats, sideband connections … by far the lion’s share of what iRules users rely on for the functionality to understand, interpret and modify their traffic are actually calls to native C code. That is, those things don’t actually exist at all in the TCL world, beyond creating a TCL wrapper to call and handle the underlying functions.
This is for various reasons, not the least of which is – you guessed it – performance. The functions within TMM that perform these actions are far higher performance in their native state than they could be in any interpreted language running per connection, TCL or otherwise. So if a huge majority of our commands are actually just passing control back and forth between TCL and C, then a highly adept interface for doing so becomes paramount. TCL, again, pulls ahead of the pack in this arena. It just so happens that TCL has one of the more thorough C programming APIs available, compared to other similar language options. Given how often this happens and how important it is to what iRules does at its core, this is a big plus.
Last but not least, TCL supports the notion of compiling to byte-code. This is something we make extensive use of to boost performance at run time. Whenever an iRule is saved to the system it is compiled into byte code, which allows it to execute far faster than if it were in the native, human readable state. Most scripting languages combine the compilation and execution functions so that both occur effectively at the same time. With TCL we're able to use a different model that allows for the compilation, syntax checking etc. to occur at load time, which means that at run time, the byte code is processed instead of the original iRule, thus skipping a large amount of the overhead that would otherwise be involved. This allows a far smaller footprint at run time (meaning when the iRule has to execute), in exchange for a bit of extra work at load time (when a user saves an iRule), which is a very, very solid trade for us. Anything we can offload to happen once at load time rather than for each connection that comes through the system is an extremely solid performance improvement. 1 execution per save vs 100k executions per second (on a highly traffic laden box) is a pretty simple picture to understand, and bytecode allows us to achieve that at least somewhat.
TCL is not only extremely fast, but also supremely embeddable. It has a long history of being a go-to embedded interpreter in many fast paced, low level systems such as L2 switches. This is thanks to the fact that TCL is very, very small, when compared to other languages that offer similar functionality (or more functionality, like Perl and Java, but more on that later). Also, TCL is amazingly simple to integrate with C. So much so that it is considered near free in many cases, and anything written in C could easily be exposed via TCL with minimal effort. Keep in mind here that when I talk about things written in C, that list includes a massive array of programs and systems, including many modern kernels, such as Windows and Linux. TCL being friendly with kernels isn’t a bad thing when looking at integrating it with a custom micro-kernel, as is the case within TMM.
On top of the highly embeddable nature of TCL, you also have to factor in the absolutely minuscule footprint. The entirety of TCL is a few hundred kilobytes, including the parts we’re not using within iRules. That is tiny in comparison to its more feature rich cousins Perl and Java and <many others>. For instance the entire source download of TCL (as of the writing of this article) is 4.3M whereas Perl is 15M. The size of the environment becomes very important the more you understand the inner workings of the iRules world.
One of the things that most people don’t take into account or don’t realize is the fact that each connection to the BIG-IP that invokes an iRule receives a unique TCL context along with the accompanying state, variables, etc. This means that memory is allocated to every connection that uses an iRule to store that TCL structure, allow it to interface uniquely with TMM, and do what it needs for that particular connection and the iRules associated with it. Keep in mind that this can occur millions of times concurrently on a busy, high-end F5 device, and to me it becomes extremely impressive. The memory footprint difference between a couple hundred kilobytes for TCL and a couple megabytes for many other languages is large enough for a single instance. When you talk about a few hundred thousand or even a million concurrent instances, however, it becomes exponentially larger and more important, as you might imagine.
Surely you could not allocate, store, and process millions of copies of Perl in the same resource footprint. This is directly due to the size and simplicity of TCL. Perl and other such languages have many, many more base capabilities than TCL. This is a fantastic thing when and if you need them, and when you aren’t worried about resource constraints in such a blisteringly fast paced environment. In our world, when the vast majority of that added functionality isn’t needed anyway, and every byte or cycle counts, the overhead isn’t nearly worth the luxury.
One of the best engineers here at F5, from whom I gleaned some fantastic insight and new information when asking questions to help inspire this conversation, said it quite well:
“The full Tcl syntax can be described by just a handful of rules. In fact it's so simple you could write your own Tcl grammar parser in an afternoon. For contrast, only Perl can parse Perl.”
Don’t get me wrong, I’m a big Perl fan, and still use it to this day for writing utilities and such on the command line. There is a tool for every job and in our particular case, given the performance requirements we have, TCL just makes more sense.
Now that we understand the performance concerns and how TCL plays well in that arena, the next most prominent concern on our list would be usability. When considering usability in this case it is important to remember our target audience. The people generally managing these systems are not full time programmers. As such, making use of a simple, easily readable language that is quick to pick up and master, and easy to read and pass from one user to the next makes a lot of sense.
The simplicity of TCL plays into less overhead to the user when it comes to understanding the commands and tools available just as much as it plays into the system overhead required to load. It makes sense, I think, that a language with far greater capabilities and extended commands, memory structures, modules, etc. would take more time and effort to master. Given that doing so is often not the primary role of the individuals we hope to appeal to with iRules, the simpler approach makes more sense.
On top of that, most of that added functionality simply isn’t necessary. Keep in mind we’re not even exposing all of TCL. We intentionally and specifically limit some of the base functionality. If we are limiting the much simpler, less complex language because we don’t need or want that functionality, there is little argument for moving to a more complex, feature rich language, given that the majority of the functionality would likely be “nice to have” at best, and undue overhead at worst.
Is TCL still the right choice?
All of that being said, if we were starting from scratch today without thousands of iRules in the wild, a community built up to support the language, TMSH, iApps and many other technologies within the BIG-IP making use of TCL, etc. would we choose TCL again?
Given the needs iRules has for an interpreter: Fast, tightly embeddable, small footprint, fast, easily tied to native C and thus kernels, usability – yes, I think TCL would still be a strong contender for being the best fit for our needs. If I weren’t convinced of it before, I’ve spoken to some of the core architects responsible for iRules today, and they share the same opinion, that TCL is still as strong a choice today as it was in 2004. There are others that offer similar benefits today, Lua being chief among them, but there are drawbacks of those as well. To me, there is no clearly superior choice for our very specific needs even in today’s landscape. On top of that, we rarely get any complaints about iRules being TCL based. Sure we get questions as to why, but once we explain the benefits and people are clear on the reasons we went down the road we did, it almost always results in a happy iRules user.
Are there some ways in which allowing users access to other languages may be beneficial? Certainly, but keep in mind they are largely available. It is quite commonplace for Perl and bash to be used for monitors already. Perhaps a better way of addressing the question is: What is it you would like to do with other languages that you cannot via iRules currently? Once that is understood, the discussion could turn to whether or not that is possible, feasible and reasonable to implement within BIG-IP in some fashion. Would this be built directly into the TCL construct iRules is based on, or in some other fashion that may allow the use of a chosen language, or a subset thereof? Who knows, but it is a valuable conversation regardless of the outcome. The more we can understand what it is people would like to and are trying to do, the better we can continue expanding the already powerful tools that we offer to meet those needs.
Hopefully that paints the picture of why we chose and continue to use TCL to support our powerful iRules framework. I am not by any means a TCL zealot. Frankly I had far more experience in other languages before coming to F5, and rather enjoyed writing things in those languages. What I care about far more than writing in my favorite language, however, is using the right tool for the job. As I’ve learned more about iRules I have come to understand the reasons we use TCL to do what we do, and appreciate what it allows us.
The Open Connectivity Foundation (OCF), sponsor of the IoTivity open source project, and AllSeen Alliance, which provides the AllJoyn® open source IoT framework, today announced that the two organizations’ boards have approved a merger under the OCF name and bylaws. This merger will advance interoperability between connected devices from both groups, enabling the full operating potential of IoT and representing a significant step towards a connected ecosystem.
Oct. 21, 2016 11:15 PM EDT Reads: 1,116
You think you know what’s in your data. But do you? Most organizations are now aware of the business intelligence represented by their data. Data science stands to take this to a level you never thought of – literally. The techniques of data science, when used with the capabilities of Big Data technologies, can make connections you had not yet imagined, helping you discover new insights and ask new questions of your data. In his session at @ThingsExpo, Sarbjit Sarkaria, data science team lead ...
Oct. 21, 2016 10:00 PM EDT Reads: 4,206
A completely new computing platform is on the horizon. They’re called Microservers by some, ARM Servers by others, and sometimes even ARM-based Servers. No matter what you call them, Microservers will have a huge impact on the data center and on server computing in general. Although few people are familiar with Microservers today, their impact will be felt very soon. This is a new category of computing platform that is available today and is predicted to have triple-digit growth rates for some ...
Oct. 21, 2016 10:00 PM EDT Reads: 33,889
SYS-CON Events announced today that Roundee / LinearHub will exhibit at the WebRTC Summit at @ThingsExpo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. LinearHub provides Roundee Service, a smart platform for enterprise video conferencing with enhanced features such as automatic recording and transcription service. Slack users can integrate Roundee to their team via Slack’s App Directory, and '/roundee' command lets your video conference ...
Oct. 21, 2016 09:15 PM EDT Reads: 1,979
SYS-CON Events announced today that Enzu will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive advantage. By offering a suite of proven hosting and management services, Enzu wants companies to focus on the core of their online busine...
Oct. 21, 2016 09:15 PM EDT Reads: 1,193
SYS-CON Events announced today that SoftNet Solutions will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. SoftNet Solutions specializes in Enterprise Solutions for Hadoop and Big Data. It offers customers the most open, robust, and value-conscious portfolio of solutions, services, and tools for the shortest route to success with Big Data. The unique differentiator is the ability to architect and...
Oct. 21, 2016 08:15 PM EDT Reads: 340
In past @ThingsExpo presentations, Joseph di Paolantonio has explored how various Internet of Things (IoT) and data management and analytics (DMA) solution spaces will come together as sensor analytics ecosystems. This year, in his session at @ThingsExpo, Joseph di Paolantonio from DataArchon, will be adding the numerous Transportation areas, from autonomous vehicles to “Uber for containers.” While IoT data in any one area of Transportation will have a huge impact in that area, combining senso...
Oct. 21, 2016 07:15 PM EDT Reads: 254
Why do your mobile transformations need to happen today? Mobile is the strategy that enterprise transformation centers on to drive customer engagement. In his general session at @ThingsExpo, Roger Woods, Director, Mobile Product & Strategy – Adobe Marketing Cloud, covered key IoT and mobile trends that are forcing mobile transformation, key components of a solid mobile strategy and explored how brands are effectively driving mobile change throughout the enterprise.
Oct. 21, 2016 07:15 PM EDT Reads: 1,613
@ThingsExpo has been named the Top 5 Most Influential Internet of Things Brand by Onalytica in the ‘The Internet of Things Landscape 2015: Top 100 Individuals and Brands.' Onalytica analyzed Twitter conversations around the #IoT debate to uncover the most influential brands and individuals driving the conversation. Onalytica captured data from 56,224 users. The PageRank based methodology they use to extract influencers on a particular topic (tweets mentioning #InternetofThings or #IoT in this ...
Oct. 21, 2016 07:00 PM EDT Reads: 8,109
"Matrix is an ambitious open standard and implementation that's set up to break down the fragmentation problems that exist in IP messaging and VoIP communication," explained John Woolf, Technical Evangelist at Matrix, in this SYS-CON.tv interview at @ThingsExpo, held Nov 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
Oct. 21, 2016 07:00 PM EDT Reads: 8,929
The IoT has the potential to create a renaissance of manufacturing in the US and elsewhere. In his session at 18th Cloud Expo, Florent Solt, CTO and chief architect of Netvibes, discussed how the expected exponential increase in the amount of data that will be processed, transported, stored, and accessed means there will be a huge demand for smart technologies to deliver it. Florent Solt is the CTO and chief architect of Netvibes. Prior to joining Netvibes in 2007, he co-founded Rift Technologi...
Oct. 21, 2016 06:45 PM EDT Reads: 2,815
For basic one-to-one voice or video calling solutions, WebRTC has proven to be a very powerful technology. Although WebRTC’s core functionality is to provide secure, real-time p2p media streaming, leveraging native platform features and server-side components brings up new communication capabilities for web and native mobile applications, allowing for advanced multi-user use cases such as video broadcasting, conferencing, and media recording.
Oct. 21, 2016 06:15 PM EDT Reads: 3,019
Established in 1998, Calsoft is a leading software product engineering Services Company specializing in Storage, Networking, Virtualization and Cloud business verticals. Calsoft provides End-to-End Product Development, Quality Assurance Sustenance, Solution Engineering and Professional Services expertise to assist customers in achieving their product development and business goals. The company's deep domain knowledge of Storage, Virtualization, Networking and Cloud verticals helps in delivering ...
Oct. 21, 2016 04:15 PM EDT Reads: 926
24Notion is full-service global creative digital marketing, technology and lifestyle agency that combines strategic ideas with customized tactical execution. With a broad understand of the art of traditional marketing, new media, communications and social influence, 24Notion uniquely understands how to connect your brand strategy with the right consumer. 24Notion ranked #12 on Corporate Social Responsibility - Book of List.
Oct. 21, 2016 04:15 PM EDT Reads: 1,488
More and more brands have jumped on the IoT bandwagon. We have an excess of wearables – activity trackers, smartwatches, smart glasses and sneakers, and more that track seemingly endless datapoints. However, most consumers have no idea what “IoT” means. Creating more wearables that track data shouldn't be the aim of brands; delivering meaningful, tangible relevance to their users should be. We're in a period in which the IoT pendulum is still swinging. Initially, it swung toward "smart for smar...
Oct. 21, 2016 03:15 PM EDT Reads: 320
Cognitive Computing is becoming the foundation for a new generation of solutions that have the potential to transform business. Unlike traditional approaches to building solutions, a cognitive computing approach allows the data to help determine the way applications are designed. This contrasts with conventional software development that begins with defining logic based on the current way a business operates. In her session at 18th Cloud Expo, Judith S. Hurwitz, President and CEO of Hurwitz & ...
Oct. 21, 2016 03:00 PM EDT Reads: 4,375
@ThingsExpo has been named the Top 5 Most Influential M2M Brand by Onalytica in the ‘Machine to Machine: Top 100 Influencers and Brands.' Onalytica analyzed the online debate on M2M by looking at over 85,000 tweets to provide the most influential individuals and brands that drive the discussion. According to Onalytica the "analysis showed a very engaged community with a lot of interactive tweets. The M2M discussion seems to be more fragmented and driven by some of the major brands present in the...
Oct. 21, 2016 03:00 PM EDT Reads: 11,169
In the next five to ten years, millions, if not billions of things will become smarter. This smartness goes beyond connected things in our homes like the fridge, thermostat and fancy lighting, and into heavily regulated industries including aerospace, pharmaceutical/medical devices and energy. “Smartness” will embed itself within individual products that are part of our daily lives. We will engage with smart products - learning from them, informing them, and communicating with them. Smart produc...
Oct. 21, 2016 02:30 PM EDT Reads: 1,415
In his keynote at 19th Cloud Expo, Sheng Liang, co-founder and CEO of Rancher Labs, will discuss the technological advances and new business opportunities created by the rapid adoption of containers. With the success of Amazon Web Services (AWS) and various open source technologies used to build private clouds, cloud computing has become an essential component of IT strategy. However, users continue to face challenges in implementing clouds, as older technologies evolve and newer ones like Docke...
Oct. 21, 2016 02:15 PM EDT Reads: 2,212
As ridesharing competitors and enhanced services increase, notable changes are occurring in the transportation model. Despite the cost-effective means and flexibility of ridesharing, both drivers and users will need to be aware of the connected environment and how it will impact the ridesharing experience. In his session at @ThingsExpo, Timothy Evavold, Executive Director Automotive at Covisint, will discuss key challenges and solutions to powering a ride sharing and/or multimodal model in the a...
Oct. 21, 2016 02:15 PM EDT Reads: 1,435