With a socket created, and a message sent, the next step in our networking journey is to receive data.
Continue readingCategory Archives: Networking
sendto system call from python
Once we open a socket, we probably want to send and receive data across it.Here is the system call we need to make in order to send data as I wrote about in my last post:
c = sendto(sd, buf, sizeof(buf), 0,
(struct sockaddr *)&addr, sizeof(addr));
Continue reading Updated MCTP send code
While the existing documentation is good, there are a couple things that have changed since it was originally written, and I had to make a couple minor adjustments to get it to work. Here’s the code to send a message. The receive part should work as originally published; what is important is the set of headers. I built and ran this on an AARCH64 platform running Fedora 38.
Continue readingERROR: Boot option loading failed
When PXE Booting an AARCH64 server, the above message probably means that you are fetching an x86_64 image for iPXE, not ARM64. Here’s how I debugged it.
Continue readingUnifying Audio with Pipewire
ALSA. Jack. PulseAudio. MIDI. Musescore. Jamulus.
My musical interactions with Linux are not the most complex in the world, but they ain’t trivial. The complexity of the Linux audio landscape has been a stumbling block so far. Pipewire has just gotten me past that.
The title of this article implies that you need to do something other than install Pipewire. So far, this is not true. On my system, at least, it Just works.
Continue readingAdding an IP address to a Bridge
OpenShift requires a load balancer for providing access to the hosted applications. Although I can run a three node cluster, I need a fourth location to provide a load balancer that can then provide access to the cluster.
For my home lab set up, this means I want to run one on my bastion host….but it is already running HTTP and (FreeIPA) Red Hat IdM. I don’t want to break that. So, I want to add a second IP address to the bastion host, and have all of the existing services make use of the existing IP address. Only the new HA Proxy instance will use the new IP address.
This would be trivial for a simple Ethernet port, but I am using a Bridge, which makes it a touch trickier, but not terribly so.
Continue readingDHCP Lease Design
The key piece of persisted data in an DHCP server is the lease. A lease is a the mapping between a MAC address and an IP address, limited in time. A Lease typically has a start time and an end time, but can be renewed. Because I am still living in an IPV4 world, I have to deal with arbitrarily small pools of IP addresses. Thus, the design needs to strike the balance between static and dynamic: a machine should generally get back the same IP address each time. However, if addresses get tight, address reuse should be aggressive.
Continue readingInterpreting DHCP packets
To capture DHCP packets I ran:
tcpdump port 67 -i vnet0 -vvvv -w /tmp/packets.bin
That gave me a binary file 940 bytes long. This is actually 2 packets: the request and the response. This has the IP header, the UDP header, and the DHCP packet payload in it.
Continue readinghexdump one byte decimal display
hexdump boot-packet.bin -e'"%07.8_ad " 8/1 "%03d " " " 8/1 "%03d " " |"' -e'16/1 "%_p" "|\n"' -v |
Extract Function Refactoring using inline functions.
The Extract Function refactoring is the starting point for much of my code clean up. Once a “Main” function gets sufficiently complicated, I pull pieces of it out into their own functions, often with an eye to making them methods of the involved classes.
While working with some rust code, I encountered an opportunity to execute this refactoring on some logging code. Here’s how I executed it.
Continue reading