Hands-On Guide to Network Programming in C – Build Your Own Multi-User Chat Server

Hands-On Guide to Network Programming in C – Build Your Own Multi-User Chat Server

Learn how to use sockets, buffers, TCP, and the poll() multiplexing technique in C language to develop real network applications: enhance your network programming skills through practical projects and hands-on exercises. You Will Learn How to write a simple TCP client program that can connect to an actively running server Understanding how sockets, file descriptors, … Read more

Linux Networking: Let the Page Fly [Part 1]

Linux Networking: Let the Page Fly [Part 1]

While troubleshooting an issue related to a network device, I finally found the root cause. The phenomenon is that <span>dmesg</span> keeps printing the following log: page_pool_release_retry() stalled pool shutdown 1 inflight 2899 sec Root cause: The Kafka Go library IBM/sarama[1] has a TCP connection leak issue (Client SeekBroker Connection Leak[2]). TL;DR: The leaked TCP connections … Read more

Analysis of Intermittent 502 Bad Gateway Errors in Client HTTP Access

Analysis of Intermittent 502 Bad Gateway Errors in Client HTTP Access

Reading Tip: This article is approximately 4094 words, reading time is 5 minutes 1. Fault Phenomenon When the client accesses the target website, it can normally access the external network and return a 200 status code during the initial connection establishment phase. However, subsequent client requests continuously encounter errors, receiving a 502 Bad Gateway error … Read more

Introduction to MQTT

Introduction to MQTT

Technical experience sharing, welcome to follow and provide guidance. This article introduces MQTT based on the Internet of Things. What is MQTT? MQTT: Message Queuing Telemetry Transport, a lightweight messaging protocol. It is particularly useful for establishing connections in remote locations where small code footprint and/or network bandwidth are precious. MQTT is a distributed soft … Read more

Why Do We Need HTTP When We Have TCP? Understanding RPC Clearly This Time

Why Do We Need HTTP When We Have TCP? Understanding RPC Clearly This Time

I remember when I first started working and encountered the concept of RPC; I was filled with confusion—if HTTP works just fine, why create RPC? It wasn’t until I participated in several microservices projects that I truly understood the value of each. Today, let’s clarify the relationships between these protocols. Starting from Network Basics: The … Read more

Modbus RTU vs Modbus TCP: The 3 Key Differences That 90% of Engineers Encounter!

Modbus RTU vs Modbus TCP: The 3 Key Differences That 90% of Engineers Encounter!

1. Essential Difference: Not “Old vs New”, but “Physical Layer vs Network Layer” Reconstruction Many people think: “RTU is serial port, TCP is network port – TCP is more advanced.” —— Wrong! They have the same application layer (function codes, register addresses, message structure), the difference is only in “how to transmit”: Physical Medium RS485/RS232 … Read more

The Life of a Network Packet in Linux

The Life of a Network Packet in Linux

A practical guide from <span>write()</span> to <span>recv()</span>. You ran <span>curl http://example.com</span>, and now you see some HTML in the terminal, but what actually happened? Linux takes your bytes through a series of defined steps: selecting a path, finding the neighbor’s MAC address, queuing the packet for the network interface card (NIC) to send, and then … Read more

Python IPC 1: TCP-Based Socket Communication Example

Application Scenario Inter-process communication across networks, with connection and reliable transmission. TCP-Based Socket Communication Process TCP Server TCP Client 1、socket() 1、socket() 2、bind() 3、listen() 4、accept() <———————– 2、connect() 5、recv() <———————— 3、send() 6、send() ————————-> 4、recv() 7、close() 5、close() Description: socket(): Create a socket. bind(): The server binds the IP and port,called only by the server. listen(): The server starts … Read more

Why Ask About TCP/IP/HTTP Protocols in Interviews?

What else can we ask if we don’t ask about these protocols? Should we ask about OSPF or BGP? Those are protocols used by network engineers. Should we ask about Kerberos or CIFS/SMB? Those are protocols used by Windows system administrators. Should we ask about Access Tokens, SSO, CSRF, or SQL Injection? Those are concepts … Read more

TCP Has Been Abandoned by HTTP/3!

TCP Has Been Abandoned by HTTP/3!

Source: Xiaolin Coding Author: Xiaolin Coding From HTTP/1.1 to HTTP/2, the HTTP protocol has always used TCP as its transport protocol. However, in the latest HTTP/3, TCP has been completely abandoned, reaching out to the isolated and helpless UDP, and based on the UDP protocol, a reliable transport protocol has been implemented at the application … Read more