# Content Delivery Network

## Summary

A Content Delivery Network (CDN) is a collection of servers located around the world that work together to deliver content to users faster by bringing it closer to them. CDNs store a copy of content in Cache Servers or Edge servers in point-of-presence (POP) locations close to end users to reduce loading time and overloading on a single origin server.

Although a CDN does not replace the need for web hosting, it does help with content caching at the network edge, which improves website performance in ways that traditional web hosting services struggle.

CDNs can cache various form of contents like web pages, image, video also live streaming without storing the entire recordings caching it as segments.

## Discussion

### Why do we need a CDN?

A CDN is useful for websites or web applications that have a high volume of traffic and a large number of users from all over the world. Due to the higher latency in the network during transmission, visitors from all over the world will experience longer loading times because websites are hosted on a single server in a single location. By reducing page loading times, a CDN improves the user experience.

The primary goal of a content delivery network (CDN) is to reduce latency, or the delay that occurs in a website's response to a user request. CDNs help to reduce latency by distributing content across multiple servers maintained by CDN providers around the world, rather than a single server to handle website traffic. .

CDNs can not only provide customers with faster loading speeds, but they can also prevent website crashes in the event of a spike in traffic. . More than 41% of the top 10,000 websites use a CDN to deliver their content, according to BuiltWith, a technology lookup tool.

### How do CDNs work?

A Content Delivery Network (CDN) is a network of servers that distributes content from a "origin" server where the content is originally hosted via proxy servers that receive client requests and forward them to other edge servers located around the world.

Edge servers in a CDN can be either data centres with multiple servers or Points of Presence (PoP) with a single server. These are strategically placed across multiple geographical locations, where the content is cached before being served via CDN.

Caching refers to the practise of storing copies of data pulled from an origin server on edge servers. It helps the origin server in reducing traffic stress on a website by bringing edge servers closer to the users, which reduces loading time as less travel time is required to reach the user.

CDN Edge servers are usually located near Internet exchange points (IXPs), which connect various internet service providers to exchange traffic. . CDN providers can save money and time by locating servers in these interconnected locations.   .

Equal-cost multipath (ECMP) is one of the routing strategy that edge servers use to balance traffic and efficiently use bandwidth.

### What are the benefits of using a CDN?

    + **Improving site Reliability**: Even during common network issues such as hardware failures or network traffic congestion, CDNs can keep website content online. Usage of CDNs can avoid traffic congestion by using load balancing to distribute traffic equally across multiple servers. Some CDN providers use the anycast routing method to efficiently handle traffic and routing it to the nearest data centre with high traffic handling capabilities to avoid congestion.
    + **Increased Security**: The use of CDNs can help to prevent various cyber attacks such as common DDoS ,in which an attacker floods a website with abnormally high traffic, overloading server and making it unresponsive .While these attacks are becoming common, Cloudflare a CDN provider, has prevented a DDoS attack with a peak of 17.2 million requests per second (rps), which is three times higher than previous records proving the security of CDN.
    + **Scalabilty**:Because a CDN distributes the contents across many servers around the world, the website owner does not need to change the demands of the webserver based on traffic needs because the CDN handles it and scales it accordingly.

### What is Push and Pull caching in CDN?

When we talk of global CDN network, it refers to caching content at various edge server locations such that the data is available to any requesting global user. It can actually be classified into two types push and pull based on how it caches the data from the origin server.

Push CDN distributes a website's content at regular intervals from the origin server to edge servers (PoPs) located all over the world. Visitors to the website are served from an edge server copy of the website. It works in the same way as prefetch  . Push CDN is ideal for low-traffic websites and files that are mostly static and do not change frequently.

Pull CDN, also known as Reverse Proxy, does not store the contents of a website on CDN Edge Servers until the user requests that resource for the first time. .When a user requests content from the Edge server, it contacts the origin server and obtains a copy to deliver to the user. All future requests for that content will be served from the Edge server's cache. It is best suited for smaller files such as images, javascript, and so on.

### Could you explain some terminologies used in CDN?

    + **Cache Hit**: A "cache hit" occurs when a user requests files from the Edge server's cache and the Edge server is able to successfully deliver them from the cache rather than the origin server.
    + **Cache Miss**: This happens when the requested file by the user is not found in the Edge server and the request is passsed onto "Origin Server" to deliver it to the user. Once the origin server responds, the CDN server caches, so that subsequent requests for it results in a cache hit.
    + **Cache hit ratio**: A count of the number of content requests that are successfully fulfilled by Edge servers. It is calculated by *Number of cache hits/(Number of cache hits + Number of cache misses) = Cache hit ratio*.
    + **Purge**: The edge server's cached version of a file is removed, and the origin server begins delivering the newer version of the content to the edge server.
    + **Prefetch**: It is used to provide a faster delivery experience to the user. To avoid cache misses, content that is likely to be requested by a large number of users is cached on Edge Servers.

### Which should you use Multi-CDN or Single CDN?

In the Multi-CDN model, Traffic is distributed across multiple CDN providers, such as Cloudflare, Akamai, and AWS, Multi-CDN enables the combination of capacity from multiple providers and provides fault tolerance in the event of a failure.  .

Different CDN providers will have individual Edge Servers with different infrastructure and unique features, resulting in different performance, security, and usage costs. Multi-CDN can be set up with the help of third-party providers such as NS1. They serve as CDN brokers, aggregating several CDN providers.

In single CDN model, the users use only one CDN provider for their website, and is recommended for businesses that want to distribute their content only to specific geographic locations and do not have a global audience. It also reduces multiple DNS lookups, as opposed to Multi-CDN, which uses three DNS lookups, slowing down the initial connection to the CDN.

### What is Request collapsing in CDN?

Request collapsing, also known as collapse forwarding, is a key feature of CDN architecture that prevents Edge servers from being overloaded by a large number of simultaneous requests to access content from the CDN while it is being cached to edge servers or is yet to be cached in the CDN, resulting in a cache miss.

The problem is known as *Thundering Herd* or *Cache Stampede*. Many large companies in the tech industry experienced outages as a result of it.  . Request collapsing helps to solve this problem by combining multiple requests for the same content into a single request.

If there is cache miss for the requested content and a second request for the same content arrives in the meantime, the second request is queued. After the file is sent from the origin server to the CDN Edge servers, it is finally delivered to everyone who requested it.

Some CDN providers take this concept a step further by incorporating "origin shield" between Edge servers and origin servers in the CDN by incorporating caching layers to reduce the number of requests made to the origin server for content.

### How does CDN cache dynamic content?

Content on a website will be either static or dynamic. Static content will be same for every user which needs almost no processing by a backend in server specifically for the user. It is easy to serve by a CDN as the information once cached in the server will not change. Traditional CDNs have cached and served only static content but CDNs now a days need to process dynamic content in which the data changes depending on user, location and many other factors.

Caching dynamic content via CDN is complex because it requires querying a database, using Full Page Caching or reverse proxy caching also executing large code base to generate the content. It was once impossible to cache dynamic content, but with the advancement of modern CDN technologies, it is now possible to do so by running the code and storing databases closer to the users on Edge Servers and delivering it from the cache rather than pulling it from the distant origin server, which even speeds up the response time of dynamic websites to the user.

### Difference between CDN and Edge Computing

While CDN aims to improve user connectivity by caching content copies in edge servers. Edge Computing is a similar architecture aimed primarily at IoT (Internet of Things) sensors, Gateways, Smartphones, and a wide range of technologies not limited to high performance servers.

It can not only store content like a CDN, but it can also distribute workload and provide decentralised computing, processing services for applications such as VR, AR Gaming, and others that require high reliability and ultra low latency with the help of growing 5G technology. It can replace a CDN Edge Server which performs the majority of the computing services on the origin server and stores the copies, whereas in Edge Computing, the majority of what happens in CDN origin servers happens closer to the user.

Beacause the required infrastructure for a Edge computing varies greatly than a CDN. Users of edge computing services for their business require a tailor made solutions according to their specific requirements.

### What are the Disadvantages of using a CDN?

    + **Expensive**: Starting to use a CDN and setting it up takes time and comes with a lot of hidden costs. There are many CDNs that offer free plans, but they come with some restrictions. Because it can handle large amounts of traffic, the fees are determined by the number of visitors, the amount of CDN resources used, and a variety of other factors. As a result, CDN networks are typically a better option for large businesses with the financial resources and requirements to invest in them.
    + **Server Location**: Before you set up, learn about CDN providers and their points of presence (PoPs). If you don't have a CDN provider's server near where your core audience and majority of traffic is expected, it will have a negative impact on your website's performance as it will directly increase the loading time for the users.
    + **Handling SEO**: Though using a CDN improves page speed, which is beneficial to SEO, there are a number of other factors that if handled incorrectly can have a negative impact on SEO. It is recommended that assets such as images be hosted on the same sub-domains as the website.

## Milestones

1995

Tim Berners-lee inventor of World Wide Web realised internet traffic congestion would become a major problem limiting internet usage. They start a research project in MIT to find a solution.

Aug
1998

Dr. Leighton and Mr. Lewin incorporated Akamai meaning "clever" or "intelligent" in Hawaiian language. It is the first CDN provider and the company is evolved from a MIT Project in 1995.

Feb
1999

Akamai provides first live traffic to Disney website via CDN. It starts earning a considerable market share by delivering two programmes for ESPN and Entertainment tonight, which historically had a high consumer demand. Also in the same year world's most visited website Yahoo is their customer.

Aug
2000

Dr.Tom leighton MIT math professor and his student Daniel Lewin got patent for their intelligent routing system which replicates content across a large network of distributed servers. It is titled as "Global hosting system".

Sep
2001

The 9/11 terrorist attack in United States increases internet usage worldwide. During this MSNBC a news Channel consumes a bandwidth of 120 gigabits per second, compared to the normal 6 gigabits.  After this event more money is invested in the development of advanced CDNs to handle such flash crowds. Daniel Lewin, the father of CDN and founder of Akamai CDN, is coincidentally killed in this terrorist attack.

Nov
2007

A new architecture distributed Content Delivery Network (DCDN) is proposed in the IEEE research paper to improve the peering of CDN which allows traffic to be exchanged between two networks directly increasing the efficiency of Commercial CDNs. Resources of the internet users like storage space and bandwidth is used in DCDN.

Nov
2008

Amazon Web Services(AWS) subsidiary of Amazon.com,Inc launches CloudFront a content delivery network with 14 edge locations around the world. A Huge advantage of Cloudfront is the pay as you go pricing model with no upfront cost or long term contract.

Nov
2009

Microsoft launches Windows Azure Content Delivery Network. The data is delivered by blob containers which can store large unstructured data served to users by over HTTP or HTTPS protocols. Public Blob containers are available for anyone for anonymous access with the CDN URL. Data Request is served from the closest CDN endpoint of the user to access the Blob. Azure CDN uses cache in which a very-high speed memory to deliver static objects allowing users to store large amount of data.

Apr
2010

Limelight Inc's patent application is published. In which a new system for delivering encrypted data to end-users from a Content Delivery Network origin is proposed. Some or most of the contents within the CDN is encrypted and when the end-user supplies a Universal Resource Indicators (URI) the CDN determines the key for decrypting the content before it is delivered to the end-user from CDN.

Jun
2012

Netflix a subscription based streaming service launches "Open Connect Network" , CDN to serve petabytes of data on a In-house content distribution network to provide billion hours per month of movies and TV which was served by other commerical CDN providers previously. Netflix provides free servers to the Internet Service Providers which stores copies of Netflix contents to reduce the burden on networks by eliminating the number of transits for the content to reach the user in the network.

Sep
2017

Edgemesh a web acceleration company has started to operate 3,500 Global networks through Peer-to-Peer Content delivery network technology which cuts the page loading time by 60% reducing bandwidth fees by 90%.

Jun
2018

A New PCDN Technology introduced by Alibaba Cloud is emerging to offer Peer to Peer functionality optionally integrated with a CDN. This PCDN depends on Peer to Peer technology which can be integrated with conventional CDN and Cloud-based CDN. The Cost of PCDN is also cheaper than traditional and Cloud-based CDN. Multi-level node scheduling increases data redundancy which means the data can be served by both CDN and P2P technology.

Jul
2019

For about 30 minutes, many websites on the internet displayed a 502 error due to a major outage in Cloudflare CDN. It's because of a bug that caused a massive spike in CPU usage, which caused the system to crash.

2020

Due to the COVID pandemic, CDN usage is on the rise, with Video on Demand (VOD) and Over the Top (OTT) services playing a major role. With 15.8 million new users, Netflix, an OTT platform, saw a 48 percent increase in traffic. Similarly, edtech platforms have seen an increase in usage.

Content Delivery Network


# Machine Learning in Python

## Summary

Machine Learning algorithms enable a computer system to learn about the problem environment directly from historical/real-time data, without being explicitly programmed. Algorithm implementation can be done using any programming language such as C, C++, Java, Python, JavaScript or R.

However, Python is most prevalently used in the industry for Machine Learning across business domains. It is voted by data scientists as the ‘language most desirable to learn’ in a 2018 StackOverflow survey.

Several factors influence the choice of language for ML implementation. Programming expertise in the organisation, interoperability with existing code/data frameworks might be reasons to stick to traditional languages such as C++ or Java. But the advantages that new-age languages such as Python and R bring to Machine Learning are plenty.

Ease of coding, strong supporting developer community, and excellent data manipulation features are key reasons for Python’s suitability for Machine Learning.

## Discussion

### What are major steps in the ML process and their corresponding Python libraries?

Machine Learning programs essentially consist of 4 steps. In Python, each of these steps are supported by a well-developed library implementations:

    + Step 1 – Collecting and preparing data (`numpy`, `pandas` library)
    + Step 2 – Choosing the model or algorithm (`sklearn` library)
    + Step 3 – Training the model with historical data (`sklearn` library)
    + Step 4 – Making an outcome prediction from training data and comparing the accuracy with the test data (`matplotlib`, `sklearn` libraries)

### How is the data collection process (Step 1) handled in Python?

Data about the system is first collected from various sources. This data would primarily be unstructured data, contain unclear labels and several invalid/incorrect entries. This data is then sorted, labelled, validated and then stored in organized data structures.

**NumPy** and **Pandas** libraries of Python contain data structures such as `Array`, `DataFrame` and `Series` that provide grouping, indexing and data manipulation functions.

### How is the ML model chosen and implemented (Step 2) in Python?

Once the data is ready, it is divided into training and test data. Here, the appropriate ML algorithm is to be applied based on the nature of the data and the type of prediction we seek. Size of the training data, linearity of data, number of affecting parameters are all important factors to consider. Linear regression, classification, SVM, Clustering, Decision trees are some of the frequently used algorithms.

All popular algorithm implementations are present in the `sklearn` (scikit-learn) library of Python. It provides a list of supervised and unsupervised algorithms with a uniform interface for invocation for easy programming.

### How is the ML model trained with data (Step 3) using Python?

Feeding the model with all the gathered data and allowing it to interpret the parameters incrementally is the next step. The training process involves deducing values for dependent variables based on independent variable values in the data set. Some variables are more relevant to the outcome than the others.

The `estimator.fit()` function from the `sklearn` library allows the model to take the test X values and fit them into the model to infer the corresponding Y value. Supervised learning is done using either `predictor.predict()` or `predictor.predict_prob()` (for classification problems).

### How is the final outcome predicted and evaluated (Step 4) in Python?

In the final step, the derived Y values from the model are verified and evaluated for accuracy. This is done by comparing the derived Y value against the Y value from test data. High degree of accuracy indicates a good fit of the model on the problem statement, meaning the predictions are reliable.

Once the outcomes are ready, the data need to be presented in easy human-readable form. This step is known as data visualization. It involves converting tabular data into visual representations such as graphs, maps, images, and so on.

Python takes care of prediction with the `sklearn` library. The accuracy calculation functions are also present in this. Data visualization is done using the `matplotlib` library. Popular visualizations are scatter plots, time series, box plots, histograms and heatmaps. Refer code snippet in sample code section.

### What are the advantages of Python over other programming languages for Machine Learning?

Listed below are some distinct features of Python that make it extremely suitable for ML:

    + **Ease of coding** – Often described as a programmer’s delight, Python’s code footprint is among the smallest across high level languages. Short, to-the-point syntax is a big plus, making programs easily readable.
    + **Dynamic typing** – Python doesn’t mandate you to declare variable data types. So mid-way through your program, your variable can change from integer to character to an object. When large volumes of data are being collected, sometimes a variable data type is unknown or frequently changing. Thus, the dynamic typing feature is useful in data preparation for Machine Learning.
    + **Strong developer community** – The open and collaborative development of Python libraries has made it one of the fastest growing developer communities. Quick consultation for queries and excellent sample code sharing make it easy for beginners. Since ML is an emerging field, community support is a vital plus.
    + **Embeddable code** – Python code can be embedded as script snippets into traditional C, C++ or Java programs. This makes feature extensions easy, as legacy code need not be scrapped altogether.

### What are the disadvantages of Python and when to use alternative programming languages for Machine Learning?

Python also comes with some inherent drawbacks. Dynamic typing presents a problem to handle efficient memory management and garbage collection. So whenever performance critical features are to be implemented, better stick to C/C++ code, and make them Python extensions. Python is not the ideal choice for real-time data analysis either, due to its slower processing speed than C/C++.

R is another extremely popular language for Machine Learning as it is a language designed especially for scientific computation and statistical analysis, unlike Python which is a general purpose high-level language.

When an algorithm relies heavily on Java features (such as Android, IOT sensors, JDBC extensions), it is quite natural to write the ML portion also in Java.

### How are advanced ML features supported in Python?

Apart from general purpose Machine Learning, there are other allied applications such as Deep Learning, Neural Networks, and Natural Language Processing. These form the basket of frameworks for Artificial Intelligence. Python is ahead of alternative languages in support for such advanced applications.

Among the ML frameworks or packages are TensorFlow, Keras, PyTorch, fastai, Caffe2, Scikit-Learn, and Chainer. Theano is an old DL framework that's no longer maintained. In many of frameworks, the underlying implementation may be in another language but they expose Python APIs for use in Python-based applications. Popular Deep Learning frameworks include TensorFlow from Google, and PyTorch from Facebook. Although primarily in written in C++, developers can use the Python APIs to invoke these frameworks. They do however have interfaces in C++, R, and Java.

For Natural Language Processing (NLP), the **NLTK** Python library is widely used. There's also **Pattern** for data mining, NLP, and ML.

Image processing functions are supported by **OpenCV**, **scikit-image**, and **Pillow** frameworks.

### Could you mention some relevant tools for ML in Python?

For general scientific computing, **SciPy** is a handy package. **Dask** enables parallel computing. **High Performance Analytics Toolkit (HPAT)** is an alternative to Apache Spark to scale your apps to multiple clusters on the cloud. To optimized your code for performance, consider using **Numba** and **Cython**. To run efficiently on specific hardware, Intel offers **Intel® Math Kernel Library (MKL)** and **Intel® Distribution for Python**. Likewise, **PyCUDA** allows Python code to access Nvidia's CUDA parallel computation API.

Among the **IDEs** suitable for ML applications in Python are JuPyter/IPython Notebook, PyCharm (free or paid), Spyder, Rodeo, and Geany. Rodeo has been built specifically for ML and Data Science.

Among the **data visualization** packages in Python are Matplotlib, Seaborn, ggplot, Bokeh, pygal, Plotly, geoplotlib, Gleam, missingno, and Leather. Many are capable of many types of plots while others fulfil specific needs.

## Milestones

1990

This is the decade when Machine Learning algorithms move from being rule driven to data driven.

2000

Python 2.0 is released. The development of the language becomes more open and community driven.

2006

**NumPy** package of Python, for scientific computing is released. Statistical modelling for machine learning becomes simpler with this package.

2008

**Python 3.0** is released. Memory management becomes more efficient. This helps us process large data structures, as is common in ML.

2008

**Pandas** package of Python, for data manipulation and processing, is released. This simplifies data clean up and pre-processing, which are the first steps in a typical ML data pipeline.

2010

**Scikit-learn** package of Python sees its public release. It covers all the major ML algorithm implementations such as for regression, classification and clustering. This library simplifies ML programming for developers.

2015

Several Python-based Deep Learning (DL) frameworks (TensorFlow, Chainer, Keras) are released. **TensorFlow**, the most popular of them, is an open source Python library for fast numerical computing. Developed by the Google Brain team, it comes with strong support for Machine Learning and Deep Learning. Its flexible numerical computation core is used across many other scientific domains.

2017

Facebook brings GPU-powered Machine Learning to Python. **PyTorch** is a Python implementation of the Torch Machine Learning framework for deep neural network programming. It can complement or partly replace existing Python packages for math and stats, such as NumPy.

Machine Learning in Python


# Mock Testing

## Summary

Mock testing is an approach to unit testing that lets you make assertions about how the code under test is interacting with other system modules. In mock testing, the dependencies are replaced with objects that simulate the behaviour of the real ones. The purpose of mocking is to isolate and focus on the code being tested and not on the behaviour or state of external dependencies.

Let's say, a notification service triggers an email service. We don't want to send emails each time we run a notification test. However, we want to verify that the email-sending service is called. Such a service can be replaced with a mock object.

## Discussion

### Where is mock testing useful?

Mocking is generally useful during unit testing so that external dependencies are no longer a constraint to the unit under test. Often those dependencies may themselves be under development. Without mocking, if a test case fails, it will be hard to know if the failure is due to our code unit or due to dependencies. Mocking therefore speeds up development and testing by isolating failures.

Other reasons to mock dependencies is to avoid slow network calls or call third-party APIs. Mocking also enables product demos and evaluations. All units of a project can progress in parallel without waiting for everyone to be ready. Thus, testing can start early.

Code that have side effects should be called only in production. Examples include charging a credit card or sending a notification. Mocking is useful to validate such calls without the side effects.

Mocking avoids duplicating test code across similar tests. The task of verifying method or API calls from our module can be delegated to the mock.

### Could you give some examples of mock testing?

Let's say, an Order class fulfils orders by calling a Warehouse class. The latter knows the current inventory. If we are unit testing Order class, we mock the Warehouse. We don't care about testing Warehouse right now. But since it's a dependency for Order, we mock it. Our mock object can be called WarehouseMock.

A **mock object** provides a pseudo implementation of the same interface as the real object. Those calling it are unaware that it's a mock. Thus, to the Order class, WarehouseMock looks the same as Warehouse. This is just what we need to unit test Order class.

Another example is about an application calling an external API to get information about movies. Instead of making real calls, this can be mocked so that when API calls are made, the mock object will simply read and respond with test data from a local file system.

### Does mocking require developers to modify their codebase?

If your code uses static objects or singletons, then it's difficult to do mocking. In such cases, it's better to refactor code. Otherwise, in general, mocking doesn't require you to modify the codebase. In fact, **dependency injection** is the usual way in which objects should be created. Dependencies become visible in the constructors and other methods. These dependencies can therefore be easily replaced during testing with mock objects.  This can be configured either in code or via a configuration file.

### How is mock testing different from traditional unit testing?

In traditional unit testing, unit tests do assertions about states expected of either the system under test or its dependencies. With mock testing, no assertions are required from the unit tests themselves. Assertions are done by the mock objects. These objects are initialized in advance about what method calls are expected and how they should respond.

While unit tests are more about **state-based** verification, mock testing is more about **behaviour-based** verification. For example, let's assume that SecurityCentral is being tested. It depends on Door. When SecurityCentral activates full security, unit testing will verify the final state of Door, that it's closed. Mocking would instead verify that the correct method was invoked with expected arguments, such as `Door.close()`. Mocks register the calls they receive so these can be asserted.

### What are the common types of mock testing?

In **proxy-based mocking**, a proxy object is used instead of the original object. The proxy may handle all calls to the original object or selectively forward some calls. Mock frameworks such as EasyMock, JMock, Mockito offer this type of mocking. However, there may be limitations in terms of proxying `static/private/final` methods or a `final` class.

In **classloader-remapping-based mocking**, a class loader remaps the reference. Thus, it loads the mock object rather than the original one. Mock frameworks such as JMockit and PowerMock support this. This overcomes the limits of proxy-based mocking.

In Swift language, one developers blogged that he uses two ways to do mocking: **instance injection** and **configuration injection**. The former is simpler but it can't handle static objects.

### What are some best practices for mock testing?

Here are some best practices for mocking:

    + **Only mock types that you own:** External types have dependencies on their own. They might even change their behaviour in a future version. Instead, create an adapter and mock that adapter.
    + **Don't mock values:** Values should not be mocked. Mocking aims to make the relationships and interactions between objects visible. Getting a value is not an interaction.
    + **Avoid mocking concrete classes:** Relationships are easier to see via interfaces rather than concrete classes. We might end up mocking some methods but forget others. Mock roles, not objects.
    + **Don't mock everything:** This is an anti-pattern. If everything is mocked, we may end up testing something quite different from production system.
    + **Use integration tests**: When testing multiple modules or if you're interested in data coming from an external database, you should do integration testing rather than mocking.
    + **Negative tests**: Use mocks to simulate errors and test error handling. Use mocks to verify that some methods/APIs are *not* called.

### What are some mocking frameworks?

While it's possible to manually write mock objects, mocking frameworks simplify the task. Mockito is an open source testing framework for Java. Mockito is claimed to be the one of the popular ones.

JustMock and MOQ package are useful for .NET developers. . There's also JustMock Lite when dealing with loosely coupled code. Wiremock is suitable for mocking HTTP-based APIs.

For C++ developers, there's TypeMock and Google Mock. The latter is part of GoogleTest. TypeMock uses a templating approach to create mocks whereas Google Mock uses inheritance.

Other frameworks include EasyMock, JMock, JMockit, and PowerMock. Ease of use, maintainability and learning curve are some things to consider when choosing a framework.

### What are some limitations of mock testing?

Writing good mocks requires good understanding of dependencies. Otherwise, mocks may not accurately represent real-world behaviour. Mocking can lead to tight coupling between mocks and code under test.

Overuse of mock objects as part of a suite of unit tests can result in a dramatic increase in the amount of maintenance that needs to be performed on the tests themselves.

## Milestones

1999

Extreme Programming emphasizes unit testing and Test-Driven Development (TDD). Some adopters of Extreme Programming, based out of London, begin to think about how testing influences coding. They have been using "getters" to facilitate testing but they explore new ideas. They start avoiding "getters" and adopt **composition**, where test objects are passed via constructors. This is years before the term **Dependency Injection** is used for this design approach.

2000

Initial ideas of mock testing are presented at the XP2000 conference. At this time, the approach is called **Endo-Testing**. This name comes from the fact that mock objects are passed into domain code and tested from within. They claim that this simplifies testing architecture. It avoids polluting domain code since assertions are not in production code but in unit tests.

2001

EasyMock is released. It's the first library to provide dynamic mock objects.

Jun
2004

Version 1.0.0 of **jMock** is released. This provides an expressive API over **DynaMock** Java library. DynaMock itself comes from an earlier work by Nat Pryce who introduced mocking to Ruby. He emphasized assertions on messages passed between objects rather than just parameter values.

Jul
2008

Framework **Mockito** v1.5 for Java is released. By now, mock testing is more than just identifying where a test has failed. It's more about interactions among objects. Mockito simplifies mocking by taking a different approach compared to jMock or EasyMock. We don't have to set up expectations in mock objects in advance. We can simply create them and query them later after execution.

Apr
2007

Nat Pryce and Steve Freeman rework jMock to produce **jMock2**.

Dec
2008

Google releases **Google Mock**, a mocking framework for C++. Version 1.7.0 is released in 2013. In 2015, this is absorbed into the GoogleTest project.

Mock Testing


# Data Serialization

## Summary

Data serialization is the process of converting data objects present in complex data structures into a byte stream for storage, transfer and distribution purposes on physical devices.

Computer systems may vary in their hardware architecture, OS, addressing mechanisms. Internal binary representations of data also vary accordingly in every environment. Storing and exchanging data between such varying environments requires a platform-and-language-neutral data format that all systems understand.

Once the serialized data is transmitted from the source machine to the destination machine, the reverse process of creating objects from the byte sequence called *deserialization* is carried out. Reconstructed objects are clones of the original object.

Choice of data serialization format for an application depends on factors such as data complexity, need for human readability, speed and storage space constraints. XML, JSON, BSON, YAML, MessagePack, and protobuf are some commonly used data serialization formats.

## Discussion

### How does data serialization and deserialization work?

Computer data is generally organized in data structures such as arrays, tables, trees, classes. When data structures need to be stored or transmitted to another location, such as across a network, they are serialized.

For simple, linear data (number or string) there's nothing to do. Serialization becomes complex for nested data structures and object references. When objects are nested into multiple levels, such as in trees, it's collapsed into a series of bytes, and enough information (such as traversal order) is included to aid reconstruction of the original tree structure on the destination side.

When objects with pointer references to other member variables are serialized, the referenced objects are tracked and serialized, ensuring that the same object is not serialized more than once. However, all nested objects must be serializable too.

Finally, the serialized data stream is persisted in a byte sequence using a standard format. *ISO-8859-1* is a popular format for 1-byte representation of English characters and numerals. *UTF-8* is the world standard for encoding multilingual, mathematical and scientific data; each character may take 1-4 bytes of data in *Unicode*.

### What are the applications of Data Serialization?

Serialization allows a program to save the state of an object and recreate it when needed. Its common uses are:

    + **Persisting data onto files** – happens mostly in language-neutral formats such as CSV or XML. However, most languages allow objects to be serialized directly into binary using APIs such as the `Serializable` interface in Java, `fstream` class in C++, or Pickle module in Python.
    + **Storing data into Databases** – when program objects are converted into byte streams and then stored into DBs, such as in Java JDBC.
    + **Transferring data through the network** – such as web applications and mobile apps passing on objects from client to server and vice versa.
    + **Remote Method Invocation (RMI)** – by passing serialized objects as parameters to functions running on a remote machine as if invoked on a local machine. This data can be transmitted across domains through firewalls.
    + **Sharing data in a Distributed Object Model** – when programs written in different languages (running on diverse platforms) need to share object data over a distributed network using frameworks such as COM and CORBA. However, SOAP, REST and other web services have replaced these applications now.

### Could you list some text-based Data Serialization formats and their key features?

Without being exhaustive, here are some common ones:

    + **XML (Extensible Markup Language)** - Nested textual format. Human-readable and editable. Schema based validation. Used in metadata applications, web services data transfer, web publishing.
    + **CSV (Comma-Separated Values)** - Table structure with delimiters. Human-readable textual data. Opens as spreadsheet or plaintext. Used as plaintext Database.
    + **JSON (JavaScript Object Notation)** - Short syntax textual format with limited data types. Human-readable. Derived from JavaScript data formats. No need of a separate parser (like XML) since they map to JavaScript objects. Can be fetched with an `XMLHttpRequest` call. No direct support for `DATE` data type. All data is dynamically processed. Popular format for web API parameter passing. Mobile apps use this extensively for user interaction and database services.
    + **YAML (YAML Ain't Markup Language)** - Lightweight text format. Human-readable. Supports comments and thus easily editable. Superset of JSON. Supports complex data types. Maps easily to native data structures. Used in configuration settings, document headers, Apps with need for MySQL style self-references in relational data.

### Could you list some binary Data Serialization formats and their key features?

Without being exhaustive, here are some common ones:

    + **BSON (Binary JSON)** - Created and internally used by MongoDB. Binary format, not human-readable. Deals with attribute-value pairs like JSON. Includes datetime, bytearray and other data types not present in JSON. Used in web apps with rich media data types such as live video. Primary use is storage, not network communication.
    + **MessagePack** - Designed for data to be transparently converted from/to JSON. Compressed binary format, not human-readable. Supports static typing. Supports RPC. Better JSON compatibility than BSON. Primary use is network communication, not storage. Used in apps with distributed file systems.
    + **protobuf (Protocol Buffers)** - Created by Google. Binary message format that allows programmers to specify a schema for the data. Also includes a set of rules and tools to define and exchange these messages. Transparent data compression. Used in multi-platform applications due to easy interoperability between languages. Universal RPC framework. Used in performance-critical distributed applications.

### How do the various serialization formats compare on performance characteristics?

Here's a brief comparison:

    + Speed – Binary formats are faster than textual formats. A late entrant, **protobuf reports the best times**. With compressed data, speed difference is even greater. For apps that aren't data intensive or real time, JSON is preferable due to readability and being schema-less.
    + Data size – This refers to the physical space in bytes post serialization. For small data, compressed JSON data occupies more space compared to binary formats like protobuf. With larger files, the gap narrows. Generally, **binary formats always occupy less space**.
    + Usability – Human readable formats like JSON are naturally preferred over binary formats. For editing data, YAML is good. For complex data types, cross-platform serialization libraries allow data structure to be defined in schemas (for text formats) or IDL (for binary formats). Schema definition is easy in protobuf, with in-built tools.
    + Compatibility, extensibility – JSON is a closed format. XML is average with schema versioning. Backward compatibility (extending schemas) is best handled by protobuf.

### Which are the programming languages that offer good serialization support?

Platform-independent languages offer better support for data serialization. Java, the pioneer of object serialization, supports in-built serialization (`Serializable` Interface) and custom serialization (`Externalizable` Interface). Python has newly introduced the Pickle module for the same.

However, real-world environment is diverse and cross-platform. Most web applications are opting for platform-neutral data serialization formats. Open source formats JSON, XML, YAML, protobuf, MessagePack have support for all major programming languages such as C, C++, Java, Python, Perl, Go, etc. So the choice of language depends more on other factors, not on serialization any more.

### What are the potential risks that affect data due to serialization?

Naive use of object serialization may allow a malicious party with access to the serialization byte stream to read private data, create objects with illegal or dangerous state, or obtain references to the private fields of deserialized objects. Workarounds are tedious, not guaranteed. Oracle has promised to do away with object serialization and allow programmers to choose from open formats such as JSON, XML, etc.

Open formats too have their security issues. XML might be tampered using external entities like macros or unverified DTD schema files. JSON data is vulnerable to attack when directly passed to a JavaScript engine due to features like JSONP requests. Programmers need to take care of such security vulnerabilities in their code, before deploying their applications.

### Does the serialization process differ for Big Data?

Even in Big Data, serialization refers to converting data into portable byte streams. But schema control is another important target in Big Data. Issues in data consistency such as blanks or wrong data values can be very costly, involving heavy data clean-up effort.

The next important aspect is the ability to split and reconstruct data easily (for example by MapReduce). JSON or XML may not work well. Apache Hadoop has its own schema-based serialization format called Avro, similar to protobuf. Apache schemas are also defined based on JSON. Apache Hadoop uses RPC to talk to different components. Avro supports this very well.

## Milestones

1972

CSV format is used in IBM Fortran machines from as early as 1972. The name **CSV (Comma-Separated Values)** itself is coined in the era of modern PCs, about 1983.

1997

The term serialization is used in the context of data for the first time. In-built support for **language-specific serialization** is introduced in the Java language: `Serializable` interface for in-built support and `Externalizable` interface for user-defined implementation. Older languages like C did not have direct functions to serialize data.

1998

 **XML 1.0** becomes a W3C Recommendation. XML, like its more popular cousin HTML, is derived from the original markup language SGML, which was created in the pre-internet era of the 1980s.

2001

Douglas Crockford, credited with inventing **JSON**, popularizes its use around the year 2001. However, he reveals later that JSON was used at Netscape as early as 1996.

2004

 **YAML**, an extension of JSON, releases its first version.

2008

 **MessagePack**, another binary serialization format derived from JSON releases with support for all major programming languages.

2008

 **Protocol Buffers** from Google is released to the public. However, it's been in use internally since 2001.

2016

 **BSON** is released as an independent data serialization format in 2016. It originated in 2009 at MongoDB for its internal use.

2018

Oracle decides to drop the Java serialization feature from future Java versions, calls it a “horrible mistake”, due to data security issues. Intends to replace it with a plugin framework where users can choose their serialization format such as JSON, XML or YAML.

Data Serialization


# 5G NR SDAP

## Summary

Service Data Adaptation Protocol (SDAP) sublayer exists only in the user plane in both gNB and UE. It interfaces to upper layers via QoS flows and to the PDCP lower layer via Data Radio Bearers (DRBs). Traffic from QoS flows are mapped to suitable DRBs. This is an essential role of SDAP. SDAP layer doesn't exist in 4G/LTE since QoS flows were introduced only in 5G.

Quality-of-Service (QoS) is implemented in 5G using **QoS Flows**. On the Uu air interface between gNB and UE, data packets are carried in DRBs. Rules are either configured or derived to map QoS flows to DRBs. This mapping is executed at SDAP.

## Discussion

### What are the main functions of SDAP sublayer?

The main service provided by SDAP to upper layers is the transfer of user plane data. From lower layers, SDAP expects in-sequence delivery of PDUs except when out-of-sequence delivery is configured by RRC at PDCP.

Apart from the transfer of user plane data, SDAP maps QoS flows to DRBs in both DL and UL. It maps PC5 QoS flows to SL-DRB for sidelink communication. It marks packets with QoS flow ID (DL or UL) or PC5 QoS flow ID (SL).

RRC configures the rules by which SDAP does the mapping.  When uplink mapping is omitted, UE monitors the equivalent downlink mapping and applies the same to the uplink. This is called **Reflective QoS**. Reflective QoS is not supported for sidelink. It's also not applicable if DL SDAP PDUs don't have a header.

### Could you describe how SDAP sublayer handles a PDU session?

The SDAP sublayer can have multiple SDAP entities, one for each PDU session on the gNB-UE Uu interface. An SDAP entity establishment or release are initiated by RRC.

The mapping of QoS flows to DRBs is not one to one; that is, multiple QoS flows can be mapped to a DRB. In the figure we show an example of a single PDU session with 4 QoS flows mapped to 3 DRBs. The first two flows are mapped to a single DRB. Each DRB is handled by a single PDCP entity, which may translate to one or two RLC entities depending on the RLC mode.

In the uplink, a QoS flow is mapped to only one DRB at a time. A PDU session has at least one DRB. There's at most one **default DRB** in every PDU session. If there's no uplink mapping, SDAP PDU is sent on the default DRB.

Packets belonging to different PDU sessions go on different DRBs.

### Could you describe the format of an SDAP data PDU?

An SDAP data PDU includes an optional 1-byte header and a variable length payload. Payload length is communicated between SDAP and PDCP sublayers.

Presence of SDAP header in UL and DL are configured per DRB. A header isn't required if the DRB carries only one QoS flow. However, DL header presence is configured if reflective QoS is enabled. Any change to header presence is done in a synchronized manner such as a handover.

DL SDAP header includes a 1-bit RDI (Reflective QoS flow to DRB mapping Indication), a 1-bit RQI (Reflective QoS Indication) and a 6-bit QFI. UL SDAP header includes QFI. When RDI=1, UE updates QoS flow to DRB mapping for uplink. When RQI=1, UE informs NAS that Service Data Flow (SDF) to QoS mapping rules have been updated. 1-bit D/C field is set to 1 to indicate data PDU. 1-bit R field is reserved.

Non-GBR QoS flows can contain the Reflective QoS Attribute (RQA). This tells the NG-RAN to include QFI in downlink packets. UE may be configured to include QFI in uplink packets.

### Which are the SDAP control PDUs?

SDAP has only one control PDU called **end-marker**. It's sent to indicate that a specific QoS flow is no longer mapped to the DRB/SL-DRB on which this control PDU is sent. The QoS flow is indicated with a 6-bit QFI/PQFI field. A 1-bit D/C field is set to zero to indicate control PDU. A 1-bit R field is reserved.

When RRC configures a new mapping, SDAP will send the end-marker PDU on the previously mapped DRB or SL-DRB. The latter could be a previously configured DRB/SL-DRB or the default DRB/SL-DRB.

## Milestones

Jun
2017

At the 3GPP TSG-RAN WG2 #98 meeting, two proposals are made for SDAP operation: (a) QFI presence in SDAP PDU is configured semi-statically by RRC and can't be dynamically enabled or disabled; (b) SDAP header presence can be changed only via synchronized configuration such as a handover.

Sep
2017

SDAP specification TS 37.324 v1.0.0 is published.

May
2018

Jheng et al. of Mediatek Inc. file a patent detailing the operation of an apparatus that extracts from a downlink packet RQI and QFI. Subsequently, it derives the uplink Non-Access Stratum (NAS) mapping of Service Data Flow (SDF) to QoS flow. It's then able to send an uplink packet using this mapping. This is not actually an SDAP operation, since SDAP does only Access Stratum (AS) mapping of QoS flow to DRB.

Jun
2018

As part of **Release 15** specifications, SDAP specification TS 37.324 v15.0.0 is approved and published.

Jul
2018

Li-Te Pan of ASUSTek Computer Inc. files a patent that restricts the network from changing the SDAP header presence configuration of the first DRB after it's established. The patent describes the challenges in changing this configuration.

Mar
2020

As part of Release 16 specifications, SDAP specification TS 37.324 v16.0.0 is published. This includes changes necessary for **sidelink communication**.

5G NR SDAP


# Cascading Style Sheets

## Summary

Web content is structured in HTML. Apart from content, styling is also important. A web designer often wishes to control font style, text size, alignment, page layout, image size, colours, backgrounds, margins, and so on. Likewise, readers wish to customize styling without being at the mercy of bad web designers. **Cascading Style Sheets (CSS)** is a web standard that gives both authors and readers control over styling.

A web server will serve web browsers both HTML and CSS. User may supply her own stylesheet. Browsers will render the content according to the styles defined in one or more stylesheets. In addition, when these stylesheets don't define styles for some elements, browser will apply its own defaults.

CSS is a stylesheet language. It's standardized by W3C.

## Discussion

### What are the benefits of using CSS?

Back in 2002, Wired and ESPN were among the first sites to redesign their websites. They saw better performance, faster design changes, and easier style sharing.

One of the best practices of web design is to keep content and structure separate from presentation and styling. HTML provides the structure while CSS provides the styling. Before CSS, authors used **presentational HTML markup**, now deprecated by W3C. For example, if a `h2` tag had to be styled in a certain way, this extra markup would be included in every instance where the tag occurred. This made it difficult to maintain the code.

The **cascading** aspect of CSS is important. Both web authors and readers have control over styling. The author may choose to show `h3` tags in italics but the reader may have a different preference. The reader can therefore customize the style. Elements for which no styles are defined, browser defaults apply.

Another important concept is **inheritance**. An element inherits styles of its ancestor elements (parent, grandparent, etc.). The element itself can have an overriding style declaration.

### Is CSS a programming language?

Some don't consider CSS a programming language. Others view CSS as a **declarative domain-specific programming language**.

It's declarative because CSS specifies a bunch of constraints. It tells rendering engines what's required but not how it should happen. Unlike an imperative language such as JavaScript, CSS doesn't give step-by-step instructions on how rendering should be done. This implies that control flow is implicit in declarative languages.

Unlike general purpose languages such as C or Python, CSS is domain-specific. It's been created for styling elements on a webpage.

On the final point about being a programming language, the very definition of the phrase "programming language" can be narrow or wide. CSS has functions, variables, math, and more. It wouldn't be entirely wrong to consider it a programming language.

### How do I specify a style in CSS?

We can style an element by specifying a *property* and assigning a *value* to that property. Property and value are separated by a colon. Taken together, the syntax `property: value;` is called a *declaration*. Multiple declarations can be specified for the same element and these are separated by semi-colon. For readability, each declaration can be on a separate line. Multiple declarations are grouped together for the same element using a pair of braces `{...}`.

We also need to select a DOM element to which the CSS declarations are to be applied. This is done using the *CSS Selector*. There are many ways to specify the selectors including class name, identifier, tag name, attribute value, and more. The position of the element within the DOM structure can also be used. For example, `li.active a` selects anchor tags appearing within list items of class `active`.

A CSS selector plus its set of declarations are jointly called a *ruleset* or simply a *rule*.

### Which are the CSS properties and their permitted values?

CSS properties and values are too numerous to mention here. We share some of them to give you a sense of what's possible in CSS:

    + `background`: example values include `green` (colour), and `no-repeat url("../../media/examples/lizard.png")` (image).
    + `border`: use `2px dotted` for width and style.
    + `color`: specify the foreground (text) colour with values such as `#00ff00`, `red`, `rgb(214, 122, 127)`, and `hsla(30, 100%, 50%, .3)` (with alpha value as fourth argument).
    + `float`: control the wrapping of an element around other elements with values such as `none`, `left`, `inline-start` and `table-row`.
    + `font-weight`: control font boldness with values such as `normal`, `bold`, `bolder`, `lighter`, `100`, and `400`.
    + `margin`: use `1em` margin on all sides or `2px 1em 0 auto` margin on top, right, bottom and left respectively.
    + `text-decoration`: an example value is `underline dotted red`, which specifies line, style and colour.All properties accept values `inherit`, `initial` or `unset` to revert to ancestor or global values.

Some properties such as `margin` are shorthand forms. For better readability, longer forms may be used, such as `margin-top`, `margin-right`, `margin-bottom` and `margin-left`.

### How are CSS styles delivered to clients for rendering a webpage?

One common way to do this is to save all CSS rules within a file of extension `.css`. A stylesheet is linked from HTML pages using the `<link>` tag. Browsers will request the stylesheets when they see these links. An alternative is to include CSS rules with HTML `<script>...</script>` tag. The third method (not preferred) is to inline the styles with each element using the `style` attribute. It's possible to combine all these approaches for a single webpage. Due to its cascading nature, CSS figures out the final style to apply for each element.

CSS styles have global scope, meaning that a selector can target any element of the DOM. The early 2010s saw a trend towards Single Page Applications (SPAs). Frameworks such as Augular, React and Vue emerged. About mid-2010s, **CSS-in-JS** emerged as a new way to scope styles to specific page components. CSS rules were defined within JavaScript code of each component.

### Which are the key features of CSS?

CSS has lots of features and we note a few of them:

    + **Animations**: Visual effects can be created for better user engagement, for example, on mouse hover. Using *CSS 3D Transforms*, a 360-degree view of a product can be displayed.
    + **Calculations**: Simple calculations to automatically size an element can be done with `calc()`.
    + **Custom Properties**: Defined at root or component level, browser will substitute all instances with its value. For example, it's useful for theming.
    + **Gradients**: Large images can be replaced with *CSS Gradients* that allow for smooth transitions across colours.
    + **Image Filters**: Background images, colours and gradients can be combined for creating visual effects. Images can be clipped or converted to grayscale.
    + **Layouts**: Beyond the use of tables, diverse layouts can be created with *CSS Grid* and *CSS Flexbox*.
    + **Media Queries**: These are useful for creating responsive designs. System-wide preference for dark mode can be fulfilled.

### Besides HTML, where else is CSS useful?

Even in the early days of CSS, it was recognized that stylesheets could apply to markup languages other than HTML.

CSS has been used with HTML, XML and XHTML. While CSS is common in web browsers many other software also use CSS. PDF generators parse HTML/XML+CSS to generate styled PDF documents. E-books, such as the popular EPUB format, are styled using CSS. Style languages have adopted CSS for their custom requirements: Qt Style Sheets and JavaFX Style Sheets for UI widgets, MapCSS for maps.

Of interest to developers, the popular jQuery library has the method `css()` to set and get any CSS property value of an element. For test automation, Selenium allows developers to select DOM elements using CSS selectors as an alternative to XPath selectors.

### Could you share some developer resources for working with CSS?

Visit W3C site for a description of all CSS specifications or search for CSS standards and drafts. W3C also provides a free online CSS Validation Service to validate your stylesheets.

For a showcase on CSS capabilities, visit CSS Zen Garden. CSS-Tricks is a popular blog focused on CSS for developers. CSS Reference includes every CSS property and rendering of the same at different values. A similar site is DevDocs.

The CSS page at Mozilla's MDN Web Docs is a good place for beginners. The site has tutorials and shares a cookbook of common layout patterns.

Nan Jeon has shared a handy cheatsheet on CSS selectors. Each example includes HTML structure and infographic. Make A Website Hub has published another useful CSS cheat sheet.

## Milestones

1980

In the 1980s, stylesheets are created as part of Standard Generalized Markup Language (SGML). These are named Document Style Semantics and Specification Language (DSSL) and Formatting Output Specification Instance (FOSI). Though considered for the Web a decade later, they have a limitation: they can't combine styles from different sources.

Dec
1990

Tim Berners-Lee has a working web server and a browser on his NeXT computer at CERN. There's no CSS at this point but Berners-Lee recognizes that it's good to keep document structure (content) separate from its layout (styling). His browser has the means to select style sheets. He doesn't publish the details, leaving it to browsers to control styling. Indeed, when Pei-Yuan Wei creates the ViolaWWW browser in 1991, it comes with its own stylesheet language.

Oct
1994

Håkon Wium Lie releases a draft titled *Cascading HTML Style Sheets*. This gets discussed, along with alternative proposals, at the Mosaic and the Web Conference in Chicago in November. Lie's proposal has the advantage of being designed for the Web. Styles can be defined by the author, the reader, the browser or even based on device display capabilities. Lie's proposal could combine or "cascade" styles from different sources.

Aug
1996

Microsoft's Internet Explorer (IE) becomes the first commercial browser to support CSS. IE has good support for font, colour, text and background properties but poor support for the box model. When IE6 comes out in 2001, it has much better support for CSS and a browser market share of 80%.

Dec
1996

**CSS Level 1** or **CSS1** is released as a W3C Recommendation. CSS1 allows styling of fonts, colours, background, text, and lists. Box properties include width, height, margin, padding, and border. A revised version of CSS1 is published in April 2008. In September 2018, W3C officially supersedes this by more recent Recommendations.

May
1998

**CSS Level 2** or **CSS2** is released as a W3C Recommendation. It's now possible to position elements and style page layout using tables. To target media types and devices, `@media` rule is introduced. CSS2 expands the syntax for selectors.

Oct
1998

Each browser renders CSS1 differently due to non-conformance to the specifications. Todd Fahrner creates the "acid test", a CSS1-styled document that a browser must render exact to the pixel. This is based on the work done by Eric Meyer and others who developed a CSS test suite. In later years, more acid tests are defined. These are available at acidtests.org.

Jun
1999

The first drafts for **CSS Level 3** or **CSS3** are published by W3C. In fact, work on CSS3 started just after the release of CSS2. Unlike, CSS1 and CSS2, CSS3 takes a modular approach. There's no single document.

May
2003

Across browsers, support for CSS is inconsistent. Web designers prefer to avoid CSS and use HTML tables instead. Web designer Dave Shea sets out to change this by showcasing good CSS designs. He launches the website *CSS Zen Garden* with simple HTML content that could be styled differently by changing only the CSS. He showcases five of his own examples. A little later, he allows public to submit their own CSS designs.

May
2011

CSS3 is a collection of separate documents. It becomes difficult to release these documents due to interdependencies. It's therefore proposed that CSS3 will be based only on CSS2.1. Each document will have its own levelling. When CSS2.1 becomes a Recommendation, stable modules of CSS3 will also become Recommendations on their own. This modularization doctrine is documented in the *CSS Snapshot 2007*, which is meant for implementors to know the current state of standardization.

Jun
2011

**CSS Level 2 Revision 1** or **CSS2.1** is released as a W3C Recommendation. CSS2.1 fixes some errors present in CSS2, removes poorly supported features and adds features already supported by browsers. It comes after more than a decade of edits, often changing status between Working Draft and Candidate Recommendation.  Subsequently, for CSS3, CSS Color Level 3, Selectors Level 3, and CSS Namespaces are published as Recommendations.

Apr
2020

CSS now has more than a hundred documents at different levels. It may no longer make sense to use the terms "CSS3" or "CSS4". CSS continues to evolve with more capabilities.

Cascading Style Sheets


# Test-Driven Development

## Summary

In traditional software development (such as the Waterfall Model), the order of work is design, code and test. Test-Driven Development (TDD) reverses this order to test, code and design/refactor. In other words, writing tests becomes the starting point. For this reason, TDD is sometimes called *Test-First Programming*.

It's common in traditional workflows to have lengthy design and implementation phases. Once code is "frozen", testing begins. TDD instead recommends small incremental cycles. This leads to frequent feedback and immediate course correction. Continuous Integration (CI) and Shift Left are practices or techniques that are aligned with TDD.

TDD has its roots in Agile methodology and eXtreme Programming (XP). While TDD brings many benefits, it may not suit all projects. Project managers must access the context and apply it accordingly.

## Discussion

### Which are the main steps in TDD?

The TDD cycle or process has three distinct steps:

    + **Test**: Developer writes a unit test first. Since the corresponding feature is not yet implemented in the application code, the test should fail.
    + **Code**: Developer writes the code with the goal of quickly passing the test. Other existing tests should also pass to confirm that nothing is broken.
    + **Refactor**: Design is implicit in the preceding step. Since developer might have written the code quickly, this step is an opportunity to improve the design. Since tests are in place, developer can confidently refactor and improve the design.The three-step process is also called **Red-Green-Refactor**, where red implies a failing test and green implies a passing test.

Sometimes the TDD cycle is described in five steps: understand the requirements first, execute the three steps of test-code-refactor, and finally repeat the process.

### What's the essence of TDD?

While testing is an essential aspect of TDD, TDD is not about testing. Tests are used as a means towards clean code that's less buggy. TDD is a way of developing software. It's not about how to write or execute tests. It's tests driving implementation.  For this reason, it's been said,

> Only ever write code to fix a failing test.

While testing first is certainly important, studies have shown that the real benefits come from **incremental development**. Developers must work on small features and in short cycles of test, code and refactor. To work on large and complex features that take many days or weeks is the wrong way of doing TDD.

TDD gives developers quick **feedback** on whether the code works as desired. Developers can refactor code more confidently since failing tests can catch problems early on. A related aspect is that tests are written by developers, not by a separate QA team.

### What are the benefits of TDD?

Tests in TDD are derived from requirements. Tests therefore specify precisely what needs to be built and nothing more. This helps us avoid shipping a wrong product or an overengineered product.  Tests are "living documentation", helping us understand both the requirements and the code.

TDD can help developers avoid "paralysis by analysis". By breaking down the requirements into smaller parts, incremental and consistent progress can be achieved. These parts becomes less coupled and system design becomes less of a monolith. TDD's incremental nature helps the creative process since the developer focuses on one small part at a time.

Tests become a safety net. Developers can fearlessly experiment or refactor. They can continuously improve the design or implementation.

TDD creates unit tests that become useful within a CI/CD pipeline. Tests can be made to execute at every build or code commit. When tests fail, developers notice it immediately. This avoids costly integration effort later on.

TDD encourage developers to write more tests. With more tests, debugging time reduces. There are fewer defects. Code becomes more cohesive and less coupled.

### What techniques are there for writing tests in TDD?

Start with small tests. For example, a feature or bug fix may involve many building blocks. Test each of those building blocks before attempting an end-to-end feature test. Each small test may run in isolation or within an end-to-end workflow containing stubs for the other blocks.

Unit tests should be automated and they should run fast. They shouldn't depend on one another. Tests that are hard to initialize, have many dependencies, cover many scenarios or show little reuse are code smells. Too many tests per class or too many mocks are also code smells. Test code should follow SOLID design principles.

Units tests shouldn't create side effects such as calling an external API. Instead, mock external dependencies. This makes tests deterministic and repeatable.

Have a good naming convention for test names. When such a test fails, its name will immediately suggest what aspect of the software isn't working.

Tests may assert states of objects, values in databases or return values. Alternatively, tests may assert messages that are exchanged between two blocks of code. Whether state-based testing or interaction-based testing, adopt what makes sense for the project.

### What are some best practices for TDD?

Management and developers must first commit to TDD. This commitment can help overcome old habits and migrate from test-last workflows. Avoid partial adoption where only some developers in the team use TDD.

TDD doesn't imply that we don't need a QA team. While TDD covers unit testing, the QA team can look at integration and system testing. In fact, TDD may not be the best way to test for concurrency and security.

Code refactoring can be about changing structure or improving design. Refactor in a controller manner and in small steps. Refactor to change internal structure without affecting external behaviour. Moving from one design pattern to another is an example of refactoring.

### What are some criticisms of TDD?

TDD requires initial effort. Since developers don't write application code until later, progress can be slow. TDD involves extra effort due to refactoring.

Even 15 years after the birth of TDD, studies have failed to observe the benefits of TDD. There's no strong evidence that TDD improves code quality and productivity. Lack of testing skills among developers is a limitation.

One study found that testing first doesn't contribute to the benefits of TDD. The main contributing factor is TDD's incremental process.

Often requirements at the start of a project are vague, even from the client's perspective. They evolve as the project progresses. By following TDD, tests will need to be rewritten often as requirements evolve. This is extra effort. TDD advocates that developers write tests. The developer could make the same mistake in both application code and test code. This defeats the purpose of testing.

By focusing on unit tests, TDD compromises system-level design. It leads to complex interactions, indirections, conceptual overheads, command patterns, and more. Hard-to-unit-test code is not necessarily bad design. In fact, integration tests are better than unit tests for controllers under the MVC pattern. System tests are better for views.

### What are some variations of TDD?

TDD unit tests verify isolated pieces of code. But do these parts satisfy high-level requirements? This issue is addressed by **Acceptance TDD (ATDD)**. Tests are derived from specification and requirements. ATDD works at the system level whereas TDD works at the implementation step of each feature. ATDD improves external quality whereas TDD improves internal quality.

**Behaviour-Driven Development (BDD)** is derived from TDD. It shifts the focus from testing to behaviour, requirements and design. BDD could be seen as TDD done right. BDD has been called by other names including Story TDD (STDD), executable acceptance testing, and specification by example.

In the world of microservices, **Contract-Driven Development (CDD)** can help test interfaces from the perspective of both consumers and providers of service APIs. This mitigates the problem of finding problems later during integration testing. An earlier form of CDD was called Agile Specification-Driven Development that combined TDD and Design by Contract.

Domain-Driven Design (DDD) can work with TDD for experimentation and iterative design. One suggested approach is to think outside in (BDD), view the big picture (DDD) and then think inside out (TDD).

### What tools are available to practice TDD?

Many programming languages and IDEs support TDD. There are frameworks that support unit testing, mocking, end-to-end testing, or acceptance testing. Other frameworks support variations of TDD such as BDD. The figure shows a selection of these.

Consider a Node.js project as an example. We note some useful tools: *Node Version Manager (NVM)* for versioning, *Jest* for unit testing, *ESLint* for linting, *Prettier* for formatting, and *lint-staged* for linting on staged files via the pre-commit Git Hook.

Some IDEs can generate stub methods or modify method arguments based on the usage in test cases.

## Milestones

1957

McCracken writes in his book *Digital Computer Programming* that tests may be written before coding. Moreover, it's advisable that such tests are written by the customers rather than by the programmers themselves. This helps to bring out misunderstandings and logical errors.

1960

In the early 1960s, programmers at NASA working on the Mercury Space Program write test cases on punched cards before writing the program code. They work on half-day iterations doing test-first micro-increment cycles. Their approach is top-down with stubs. Engineers on this project were doing **incremental development** as early as 1957.

1994

Kent Beck codes the first version of *SUnit* test framework for Smalltalk. About a year later he demos TDD to Ward Cunningham at the OOPSLA conference.

1998

Kent Beck coins the term **TDD** in his book *Extreme Programming Explained: Embrace Change*. A point to note is that TDD has always been a part of Extreme Programming although only now it's being named TDD.

2002

Kent Beck publishes a book titled *Test Driven Development: By Example*. He describes TDD as "a proven set of techniques that encourage simple designs and test suites that inspire confidence." The goal is "clean code that works." He also notes that the idea of writing tests first is not new. Years later he notes that he "rediscovered" TDD rather than invented it.

Mar
2003

An early study of TDD shows that it produces code that passes 18% more black box test cases compared to the Waterfall model. TDD tends to produce more tests. However, developers took 16% more time.

Sep
2003

Dan North starts working on *JBehave* as a replacement for *JUnit*. He introduces a vocabulary around behaviours rather than tests. Tests should actually describe behaviours. This becomes the starting point for **Behaviour-Driven Development (BDD)**. Inspired by DDD, BDD introduces (in 2004) a common language to describe user stories and acceptance criteria.

2004

**Story TDD (STDD)** is born as an XP practice. It brings together developers, testers and customers to discuss the requirements before any code is written. Chunks of functionality are grouped into stories. Stories are detailed. Tests are written for them. Thus, everyone arrives at a common understanding of what's to be built. In 2010, Park and Maurer review the literature on STDD.

2008

In a blog post, Grenning presents a useful visualization of how TDD saves time and cost. He compares it to the traditional approach of coding first and testing later, something he calls "Debug Later Programming". He makes the point that bugs in code are unavoidable and therefore testing is essential. When a test fails in TDD, we usually know the problem since only small changes have been made. Feedback is immediate. This avoids long debugging sessions.

2010

In a survey of Agile practitioners, 53% claim to use TDD. At an Agile webinar, 50% claim to use TDD. A Forrester survey shows only 3.4% adoption of TDD among IT professionals. However, TDD was not well-defined in this survey. It was listed alongside Scrum and XP when in fact TDD is a practice that can used within these methodologies. Likewise, results from other studies during this period must be analysed in the context of how TDD was defined or interpreted.

2014

Mäkinen and Münch analyze current literature and learn that TDD reduces defects, makes code more maintainable and improves external quality. However, it doesn't seem to improve productivity or internal code quality. Meanwhile, Martin Fowler, Kent Beck, and David Heinemeier Hansson engage in a series of discussions asking "Is TDD Dead?" They address TDD's limitations and how not to do TDD.

Test-Driven Development


# IEEE 802.11ad

## Summary

In scenarios where we desire throughput in excess of 1 Gbps and low latency, such as in home or office environments, we still use wires. At least, there wasn't a suitable Wi-Fi protocol to cater to these scenarios until IEEE 802.11ad was conceived.

IEEE 802.11ad is a protocol for very high data rates (about 8 Gbps) for short range communication (about 1-10 meters) at the 60 GHz unlicensed band. Because of its 60 GHz operation band, 802.11ad complements but does not interoperate at the PHY layer with 802.11ac at 5 GHz band. This standard is also called **Directional Multi-Gigabit (DMG)**. Commercially, the term **WiGig (Wireless Gigabit)** is common.

Vendor support for IEEE 802.11ad has been growing since 2016. This standard has an evolution path towards IEEE 802.11ay, which also operates in the 60 GHz band.

## Discussion

### What are the typical use cases for 802.11ad?

We are surrounded by gadgets at home, office and even in our daily commutes. Content is also media rich and there's a need to stream HD videos or play interactive games. Wires are one option but going wireless would be lot more convenient. Think about connecting your laptop to a projector; or connecting Blu-ray player to HDTV; or sharing content from one phone to another; or playing a virtual reality game with wireless controls.

IEEE 802.11ad enables us to get rid of wires in homes and offices. It can be used for wireless docking, display, entertainment, instant file transfers, HD media streaming, AR/VR apps, and more. In general, applications that require high bandwidth (> 1 Gbps) and low latency (~ 10 us) can benefit from 802.11ad. With 802.11ad, it becomes possible to connect without wires consumer electronics devices, handheld devices and personal computers.

This standard is ideal for short range line-of-sight (LOS) connections, although non-LOS is possible due to multiple antennas. It could also see usage in public Wi-Fi infrastructure and small cells backhaul.

### What frequency bands are used by 802.11ad?

Previously, in the 802.11-2016 standard, 802.11ad had four channels in the range 57-66 GHz. Today, IEEE 802.11ad operates in the 57-70 GHz frequency range. Six channels are available with each having a nominal channel bandwidth of 2.16 GHz. Channel 2 (59.40-61.56 GHz) is available in all regions and is considered as the default channel.

Channel bandwidth of 2.16 GHz is a lot of spectrum, thus allowing 802.11ad to offer multi-gigabit speeds. Comparatively, the most that 802.11ac Wave2 can offer is 160 MHz via channel bonding.

### What are some technical details or parameters of 802.11ad?

At the PHY layer, 802.11ad has three modes: Control, Single Carrier (SC), and OFDM. Later, OFDM mode was made obsolete. There's also the optional Low-power Single Carrier mode for mobile devices.

802.11ad does not support spatial multiplexing such as MIMO. It supports a single spatial stream on a single channel. However, it supports **beamforming** for spatial separation and directional operation. Up to 32 antennas are possible. 2 Gbps at 100 feet LOS is possible.

A variety of modulation and coding schemes (MCS) are available. MCS0 is for Control. MCS1-12 with extensions are for SC mode. MCS25-31 are for Low-power SC mode. MCS13-24 are for OFDM mode. Data rates vary from 385 Mbps to 8085 Mbps. The maximum rate is achieved in MCS12.6 using π/2-64QAM and Low Density Parity Code (LDPC) at rate 7/8. Maximum rate for Low-power SC is at MCS31 giving 2503 Mbps.

Compared to 802.11ac, 802.11ad is more power efficient. It has five times lower power consumption per bit.

The MAC frame consists of preamble, header, data, and optional training for beamforming. **Golay Sequences** are extensively used in the preamble.

### Could you explain Fast Session Transfer?

**Fast Session Transfer (FST)** is a MAC layer feature of 802.11ad that allows for multiband operation. While 802.11ad is incompatible with older standards at the PHY layer due to operation in 60 GHz, interoperability is possible at the MAC layer. FST is managed by a Common Upper MAC sublayer that sits on top of Lower MAC sublayer containing band-specific implementation.

With FST, we can have seamless transfer of sessions from 60 GHz band to other bands, and vice versa. For example, if a better range is desired then the session may be transferred from 60 GHz to 5 GHz while sacrificing throughput. A session transfer that involves a different MAC address may be slower than when same MAC client and address is used for all bands. Some devices may be capable of supporting multiple bands at the same time. TP-Link's AD7200 offers such a multiband operation.

A related concept is called **band steering** where an access point presents a single SSID for clients across all bands. This is supported by some D-Link routers but not by TP-Link's AD7200.

### Who are currently supplying 802.11ad chipsets?

Chipsets are available from Broadcom, Intel, Qualcomm Atheros, Wilocity, Tensorcom, Peraso, Lattice Semiconductor, MediaTek, Nitero, and others. Wikipedia gives a list of specific chips from these vendors.

At CES 2013, Wilocity was one of the first to give a prototype demo of the technology based on its chips. The Wilocity chip was also used in the Dell Latitude 6430u Ultrabook. In July 2014, Wilocity was acquired by Qualcomm. Qualcomm stated that their future chips will be tri-band: 2.4 GHz, 5 GHz and 60 GHz.

### Commercially, what 802.11ad products are currently available?

Wireless routers and access points are available from Netgear, Acelink, TP-Link, IgniteNet and Asus. In January 2016, Acer released TravelMate P648 notebook with 802.11ad support. Asus announced a 802.11ad smartphone back in September 2017.

TP-Link's Talon AD7200 claims a theoretical speed of 7200 Mbps via multiband operation but a speed test over a distance of couple of meters gave 868 Mbps downlink and 280 Mbps uplink.

### What are the alternatives to 802.11ad?

IEEE 802.11ad is not the only protocol for multi-gigabit wireless.

There's SiBeam's **WirelessHD** (aka **UltraGig**), also operating in the 60 GHz band. Back in 2010 when 802.11ad was being standardized, SiBeam was already shipping its chips for integration into consumer products. WirelessHD is designed for video, as high as 28 Gbps. This means that uncompressed 1080p FullHD video can be transmitted. WirelessHD specs were released in January 2008. However, WirelessHD website shows no news after 2013.

There's also **Wireless Home Digital Interface (WHDI)**, which operates in the 5 GHz band. It's purpose is to deliver interactive HD video from any device to any display, with quality equivalent to wired HDMI cable.

Let's not forget **Miracast**, which runs over 802.11n or 802.11ac in the 5 GHz band. With Miracast, for example, we can stream content from a smartphone to a TV.

### How is 802.11ad related to Media Agnostic USB?

In September 2013, Wi-Fi Alliance transferred its work on "WiGig Serial Extension Specification" to USB-IF (USB Implementers Forum). USB-IF will use this as a starting point for standardising **Media Agnostic USB (MA-USB)**. An alternative standard called **Wireless USB** operates in the range 3.1-10.6 GHz. MA-USB is agnostic of the underlying technology. Data could be transferred on Wi-Fi 2.4/5 GHz or WiGig 60 GHz.

## Milestones

Jan
2009

At the IEEE, the VHT Study Group starts looking into **Very High Throughput (VHT)** at 60 GHz. Both 802.11ac and 802.11ad come under the scope of VHT.

May
2009

About 15 technology companies come together to form **Wireless Gigabit (WiGig) Alliance**, an organization tasked with defining a wireless specification at the 60 GHz band.

Dec
2009

Version 1.0 of the WiGig specification is released. It supports data rates up to 7 Gbps. WiGig 1.0 announced

May
2010

Wi-Fi Alliance and WiGig Alliance enter into a partnership. This enables Wi-Fi products in the 60 GHz band. Wi-Fi Alliance commits to studying the WiGig specs and perhaps certify for it.

Dec
2012

As an amendment to the overall IEEE 802.11, **IEEE 802.11ad-2012** is published with the title "Enhancements for Very High Throughput in the 60 GHz Band". It contains changes to both PHY and MAC layers. This is subsequently amended in March 2014.

Mar
2013

After two years of collaboration, Wi-Fi Alliance and Wireless Gigabit Alliance merge. Further work on WiGig, including product certification, will be taken up by Wi-Fi Alliance.

Jan
2016

At CES 2016, TP-Link demos its WiGig router, Talon AD7200. At 60 GHz, it claims 4.6 Gbps raw data rate. It also supports a/b/g/n/ac standards where 802.11ad is not available. It has eight antennas for beamforming. Inside, it uses two Qualcomm Atheros chips, one for older standards and another for 802.11ad. Also at CES 2016, Acer shows off its TravelMate P648 with 802.11ad support.

Mar
2016

OFDM mode has interoperability issues with Single Carrier (SC) mode. As a result, OFDM mode is made obsolete. In future, 802.11ay may design a proper OFDM PHY at 60 GHz. This change goes into IEEE 802.11-2016 standard, released in December 2016.

Sep
2017

Asus ZenFone 4 Pro becomes the world's first smartphone to support WiGig. It's not clear if the device is certified by the Wi-Fi Alliance. It uses Snapdragon 835 Mobile Platform.

IEEE 802.11ad


# TIP OpenWiFi

## Summary

OpenWiFi is an community-developed open source platform to lower the cost of developing and operating Wi-Fi networks, and to accelerate the innovation of services. Traditionally, every service provider or OEM would build the Wi-Fi stack from scratch for specific hardware. OpenWiFi provides an open implementation of the stack along with certified hardware on which the stack can run. It provides open APIs that enable device management from the cloud.

Launched in 2021, OpenWiFi is an initiative of the Open Converged Wireless (OCW) software project group under the Telecom Infra Project (TIP). This follows from other TIP initiatives such as OpenRAN and Open Optical & Packet Transport (OOPT).

With 16 billion+ Wi-Fi devices in use, Wi-Fi is projected to grow further, particularly when 6 GHz band is being approved for unlicensed use. Wi-Fi complements 5G. Given this context, OpenWiFi has generated much interest in the industry.

## Discussion

### Given open source projects such as OpenWrt and DD-WRT, why do we need OpenWiFi?

OpenWrt and DD-WRT are based on WRT54G router firmware open sourced by Linksys back in 2003. Since then, the open source community has maintained and evolved such firmware to support new devices and Wi-Fi features as the need arose. Thus, these codebases grew without a top-down approach. There's no certification program to ensure that the firmware runs on a particular router hardware. Moreover, there are plenty of variants and alternatives to OpenWrt, leading to fragmentation.

Under TIP, OpenWiFi is a coordinated approach to openness within the Wi-Fi ecosystem. It uses OpenWrt. It brings all stakeholders including corporations, industry alliances and open source communities. A single codebase can be used on any compliant whitebox hardware. A standardized open API allows access points to be managed from the cloud. Application developers can use the API to build innovative services on the cloud and target any device running on the OpenWiFi stack.

TIP OpenWiFi should not be confused with OpenWiFi Labs Private Limited, OpenWiFi (an R&D prototype) or openwifi (an SDR implementation).

### What are the benefits of OpenWiFi?

OpenWiFi's open codebase and compliance testing means that Wi-Fi solution providers don't have to build everything from scratch. OpenWiFi therefore enables them to **lower R&D costs** without compromising on latest features or developments in Wi-Fi. With lower barriers to entry, new service providers can come into the market.

Rather than focusing their efforts on "Wi-Fi plumbing", enterprises can focus on **service innovation**. In other words, they can focus on innovative applications rather than the Wi-Fi stack itself.

OpenWiFi also enables multi-vendor selection of cloud controllers and access points. There's no vendor lock-in. Service providers get **choice and flexibility**.

Due to economies of scale, OpenWiFi is expected to bring down CAPEX and OPEX, leading to **lower Total Cost of Ownership (TCO)** compared to current proprietary solutions.

### What is the OpenWiFi stack?

The two main layers of the OpenWiFi stack are:

    + **Access Point Firmware**: Among its features are support for multiple topologies, multiple authentication standards, Passpoint®, and Zero Touch Provisioning. Wi-Fi standards supported include Wi-Fi 4/5/6 or IEEE 802.11n/ac/ax. Its Network Operating System (NOS) features include embedded captive portal, airtime fairness, local provisioning over SSID, SSID rate limiting, inter-AP communication, and many more.
    + **Cloud Controller SDK**: Among its features are Zero Touch Provisioning, firmware management, RESTful Northbound Interface (NBI), data model-driven API, template-based device provisioning with RADIUS profile management, and advanced RF control with RRM. It also enables remote troubleshooting and service assurance.

### Who are the players involved in OpenWiFi?

In May 2021, OpenWiFi included more than 100 participants including services providers, Original Equipment Manufacturers (OEMs), Original Design Manufacturers (ODMs), Independent Software Vendors (ISVs), system integrators, silicon vendors and industry organizations. These names include Qualcomm, MediaTek, TP-Link, Edgecore Networks, T-Mobile, Vodafone, NetExperience, Facebook, and many more.

ODMs will offer whitebox access points that are OpenWiFi compatible and address various use cases. OEMs will bring together whitebox hardware and OpenWiFi stack to offer commercial solutions. OEMs are expected to offer innovative services that can be accessed via the OpenWiFi cloud controller. Finally, enterprises and service providers will take what OEMs provide to deploy Wi-Fi networks for specific use cases.

TIP's Open Converged Wireless software project group that manages OpenWiFi has noted that it will collaborate and reuse software components from other groups including Wi-Fi Alliance, Wireless Broadband Alliance (WBA), and OpenWRT. An example of this is WBA's OpenRoaming standard that OpenWiFi has adopted.

### How do I get started with OpenWiFi?

The easiest way to start is to purchase a certified TIP OpenWiFi AP and partner with cloud providers who can simplify the deployment. To create custom builds, the OpenWiFi source code is available under TIP's GitHub account. However, use of the code requires OCW membership.

OpenWiFi's official documentation mentions high-level features of the Access Point (AP) and Cloud Software Development Kit (SDK). As on June 2021, the documentation was pretty basic and incomplete, possibly because the project was still very new.

To contribute to the project, an individual or company needs to become a TIP member.

## Milestones

Feb
2021

TIP Board of Directors approve **Open Converged Wireless (OCW)** as a software project group under Telecom Infra Project (TIP). It's described as "a dedicated open source community for the design, development & testing of converged wireless connectivity systems software for Wi-Fi, switching, and other wireless technologies."

May
2021

TIP announces the launch of **OpenWiFi Release 1.0**. This disaggregated Wi-Fi system is community-developed and open source. At the same time, TIP kicks off lab and field trials of Wi-Fi connectivity solutions based on TIP OpenWiFi. The launch event sees many sponsors and dozens of participants including service providers, software OEMs and hardware ODMs. It's reported that 10+ service providers are trialing OpenWiFi, 5+ ODMs have shipped OpenWiFi-compatible whitebox access points, and 8+ Wi-Fi OEMs are using OpenWiFi to build commercial solutions.

Jun
2021

NetExperience announces general availability of its platform that can manage TIP OpenWiFi-compatible access points. The platform is available as licensed software or SaaS. The platform has been tested against access points from TP-Link, EdgeCore and CIG. NetExperience claims to be the "first full Wi-Fi management platform for OpenWiFi" to come to market.

TIP OpenWiFi