Running ASP.NET core web application on Raspberry Pi

I always wanted to get more familiar with Raspberry Pi and Kubernetes. In December during my time off, I finally bought a Pi and experimented few things. One such experiment was to run ASP.NET core web application on Raspberry Pi. This was a fun experiment and I definitely learned more about Raspberry Pi, Kubernetes, ASP.NET core, Traefik, Docker and associated technologies. In this post, I would describe the steps that are required to run ASP.NET web app on Pi.

(more…)

Read More

Ethr 1.0 – A comprehensive network measurement and analysis tool

We run some of the most performance critical services in the cloud. These services offer 100s of Gbps bandwidth running via our software components. In the past, I have also built core networking virtualization that runs on every Azure machine. For building these network intensive services and components, it is critical to have tools for network measurements that can help optimize performance, isolate issues and prevent regressions. We use variety of tools to do various types of measurements and tune our software components.

In this post, I talk about an open source tool called Ethr, built as a side project, to provide many such capabilities in a single, easy to use binary. The tool is recently released as v1.0 and supports various types of network measurements such as throughput, packets/s, connections/s, network latency, ICMP & TCP ping, traceroute and MyTraceRoute. This makes it convenient to do various types of measurements without having to download and maintain a multitude of tools.

(more…)

Read More

Make a Website Responsive using CSS and HTML

I am going to talk about something different from the regular topics in this post. I recently moved one of my old websites to a different hosting provider. As part of that, I worked to make the website responsive. The whole process turned out to be much easier than I thought, and required just few changes. I thought to put them in a post, so it can help anyone else needing the same. Note: I have only tested this in Chrome and Edge on Windows and Android.

(more…)

Read More

Ceed Ceed A Tiny Compiler with ELF & PE Target

Introduction


I have always been interested in compilers but never got a chance to build one. I recently got some time and decided to learn compiler development. I started to look for an example compiler that meets following criteria:

  • Minimalistic – Quick walk-through and reading
  • Documented – Easier to understand
  • Complete – Produces executables without external tools
  • Uses Lex & Yacc – Many books available on building parsers

I didn’t find a good example that meets these requirements and can used as a starting point to bootstrap knowledge of compiler construction. I decided to develop a compiler, primarily for learning and later on, to create an example, that serves as a resource for others who are interested in learning compiler development.

Ceed (pronounced as seed) is an open source (BSD style license) compiler that compiles a high level language to x86 machine code and packages it in an executable binary. It supports 32-bit Linux and Windows and can generate output file in either ELF or PE format. Complete code for Ceed is around 1400 lines of Flex/Bison/C code excluding comments.

(more…)

Read More

Building Azure cloud service without Visual Studio

Introduction


I have mostly worked in systems technologies, building things like operating system, hypervisor, networking protocols and other virtualization related technologies. I love building system software due to simplicity of the overall software stack, programming languages (C and assembly) and tools to build this software. During my work on Windows Network Controller, I spent some time building WCF services in C#. I really liked coding in C# as it is a very well designed high level language and makes coding some of things much faster. However, at times I felt lost in the myriad of abstractions, frameworks and tools. Fortunately, for the service I was building, all the framework details were handled by a core framework team, and that allowed me to focus on writing the core business logic for my service without getting bogged down in all the other details. Even though I was able to build my service faster; I continued to feel lost at the magic, framework components performed; to do things like cross machine API invocation, associated security handling etc. (more…)

Read More

Life of Interrupts: Remapping

Introduction


In early versions of Hyper-V, we used to start HV after NT kernel in the host is already loaded. In this case APIC was already initialized by NT and serving interrupts to NT kernel. Before we started HV, we disabled interrupts, copied APIC state to the virtual APIC and then started the hypervisor. From this point onwards, HV became owner of the physical APIC and NT kernel in host OS managed only virtual APIC state. In this case, HV needed to provide identity mapping for the interrupts as NT had already programmed various devices to generate specific interrupts and HV had no way to reprogram those devices. So even though hypervisor would intercept the interrupt, it would simply deliver the interrupt to NT. For its own use, HV relied upon NT to reserve interrupt vectors or use NMIs. For example, we used NMIs for inter-processor synchronization. HV kept track of whether NMI was requested by it or not, and if a phantom NMI was received, it was delivered to NT kernel for processing. This ensured that if NMIs are delivered due to a fault or other critical event that doesn’t belong to HV, NT received the NMI and handled it correctly. (more…)

Read More

Life of Interrupts: Virtualization

Introduction


Interrupt handling is one of the critical subsystem in the hypervisor (HV). It is critical both from correctness and performance perspective. Hyper-V supports multi-processor systems and uses many optimizations to improve performance for interrupt virtualization.

Interrupt handling is done via APIC emulation. For each vCPU, a vAPIC is created in the hypervisor. These vAPIC behaves similar to APIC in a physical system and provide interrupt support to virtual machines. To support operating systems that are not APIC aware, PIC emulation is provided using virtual wire mode as specified in Intel multiprocessor specifications.

In this post, I would talk about how interrupts are virtualized in Hyper-V environment and discuss some of the performance optimizations. (more…)

Read More

Windows Network Controller Architecture

Overview


Windows network controller (WNC) is an SDN controller built for the next version of Windows Server. It is designed as a scalable and highly reliable distributed application to program physical and virtual elements of a datacenter, to provide autonomous datacenter network management. The north pole of WNC is to provide autonomous datacenter network management such that human intervention is needed only when there is a hardware failure. (more…)

Read More

SDN != OpenFlow

Lately there seems to be a lot of hype around software defined networking and in some of the articles OpenFlow is equated with SDN or vice versa. While OpenFlow has a role to play in SDN and it is what created the concept of SDN, I don’t think it is accurate to think of SDN == OpenFlow. This post is my attempt to describe OpenFlow, SDN and why SDN != OpenFlow. This is important for us engineers as we need to focus on the right problems and solve them using the right technology, instead of getting distracted by the hype that we see or hear in the press. (more…)

Read More

Life of Interrupts: Background

In this series of posts, I am going to talk about interrupt handling in a virtualized environment (specifically Hyper-V). This discussion would also include interrupt handling on systems that have IOMMU based interrupt remapping support. Interrupt remapping is required in Hyper-V for supporting SR-IOV enabled devices and device assignment to virtual machines.

The series is mostly written from software perspective and hardware details are only provided where necessary for understanding of the concepts. The series is focused on x86/x64 based architectures though the concepts described here can be applied to other architectures. (more…)

Read More