Tag: #networking
How do I write a UDP server in Go?
2016-11-17
What syscalls does a TCP server need?
A minimal TCP server in C uses the
socket
, bind
, listen
, accept
, recv
, send
, and close
syscalls to manage connections. 2016-12-14How to write a TCP server with the
kqueue
API Kqueue is a more efficient alternative to
select
for managing multiple TCP connections, providing a publish-subscribe model for tracking events in the kernel. 2016-12-18What syscalls does a UDP server need?
The syscalls needed for a simple UDP echo server are
socket
, bind
, recvfrom
, sendto
, and close
. 2016-12-19What is
htons
in C? htons
and htonl
convert values between host and network byte order, where network order is big-endian. ntohl
and ntohs
are the inverse functions. 2016-12-21What are ‘protocol numbers’ in IP?
2016-12-23
What do DNS datagrams look like?
2016-12-31
How fast does an IP packet travel?
2017-01-01
What is STUN?
2017-01-15
How to write a ‘hello world’ serverless WebRTC app
Including setting up the
RTCPeerConnection
, creating a data channel, handling ICE candidates, and generating an offer to be shared with the remote peer. The signaling channel is copy-paste! 2017-01-16How does reliability work in
RTCDataChannel
? The
RTCDataChannel
API lets us configure the delivery guarantees, including the ordered
, maxPacketLifeTime
, and maxRetransmits
properties. 2017-01-17FOSDEM: The Challenges and Secrets of the Realtime World
Realtime apps use protocols like HTTP streaming, long polling, WebSocket to enable live updates. Scaling pub/sub requires distributed servers and routing clients to the closest server. 2017-02-04
How does GeoDNS work?
GeoDNS uses geo-IP to locate clients and connect them to the nearest server, reducing latency. 2017-02-08
What is
lsof
? 2017-02-20
How to write a TCP server using the
fork
syscall 2017-02-25
What are the
domain
and type
arguments to the socket
system call? The
domain
and type
arguments to socket()
describe the protocol family and socket type, respectively. The protocol
argument specifies the actual protocol to use, which may be inferred from the domain
and type
. 2017-02-27How to write a TCP server with the
pthread
API A TCP server that uses
pthread
to serve multiple clients concurrently, with an “echo” server for each connection. 2017-02-28Monthly review: 2017-02
2017-03-01
Redis Pub/Sub under the hood
2017-03-01
How can I do DNS lookup in Go?
2017-08-03
DNS resolution procedure
DNS resolution is a recursive procedure involving different record types like A, CNAME, and NS. Resolving a domain name can require multiple DNS queries to different nameservers. 2017-11-25
What is DHCP?
DHCP dynamically assigns IP addresses to hosts, using a client-server protocol over UDP. It involves a sequence of DORA (Discover, Offer, Request, Acknowledge) messages to obtain and configure a network lease. 2018-02-06
How does
ping
work? 2018-02-07
How does reverse DNS lookup work?
2018-02-09
What is a subnet?
Subnets divide the IP address space hierarchically using bitstring prefixes. We check if an IP address is in a subnet using C. 2018-02-10
How does an IP address get translated to a MAC address?
IP addresses are mapped to MAC addresses using the Address Resolution Protocol (ARP). The OS maintains an ARP cache to store these mappings. 2018-02-11
Running
tcpdump
on a TCP connection tcpdump
captures network traffic. Capture and analysis of a TCP connection, including the 3-way handshake and message exchange. 2018-02-23What are TCP sequence numbers?
TCP uses sequence numbers to map unordered IP packets to an ordered byte stream. The sequence number field is 32 bits, but wraps around to 0 after reaching the max value. The sender chooses a random “initial sequence number” during the connection handshake. 2018-02-24
What does Linux do with a lost TCP connection?
Linux uses exponential backoff to retry dropped TCP connections, with a configurable retry limit. 2018-02-27
How does network address translation work?
NAT allows multiple devices in a local network to share a single public IP address. Routers modify IP and port information in network packets, and manage a translation table. 2018-03-02
Creating a UDP connection with netcat
2018-03-04
What is HTTP keep-alive? What is HTTP request pipelining?
2018-03-27
How to make a webserver with netcat (nc)
Use
nc
(netcat) to create a web server that returns custom HTTP responses. 2018-12-31How to run Redis Sentinel
Redis Sentinel provides high availability for Redis. We start a Redis master, then three Redis Sentinel instances. They discover each other, then we trigger a failover. 2019-01-08
All content copyright James Fisher.