Posts

Clos Network

Image
Recently, I heard a term as cloud native.  So I started to research what it means to the network architecture.  It turned out in the LAN or data center, it means to build and run a scalable non-blocking switch fabric with cost effective merchant silicon switches. One key concept of building a non-blocking switch fabric is to build a Clos network with switches and inter-switch links. I heard about Clos network, but I never get the chance to look into it and to understand how it works.  In order to get that addressed, I spent sometime over the weekend to study the topic. What is a Clos network? According to Wikipedia , Clos network is a kind of multistage circuit-switching network which represents a theoretical idealization of practical, multistage switching systems. It was invented by Edson Erwin in 1938 and first formalized by Charles Clos in 1952. Without Clos network, the number of input lines (bars) and output lines (bars) simply limited the number of input and ou...

Linux Q&A Session Topics

什么是Linux? 严格来说Linux并不是一个独立的操作系统而只是一个操作系统的内核。它并不提供一个同用户直接进行交互的接口。我们通常所说的Linux都是Linux内核加上一些用户程序。大多数时候用户接触到的都是这些用户程序。 Linux的起源 说起Linux的起源,不得不提议下比Linux出现地更早的Unix炒作系统。1970年前后的时候,AT&T的贝尔实验室开发了最原始的那个Unix操作系统。它是一个强大的多用户、多任务操作系统,支持多种处理器架构的分时操作系统。 此后的10年,Unix在学术机构和大型企业中得到了广泛的应用,当时的UNIX拥有者AT&T公司以低廉甚至免费的许可将Unix源码授权给学术机构做研究或教学之用,许多机构在此源码基础上加以扩展和改进,形成了所谓的“Unix变种”。但是后来AT&T意识到了Unix的商业价值,不再将Unix源码授权给学术机构,并对之前的Unix及其变种声明了著作权权利。 鉴于这种情况,理查德·斯托曼于1983年发起了一项名为GNU的计划。该计划是开发一套完整的开放源代码操作系统来取代Unix,计划中的操作系统,名为GNU。 由于Unix的设计是模块化的,所以它可以被逐步分块的实现并取代。1984年,开始发展编辑器Emacs等软件。1985年,发表GNU宣言。1989年,发表GNU通用公共许可协议。GNU计划中的其他部分,如编辑器、编译器、shell等都已经完成,至此独缺一个开源的操作系统核心。 1991年,林纳斯·托瓦兹在赫尔辛基大学上学时,对操作系统很好奇。但是他又不满足于MINIX只允许在教育上使用很不满。所以着手开发另一个自己的操作系统。因为受到GNU GPL协议的鼓舞,他决定通过GPL协议将新开发的操作系统发布成为一个开源操作系统。任何人可以在GPL协议的框架下面使用、修改和发布软件和源代码。GPL协议规定源代码可以被其他项目所使用,只要这些项目使用同样的协议发布。一开始,这个操作系统内核的名字并不叫Linux,而是叫做Freax (意思是自由("free")和奇异("freak")的结合字,并且附上"X"这个常用的字母,以配合所谓的类Unix的系统)。但是FTP服务器管理员嫌原来的命名“Freax”的名称不好听,把内核的称呼改成...

Secure Home Network with OPNsense

Image
I was working on some smart home project as I bought a new home earlier this year.  With more and more devices connected to my home network then to Internet.  I do have some concerns regarding the security of those devices.  For two reasons: Quite of the smart home devices need to have Internet connection and being controlled by some SaaS platform Any devices in my home network can communicate with the smart home devices Smart home devices can freely talk to other devices in my home network In order to provide some protection to the home network and those smart home devices, I decided to bring some open source software firewall to segregate the traffic for different types of the devices. After doing some research, I decided to go with OPNsense firewall.  According to the article on Wikipedia,  OPNsense is an open source, FreeBSD-based firewall and routing software developed by Deciso. It is a fork of pfSense, which in turn was forked from m0n0wall built o...

A Network Access Issue Caused by DNS64

Background While I was troubleshooting a network access issue last night, I found an interesting issue caused by DNS64.  So I spent some time research what's the DNS64 feature is , why it's causing problem to me and how to fix it. The Issue During the troubleshooting, I noticed that some of the network connection between my computer and zhihu-web-analytics.zhihu.com failed.  More specifically, get timed out.  I suspected there might be some heavy packet loss along the network path, so I tried to use mtr to check if that's the case.                                     My traceroute  [v0.95] Bob-Desktop (2600:1700:5050:bcf:22d3:cd56:fda7:fe3a) -> zhihu-web-analyt2022-08-13T16:50:00-0700 Keys:  Help   Display mode   Restart statistics   Order of fields   quit                     ...

Environment Variables in Linux

Last week, one of my friend who's new to Linux asked me some quesitons about environment variables in Linux.  It was not too difficult for me to answer her questions, but it trigged me to think how does Linux handles environment variables.  Where does the system store the environment variables? According to the Wikipedia page , "in all Unix and Unix-like systems, as well as on Windows, each process has its own separate set of environment variables. By default, when a process is created, it inherits a duplicate run-time environment of its parent process, except for explicit changes made by the parent when it creates the child. At the API level, these changes must be done between running fork and exec." Hey, this gave us some hit that the handling of environment variables is related with function call fork and exec.  Thanks to the people who created the manual page for the exec function call, I noticed it mentioned some external variable named environ as part of the...

Fixing the Ubuntu 22.04 Boot Iussing on Dell VRTX

Image
Finding the Path to the Fix As we're able to reproduce the issue with a VM running inside the VMware ESXi environment, how can we fix the issue then? My initial thought was that since it's dropping me into the (initramfs) prompt, it might indicate either some configuration, or software program, or both were missing from the initrd.img file , which is a ram disk image that the Linux booting process uses before it can load more stuff from the root file system.  The missing piece caused my system to fail to find the root file system and has to stop with the initramfs loaded.  But what exactly was missing? So I tried to explore with the (initramfs) prompt. ( initramfs ) grep multi /proc/modules   multipath 20480 0 - Live 0xffffffffc0345000   ( initramfs ) multipath   sh: multipath: not found   It seems the kernel module for multipath had been loaded already.  But there was no multipath command available.  Could it be that the package with multipath so...

Reproducing the Multpath I/O Issue With Ubuntu 22.04

Image
Problem Statement In the previous two articles, I described the issue I was running into when installing Ubuntu 22.04 on a Dell VRTX server.  After some research, I suspect it's related to the incorrect configuration of the multipath I/O function. How to fixed it? Reproducing the Issue with VMware To reproduce and fix the multipath issue, I decided to set up a testing environment with a VM running inside VMware ESXi.  If we can create a VM with two virtual SCSI HBA cards, and connect the same virtual hard drive file to them.  The Linux VM should be able to see the same hard drive twice via two SCSI paths. Multipath I/O Config In VMware ESXi First Try With VMware ESXi, when adding a SCSI card to a VM, there is one option to configure if the SCSI bus is sharing.  The default configuration is None.  In order to share the same virtual hard drive to the VM twice via those two SCSI cards, I set them to "Physical".  Ideally, setting to "Virtual" should also work. ...