Use ebpf to monitor NAT conversion in the linux kernel

1. Introduction Linux NAT (Network Address Translation) translation is a network technology used to convert IP addresses within one or more private networks into a public IP address for communication with the Internet. In k8s business scenarios, the relationship between business components is very complex. Since the Kubernetes network model assumes that Pods use the […]

centos7.9 upgrades kernel 3.10 to 5.4

When we build a K8S environment, the kernel version should be greater than 4.4. Check the kernel version first: uname -r [root@k8s-master ~]# uname -r 3.10.0-1160.el7.x86_64 Displayed as 3.10, check the kernel package: rpm -qa |grep kernel [root@k8s-master ~]# rpm -qa |grep kernel kernel-devel-3.10.0-1160.el7.x86_64 kernel-tools-libs-3.10.0-1160.el7.x86_64 abrt-addon-kerneloops-2.1.11-60.el7.centos.x86_64 kernel-headers-3.10.0-1160.el7.x86_64 kernel-3.10.0-1160.el7.x86_64 kernel-tools-3.10.0-1160.el7.x86_64 Add Alibaba source: cat

x64 kernel experiment 5-API enters ring 0

x64 Kernel Experiment 5-API Enters Ring 0 Today we will start analyzing the process of the system API entering the 0 ring Process analysis of the 3-ring part of the system call First write an application and then we call a system api of readprocessmemory #include <Windows.h> #include <stdio.h> DWORD32 testVal = 111; int main() […]

2023-2024-1 20232808 “Linux Kernel Principles and Analysis” Third Week Assignment

1. Experiment preparation The experimental code is as follows: # Note that paths are size-sensitive $ cd ~/LinuxKernel/linux-3.9.4 $ rm -rf mykernel $ patch -p1 < ../mykernel_for_linux3.9.4sc.patch $ make allnoconfig # Please wait patiently while compiling the kernel. $make $ qemu -kernel arch/x86/boot/bzImage This code is used to compile and run a custom Linux kernel. […]

Research on the 3-page mechanism of x64 kernel experiment (1)

Research on 3-page mechanism of x64 kernel experiment (1) CR4 register There is a detailed introduction to the control register in Chapter 2.5 of the third volume of the white paper. The following is the structure diagram of the CR register in the white paper (here it is necessary to explain that the 12th bit […]

x64 Kernel Experiment 2-Segment Mechanism Changes

Changes in the x64 kernel experiment 2-segment mechanism Introduction to ia-32e mode The segment descriptor structure diagram under x86 is as follows In the x86 environment, the segment descriptor is mainly divided into three parts: base, limit, and attribute. In the 64-bit environment, the segment descriptor has fewer and fewer restrictions. This is mainly reflected […]

20233808 “Linux Kernel Principles and Analysis” Third Week Assignment

1. Dialogue with chatgpt https://chat.openai.com/share/7b05ea26-3948-4139-ac91-213b1ffc0730 2. Experiment completion status 1. Original kernel Compile and customize a kernel using the content provided by the laboratory building # Note that paths are size-sensitive $ cd ~/LinuxKernel/linux-3.9.4 $ rm -rf mykernel $ patch -p1 < ../mykernel_for_linux3.9.4sc.patch #This command applies a patch named mykernel_for_linux3.9.4sc.patch to the Linux kernel source […]

2023-2024-1 20232803 “Linux Kernel Principles and Analysis” Third Week Assignment

Directory Experiment 2-Complete a simple time slice rotation multiprogramming kernel code 1. Experimental environment preparation 2. Modify the time slice rotation multiprogramming kernel code 2.1 Create mypcb.h file 2.2 Modify the mymain.c file 2.3 Modify the myinterrupt.c file 3. Run time slice rotation multiprogramming kernel code 4. Experiment summary Attachment: Using AI tools to assist […]