modus
Menu
On this page

The network: TCP as a library in the process

The first layer of the network is the base: the frame service, the network service, endpoints of datagrams. Glossary defines the terms.

The idea in plain words. No process opens a connection because it runs. The root service gives a process a grant that names what it can reach: one remote (a client grant) or one port on which it answers whoever comes (a listen grant). The network service checks each datagram and segment against that grant; the protocol itself, TCP or QUIC, is a library inside the process, so a fault in it harms only that process.

For whom. A reader who writes a process that uses the network, and a reader who changes the network service or the TCP library.

Read before. Kernel properties: Kernel off the data path and "20. No ambient access: the other holes to close" (line 3). Architecture: Network steering service. After this guide, QUIC.

The map of this guide. "The principles" and "The parts" give the model and the processes. "The path of a datagram and of a segment" says which process touches the bytes, hop by hop, and who checks what. "The segment endpoint" is the grant of TCP and its checks. "The TCP library" is the protocol in the process. "The tests" and "The HTTP server" show it at work. "The listen grant of UDP" and "QUIC: what it reuses, and what it needs" lead to QUIC.

TCP in the process: server serves one table of connections from one thread, while the peer of the test drops, reorders and repeats frames

The principles

The kernel carries no network data and holds no network protocol. A process that talks over the network runs the protocol itself, as a library, and one service of user space only checks each datagram or segment against the grant of the process. Three rules follow:

  • The network stack is a library in the process that uses the network (property 5). A fault in TCP or QUIC harms only the process that runs it.
  • The network service is on the control path of each datagram and each segment: it reads the headers and checks them against the grant. It is on the data path for one copy of what arrives, and for nothing else: on send, the device reads the data from the memory of the process, the service copies only 8 bytes of the header for its check, and it computes no checksum of the bytes and writes no header of UDP or TCP. The reason is the device of the first machine, which has one pair of queues (section "The path of a datagram and of a segment").
  • The network has UDP, TCP and QUIC, and a server as a scenario: server speaks HTTP over TCP, and quic_echo and remote speak QUIC over UDP.

The parts

Each part of the network is a process or a library of user space. The table names each one, where its code is, and what it does.

PartWhereWhat it does
TCP librarysrc/library/modus/tcpThe state machine, the windows, the timers, the reassembly, the congestion control. Pure code over memory of the caller: no kernel operation, no allocation. The modus tool uses the same package on the host
Network servicesrc/modules/system/networkGives each process with the grant one endpoint. It checks the header of each datagram and each segment against the grant, writes and checks the IPv4 header, and copies a datagram or a segment that arrives one time. On send it copies 8 bytes of the header, and the device reads the rest from the datagram region. It computes no checksum of UDP or TCP and keeps no state of a connection
Protocol librarysrc/library/modus/networkFor the network service: Ethernet, ARP, IPv4, ICMP echo, and the checks of the header of UDP and TCP (parse). For a process with a datagram endpoint: the UDP header and its checksum (udp_header_write, udp_data_read)
Serversrc/modules/demonstrations/serverA process with a listen grant on the TCP port 80. One thread serves all its connections from one connection table. It speaks a small HTTP/1.1
Clientsrc/modules/demonstrations/fetchA process with a segment grant of one remote. It fetches pages and measures
Module file servicesrc/modules/system/module_filesA client with the same grant: it fetches a module file and stores it in the store module_files of its principal (Module contract: A module from a disk)
QUIC serversrc/modules/demonstrations/quic_echoA process with a listen grant of UDP on the port 4433: QUIC in the process (QUIC: QUIC on the network (the fourth layer, built, with Retry and the budgets of work))
Remote servicesrc/modules/system/remoteThe calls of the host: a QUIC server with a listen grant of UDP on the port 7100 that admits the address of the host (10.0.2.2) only. Each call is one QUIC stream (QUIC: remote over QUIC (built))
Peertools/modustool/machine/peer.odinThe gateway of the test machine. It is also a TCP client that the tool drives, with loss, reorder and duplicates that the tool chooses, and the QUIC client of the remote service

The kernel has no network code.

The network service has one static address, 10.0.2.15/24, and the gateway 10.0.2.2 (the network of QEMU). It has one thread, which waits on the frame ring, on the control ring of the root service and on the command queue of each endpoint. Its first line is "network: ok, the address 10.0.2.15/24 ..., the gateway 10.0.2.2, the link is up, ...", then one line for each endpoint, such as "network: an endpoint for server: TCP, the listen port 80, the remotes that send to it". Each line of an endpoint is a log fact of network_service with the process that owns the endpoint as the field owner: Endpoint_Listens_Tcp and the other forms of a grant, Endpoint_Grant_Changed_To_None, Endpoint_Ended with the datagrams sent and received. So log.records(0) |> facts(network_service.Endpoint_Ended) |> where(owner = "server") gives the end of each endpoint of server (Developer tools: The log). A frame that it refuses becomes a problem row (datagram.Problem_Row) of its endpoint, or of the machine, with the layer, the field and the rule.

It keeps the hardware address of each neighbor in a table of 16 (ARP_CAPACITY of src/library/modus/network). The table learns only an address that a request of the service asked, so an ARP frame that nobody asked for changes nothing, also not the entry of the gateway.

The network service holds the frame service with the right Read. When the frame service stops, and when it does not answer a command of the start in 60 s, the network service writes "network: the frame service stopped: the network device moves no frame, and this service stops" (or the command that had no answer) and stops. The root service then writes "root: the network service stopped: no process with an endpoint of the network starts until the machine starts again; the other processes start", or "did not start" when the frame service cannot start, as on a machine with no network device. Each later process with the grant Network is refused, with no new start of the two services (A missing or silent part of the machine in the repository). The refusal follows any stop of the network service, also a fault of the network service itself, and lasts until the next start of the machine. A start that fails for a full table, a short budget or short memory is not refused for ever: only an absent network device is.

The path of a datagram and of a segment

A datagram or a segment passes through several processes between the device and the process that uses it. This section names each hop, the bytes that the hop reads or writes, and the party that checks each field. Two terms sort the hops (Glossary): the data path is the code that reads or writes the bytes of the data; the control path of a packet is the code that reads the headers and decides where the bytes go.

The payload of a frame is what follows the IPv4 header: a whole datagram with its UDP header, or a whole segment with its TCP header. UDP and TCP take the same path through the network service: the process writes and reads the whole payload, and the network service treats the two alike.

A datagram or a segment that arrives

HopWhat runsBytes of the payload that it touches
The deviceIt writes the frame into a receive place of the frame regionWritten one time by the device
The frame serviceIt reads the used ring and gives the length of the frame to the network serviceNone: it reads no frame
The network servicenetwork.parse checks the headers of Ethernet and IPv4 (with the IPv4 checksum, 20 bytes), then the lengths of the header of UDP or TCPThe header only: the two ports, the length field of UDP, the data offset and the flags of TCP
The network serviceIt finds the endpoint by the local port, checks the remote against the grant, and admits a remote of a listen grantNone
The network servicedeliver copies the payload into the place that the process gaveOne pass: the copy
The processTCP: tcp.step checks the TCP checksum, then reads the header and copies the data into the receive buffer of the connection. UDP: network.udp_data_read checks the UDP checksum, when the process asks for itThe passes of the process itself

A datagram or a segment that leaves

HopWhat runsBytes of the payload that it touches
The processIt writes the payload in a place of its datagram region: the header of UDP or TCP, the data, and the checksum over both (tcp.header_write, network.udp_header_write)The passes of the process itself
The network serviceIt copies the first 8 bytes of the payload from the region to a send place of the frame regionThe header only: 8 bytes
The network serviceheader_granted reads the two ports, and the length field of UDP, in its own copy, and checks them against the endpoint and the grantThe header only, in the copy
The network servicenetwork.ipv4_frame writes the headers of IPv4 and Ethernet before the copyNone
The frame serviceIt gives the device a chain of three parts: the virtio header, the headers in the frame region, the rest of the payload in the datagram region, which it holds as a read regionNone
The deviceIt reads the frame region and the datagram regionRead one time by the device
The frame serviceWhen the device used the frame, it completes the frame; the network service then completes the Send of the process, which can write its place againNone

The passes of the network service

A pass is one read or one write of each byte of a payload by one process. The table gives the passes of the network service for each byte, in this form and in the form with the checksums of the transport in the network service.

DirectionProtocolWith the checksums in the network serviceThis form
ArrivesTCP2: the TCP checksum, then the copy1: the copy
ArrivesUDP2: the UDP checksum, then the copy1: the copy
LeavesTCP1: the copy0 over the data: a copy of 8 bytes of the header
LeavesUDP2: the copy, then the UDP checksum0 over the data: a copy of the 8 bytes of the header

The network service counts its passes. For each endpoint and each direction it counts the datagrams or the segments, their bytes, the bytes of each pass, and the bytes of the data among them (data_pass in src/modules/system/network, called at each place that reads the bytes). When an endpoint ends, the log has two lines: a measure, "network: a measure: the endpoint of server, TCP: the passes of this service over the data for each payload byte: 1.00 on receive (...), a fraction on send (...); the bytes of the data that this service read on send: 0", and the structural fact, "network: the endpoint of server, TCP: this service read each payload byte one time on receive, for the copy, and on send only the 8 bytes of each header that it checks, and 0 bytes of the data; it computed no checksum: as it must". The machine tests of net, server and quic_echo, and the test iommu for net, wait for the second line. It is a count of passes, not a speed.

The one copy on receive cannot leave with this device. The device chooses the place of a frame before any process knows whose frame it is, so one process that is not the receiver must read the headers, and the bytes must then move to the receiver. A device that gives each endpoint its own receive queue, and steers frames by the destination port, removes the copy on receive too; the device of the test machine has no such queues.

The send with no copy

The device reads the data of a datagram or a segment where the process wrote it. The rules:

  • When the remapping unit of the network device gives device windows (Device_Create of its registers says so: ), the datagram region of each endpoint is not contiguous: the kernel gives it a device window where its pages follow each other, so the start of a process does not need 512 KiB of contiguous memory. Else (no IOMMU, a device that no unit covers, a unit of fewer than 39 bits of address), the root service makes the region contiguous: the device needs one address for it. The network service gives the region to the frame service with the right Read only, as a read region at the place of the endpoint (Read_Region_Add of the frame contract). The frame service refuses a read region with the right Write.
  • On a machine with the IOMMU, the frame service declares the read region with Memory_Physical through a handle with Read only: the network device reads the region and cannot write it.
  • The Send of a process completes when the device read the frame, not before. A process writes a place again only after the completion of its Send. A process that writes it before changes what goes on the wire, and harms only its own packet.
  • The process writes the checksum, as before. The device computes none.
  • When an endpoint ends, the frame service keeps its handle of the region until the last frame that reads it is complete, then closes it. The memory of the region stays while the device reads it, whatever the process and the network service close.

The design: The network service and the data path: The send with no copy in the repository.

Who checks what

FieldWho checks itWhere
The headers of Ethernet and IPv4 of a frame that arrives, with the IPv4 checksumThe network servicenetwork.parse
The lengths of the header of UDP or TCP of a payload that arrivesThe network servicenetwork.parse
The local port and the remote of a payload that arrives, against the endpoints and their grantsThe network servicearrived in src/modules/system/network
The checksum of a segment that arrivesThe processtcp.step: a wrong one adds to Table.bad_checksums, changes no connection and gets no answer
The checksum of a datagram that arrivesThe processnetwork.udp_data_read with the rule Verify. A QUIC process gives the rule Do_Not_Verify: QUIC authenticates each packet, so the checksum adds nothing (QUIC: The form of the library)
The source port of a payload that leaves: a local port of the endpointThe network service, in its copyheader_granted
The remote of a payload that leaves: the address of the command and the destination port of the header, against the grant or the admitted remotesThe network service, in its copyheader_granted
The length field of a datagram that leavesThe network service, in its copyheader_granted
The source address of a payload that leavesNobody: the network service writes itnetwork.ipv4_frame
The checksum of a payload that leavesNobody on this machine: the remote does—

Three rules follow from the table.

  • A process cannot send as another process. The network service writes the source address. It reads the source port in its own copy of the first 8 bytes of the header, after the copy, and never reads the region of the process a second time: the process cannot change what was checked. The device reads the rest from the region, and the process can change it until the device read it. A process controls the data and the checksum of its own datagrams and segments, and nothing else.
  • A wrong checksum harms its writer only. A process that sends a wrong checksum loses its own datagram or segment: the remote drops it. A process that does not check the checksum of what it receives takes damaged bytes as data: the harm stays in that process. The TCP library always checks. A process with a datagram endpoint chooses the rule in its call of network.udp_data_read.
  • The checksum comes after the choice of the endpoint. The network service chooses the endpoint by a port that it did not check with the checksum. A frame whose port the wire damaged, and that the check of Ethernet let pass, can reach the endpoint of another port. The process of that endpoint then refuses it by its checksum, after it saw the bytes. The grant, not the checksum, is the guard against a hostile sender: a hostile sender writes a correct checksum.

net shows the two sides in the machine test: the peer sends one datagram with a wrong UDP checksum to the port of net ("net: UDP from 10.0.2.2 port 7 with a wrong checksum: dropped by this process: 1 datagram; ..."), and net writes one datagram with another source port, which the network service refuses ("net: UDP from the source port 1234: refused: ..."). net also writes a datagram whose length field says one byte more than its Send gives ("net: UDP with a wrong length field: refused: ...") and sends 7 bytes, fewer than a UDP header ("net: UDP of 7 bytes: refused: ..."): the network service refuses both. On receive, network.udp_data_read refuses a datagram under 8 bytes and a datagram whose length field is not its count, with each rule.

The segment endpoint

A process reaches the network through an endpoint: a ring of commands and a region of memory that it shares with the network service. A segment endpoint is the form for TCP: the process writes whole TCP segments, and the network service checks them and sends them. The grant of the endpoint says which remotes the process can reach.

A segment endpoint is an endpoint (src/library/modus/contract/datagram) whose grant has the protocol TCP. The ring, the region, the commands and the error records are the ones of a datagram endpoint. Two things differ:

  1. 1. A Send names a whole segment in the region: the TCP header, its options and its data, where a datagram endpoint names a whole datagram: the UDP header and its data. In both, the process writes the header and its checksum, and a Receive gives the whole segment or datagram.
  2. 2. The grant names TCP ports, not UDP ports, and a client grant has a block of local ports.

With the right Inspect of its grant, a process also reads the facts of the machine: the counts and the problem rows of the frames that no endpoint owns, and the kernel entries of the network service and of the frame service. Without it, those values are 0: they tell of the traffic of other processes.

The library writes the segments directly in the places of the datagram region. A segment that arrives is copied one time on its path: by the network service, from the frame to the region. A segment that leaves is not copied: the device reads it from the region, after the headers that the network service wrote.

The grant of a segment endpoint

The root service names the grant by the name of the process, as for UDP (endpoint_of). The principal reads it with grants and revokes it with revoke. The grant is one record, datagram.Grant: a remote address, a port, and the flags tcp, listen and inspect. So an endpoint has one of four forms, two for TCP and two for UDP:

FormLocal portsRemotesUse
TCP client grantA block of 64 TCP ports (datagram.PORT_BLOCK) that the network service choosesOne remote address and one remote TCP portA process that connects to one server: fetch, and the module file service module_files
TCP listen grantOne TCP port that the root service namesEach remote that sent a SYN to that portA server: server, on the port 80
UDP client grantOne UDP port that the network service gives (Info); the process writes it as the source port of each datagramOne remote address and one remote UDP portA process that talks to one remote over datagrams
UDP listen grantOne UDP port that the root service namesEach remote that sent a first datagram of 1200 bytes at least, and with a named address, that address onlyA QUIC server: quic_echo on the port 4433, remote on the port 7100 (section "The listen grant of UDP")

The grant crosses the control ring and the completion of Info as one word (datagram.grant_pack): the port in bits 0 to 15, the address in bits 16 to 47, and the flags inspect, tcp and listen in bits 48, 49 and 50. datagram.grant_unpack is the one border of that word. It refuses a word with a bit from 51 to 63: it gives no grant and false. The network service then refuses Endpoint_Add and Endpoint_Grant with Bad_Command and the record Bad_Value of the grant argument, whose value is the unknown bits shifted down by datagram.GRANT_KNOWN_BIT_COUNT. It maps no region, opens no ring, and makes or changes no endpoint (network.endpoint_add_grant, network.endpoint_grant_change). A process whose Info gives such a word stops at its start, or, for the test modules net and fetch, fails its first case. The design: The grant word of an endpoint in the repository.

The form and the local ports of an endpoint come from its creation, and stay until the endpoint is removed. A revocation sets the grant to none and keeps them:

  • A listen port has one holder. The port of an endpoint whose grant was revoked is still taken: no second endpoint gets it (network.listen_port_taken, one rule for UDP and TCP).
  • A new grant on an endpoint must have the form of its creation: the same protocol, listen or client, and for a listen grant the same port. An endpoint that was made for a listen port never gets a client grant, which would send from that port.
  • A Send that waits for a hardware address (the answer of ARP) was checked against the grant of its time. A change of the grant ends each such Send of the endpoint with the refusal Not_Granted: no frame leaves after a revocation.

A client grant of TCP has 64 local ports, because a closed connection stays in TIME-WAIT (below) and one local port serves one connection at a time to one remote. The process chooses a port of its block for each connection. The network service writes the block on the log, as "network: an endpoint for fetch: TCP, the local ports <first> to <last>, the grant 10.0.2.100 port 80".

A listen grant is narrow in another way: the process answers, but it does not reach. The network service keeps one table of admitted remotes for each listen grant: an address and a TCP port that sent a SYN (no ACK, no RST) to the listen port, when a Receive of the endpoint waited for it, from an address that can answer (not 0, a broadcast or multicast address, or the local address). A segment of a remote that is not admitted does not reach the process. A segment to send goes out only to an admitted remote. So a process with a listen grant cannot open a connection to a machine that did not come to it, and cannot send a segment to it. The table has 64 places, each with the time of its last segment in or out. The process releases a remote (command Release) when its connection ended, after its last segment. When the table is full, the oldest place with no segment for more than 120 s serves again (twice the longest gap between two probes of a zero window in src/library/modus/tcp, so that a live remote keeps its place); with none, a SYN from a new remote is dropped and counted in the problems of the endpoint (kind Full). A process that forgets a Release loses only places with no traffic.

This table is the one state of TCP in the network service: addresses and ports, with no sequence number and no window. It is the port table of the network service, with the remotes of a server.

What the network service does for each segment

DirectionWorkWhy
ArrivesChecks the Ethernet and IPv4 headers, and the length and the data offset of the TCP header (network.parse). It does not check the TCP checksumThe service reads the ports to choose the endpoint; it reads no byte of the data. A segment with a wrong checksum reaches the endpoint of its port, and the TCP library drops it
ArrivesFinds the endpoint by the local port, checks the remote against the grant, admits a remote of a listen grantProperty 20, line 3
ArrivesCopies the segment from the frame to the regionThe device writes the frame region of the service, not the region of the process
SentCopies the first 8 bytes of the segment from the region to the frame, then reads its ports from the copy. The device reads the rest from the regionA port is checked in bytes that the process cannot change after the check, and the service reads no byte of the data
SentChecks the local port against the block or the listen port, and the remote against the grant or the table of admitted remotesProperty 20, lines 3 and 11
SentWrites the IPv4 and Ethernet headersIt must check them anyway
SentDoes not check the TCP checksumA wrong checksum harms only the process that wrote it: the remote drops the segment

The work for a datagram is the same, with the UDP header in the place of the TCP header (section "The path of a datagram and of a segment").

The library computes the TCP checksum of each segment that it sends, and checks the checksum of each segment that arrives, in tcp.step, before any other read of the segment. The checksum covers the pseudo-header: the remote address that the network service gives with the segment, and the local address of the table. A segment with a wrong checksum adds one to Table.bad_checksums; it changes no connection and gets no answer, because its ports and its sequence numbers are not to be trusted. A SYN with a wrong checksum takes a place of the admitted remotes until the process releases it: server releases the remote of each segment that has no connection.

A process decides nothing from the bytes of a segment that the library dropped, with one exception that is safe for any bytes: the release of a remote that no connection has. tcp.connection_of_segment answers "does a connection have the remote of this segment" from the remote address and the two ports at their fixed place, bytes 0 to 3, and reads nothing else. server releases the remote of a segment only when the answer is no. So a segment from the remote of a live connection, damaged by the wire or with a malformed option, makes the network service forget nothing: the connection goes on. A release for a segment of no connection frees at most a place that a SYN took; it harms no connection, whatever the segment holds.

Property 5 as it is built

Property 5 says that the kernel is off the data path, and that the network stack is a library in the process. Its cost line names what one device with one pair of queues needs: a multiplexer in user space. The network service is that multiplexer. This section says what it does, and what it does not do.

  • The kernel carries no data and has no network code. No kernel entry carries a datagram or a segment: an entry is a wait or a wake, and one entry serves a batch.
  • The transport is in the process: the whole of TCP (src/library/modus/tcp), the whole of QUIC (src/library/modus/quic), and the header and the checksum of UDP (src/library/modus/network, udp_header_write and udp_data_read). The process can read and change each field of its connections.
  • The network service is on the control path of each datagram and each segment, in both directions: it reads the headers and checks them against the grant.
  • The network service is on the data path for one copy of what arrives. On send, it copies 8 bytes of the header for its check, and the device reads the data from the datagram region of the process. It computes no checksum of the data and writes no header of the transport.
  • IPv4, ARP and ICMP echo stay in the network service: they are the shared identity of the machine.
  • The network service keeps only the ports and, for a listen grant, the remotes that came to it: no sequence number, no window and no key.

One change takes the network service further off the data path. It needs a device with a receive queue for each endpoint and an exact filter by destination port that only the frame service programs; then the copy on receive leaves too. It is not built.

The TCP library

src/library/modus/tcp is the whole protocol of TCP as pure code: it reads segments and the time from memory of the caller, and writes segments and events back. It makes no kernel operation, so the same package runs in a process of the system and in the tool on the host. A process calls it in a loop: wait on the rings, call tcp.step, send what it wrote, read the events.

The form of the interface

The interface follows the rule of the system on data-oriented interfaces: many records in one call, in memory of the caller, never a list of pointers.

  • A connection is one record of fixed size (tcp.Connection, 424 bytes). The caller gives the table of records and one block of memory for the buffers (property 14): each connection has a send buffer and a receive buffer at a place that its index gives. The library allocates nothing.
  • One call does the work of a batch: tcp.step takes all the segments that arrived, the time, a table of places for the segments to send, and a table of events. It reads all the segments, runs the timers, and writes all the segments to send.
  • An event is a record of fixed size: the index of a connection and a set of kinds (Opened, Accepted, Readable, Writable, Peer_Closed, Closed, Reset, Timed_Out, Refused). One record for each connection that has news, so a table with one place for each connection is enough.
  • tcp.step gives the deadline of the next timer. The process waits on its rings with that deadline. No call blocks and no call has a callback.
  • A call that fails gives an error record (, Module contract: Errors that diagnose): a full table, a local port out of the block, a write on a connection that is not open.
  • connect, write, read, close and abort change the record of one connection. The segments that follow come at the next step.

The table also counts the records in TIME-WAIT that a SYN took when no record was free (reclaimed). The process owns each field. It reads the state, the windows, the round trip estimate and the counts of each connection in its own memory, with no call; server draws them.

What the library does

SubjectRuleSource
OpenActive and passive open; a simultaneous openRFC 9293 3.5
Sequence numbersModulo 2^32: a is before b when i32(a - b) < 0RFC 9293 3.4
Initial sequence numberM + F(addresses, ports, secret): M counts 4 microseconds, F is the first 4 bytes of BLAKE3 of the secret and the four valuesRFC 6528
MSS optionSent with each SYN (1460); a SYN with no option gives 536RFC 9293 3.7.1
Receive windowThe free room of the receive buffer, 65 535 at most. The right edge never moves left. It grows only by one MSS or half the buffer (avoidance of the silly window)RFC 9293 3.8.6
Send windowThe segment that carries the newest window updates it (SND.WL1, SND.WL2)RFC 9293 3.10.7.4
Out of orderA segment after a hole goes to its place in the receive buffer; 8 ranges remember what arrived. An ACK goes at onceRFC 9293 3.10.7.4, RFC 5681 4.2
Delayed ACKOne ACK for each second full segment, or after 40 msRFC 9293 3.8.6.3, RFC 5681 4.2
Retransmission timerSRTT and RTTVAR from the round trips, in microseconds; one segment timed at a time; no sample from a segment sent two times (Karn); the timer doubles after each timeoutRFC 6298
Least RTO200 ms, not the 1 s of RFC 6298 2.4A choice of this library: the test link has round trips under 1 ms
Retries8 timeouts in a row end the connection (event Timed_Out, a RST)RFC 9293 3.8.3
Congestion controlSlow start, congestion avoidance, fast retransmit after 3 duplicate ACKs, fast recovery: Reno, with the partial ACK of NewReno. The congestion window stops at the largest window of the remoteRFC 5681, RFC 6582
Limited TransmitThe first two duplicate ACKs each send one new segmentRFC 3042
Duplicate ACKsOne ACK at once for each segment after a hole, also when a batch has severalRFC 5681 4.2
Initial window3 segments of 1460 bytesRFC 5681 3.1
Zero windowA persist timer sends a probe (one byte before SND.UNA, with no data) until the window opens; it doubles as the retransmission timer doesRFC 9293 3.8.6.1
CloseFIN in both directions: FIN-WAIT-1, FIN-WAIT-2, CLOSING, TIME-WAIT, CLOSE-WAIT, LAST-ACK. A FIN is taken only before the FIN of the remote. FIN-WAIT-2 ends after 20 s with a RSTRFC 9293 3.6
Limits against a remote that does not answerA passive open ends after 3 timeouts (15 s); 8 probes of a zero window with no answer end a connection; the ACKs that answer segments out of the window, and the challenge ACKs, are 10 in one second for each connectionRFC 5961 7, CVE-2016-5696
TIME-WAIT10 s: 2 MSL with an MSL of 5 sA choice of this library, see below
RSTSent for a segment of no connection, for a SYN when the table is full, and by abort. A RST received ends the connection only if its sequence is exactly RCV.NXTRFC 9293 3.10.7.1, RFC 5961 3
Challenge ACKA RST in the window but not at RCV.NXT, a SYN in a synchronized state, and an ACK after SND.NXT get an ACK and change nothingRFC 5961 3, 4, 5

The MSL of RFC 9293 is 2 minutes. The library takes 5 s, as an MSL for one link: the TIME-WAIT of 10 s keeps a connection record for 10 s, not for 4 minutes. A process that serves many short connections needs records for them. The initial sequence numbers of RFC 6528 protect a new connection on the same ports.

What it does not do

  • Window scaling (RFC 7323): a window is 65 535 bytes at most. On a link with a round trip of 1 ms, that is 65 MB/s at most for one connection.
  • Selective acknowledgments (SACK, RFC 2018), timestamps (RFC 7323), TCP Fast Open (RFC 7413), ECN (RFC 3168), urgent data (the field is read and ignored).
  • The Nagle rule (RFC 9293 3.7.4): the library sends a small segment at once.
  • Keepalive (RFC 9293 3.8.4).
  • SYN cookies: a SYN takes a connection record. A table that is full ends its oldest record in TIME-WAIT and drops the SYN (the remote sends it again), else refuses the SYN with a RST. Table.remote_limit limits the open connections of one remote address.
  • Path MTU discovery: the MSS is 1460 at most, for one frame of Ethernet.
  • IPv6.
  • A RST from the network service for a segment to a port with no endpoint: the service drops it and counts it.

Randomness

RFC 6528 needs a secret that an attacker cannot guess: with it, a remote cannot predict the first sequence number of a new connection and inject a segment into it. server and fetch take the secret from their random generator (random.generator_from_context): each process has one, seeded by its starter (Randomness). A process with no seed in its context stops: server writes "server: no random seed in the context" and stops with the stop outcome Refused.

The tests

TCP is tested at three levels: the library alone on the host, the system against a TCP stack that this project did not write, and the system against a peer that damages the traffic on purpose. modustool test tcp runs the two machines (Developer tools: The parts of the machine test).

The library on the host

odin test src/library/modus/tcp (in modustool check): two connection tables on one link that the test controls, with loss, reorder and duplicates; the sequence numbers at the wrap of 2^32; the round trip estimate and the timer of RFC 6298, with its doubling; a zero window that opens; a RST in the window and out of it; a SYN in a synchronized state. The checksum has its own cases: a segment with one changed bit, in its data or in its header, changes no field of the connection and adds one to the count; a segment whose checksum is right for another pair of addresses is dropped; a segment from the remote of a live connection with a malformed option, with and without a right checksum, still names its connection for the process (connection_of_segment), and data on the connection is taken after it.

odin test src/library/modus/network checks the other half: parse gives a datagram or a segment with a wrong checksum to its port, and udp_data_read refuses the datagram with the rule Verify and takes it with the rule Do_Not_Verify. A datagram with an odd count of bytes has its own case: the test sums the words by hand, and one changed bit of the last byte is refused. The rule of a taken listen port has its case too: the port of an endpoint with no grant stays taken until the endpoint is removed.

odin test src/library/modus/contract/datagram gives grant_unpack each word that it must refuse first: each bit from 51 to 63 alone and beside a whole grant, and the largest word. Then the edges: 0, each flag alone, the largest address and port. The grants of the processes come last. odin test src/library/modus/network gives the decisions of the network service (endpoint_add_grant, endpoint_grant_change) the words with bit 51 and with bit 63, alone and beside a whole grant, and a grant of another form: each gives its status and its record, with a positive value, and leaves the grant of the endpoint unchanged.

odin test src/library/modus/contract/datagram gives command_of_ring_word each word that names no command: None, the word one past the last command and the largest word. On the machine of modustool test network, net sends the same three words on its datagram ring. The network service answers each one with Bad_Command and the record Unsupported of the word, and serves the Info after it: "net: the command word 10 of the datagram ring: refused with Bad_Command and the record Unsupported of the word, and the next Info is served: as it must".

modustool test network then starts a machine with no network device. The first start of net gives the line of the root service for the absent device and the line of the refused network; a second start of net gives no second line of the device, and the console still answers 1 + 2 * 3. QEMU has no network device that the root service starts and that the frame service then refuses, so the wait of the network service for a frame service that stops is tested on the host only: odin test src/library/modus/system gives the decision of the wait (answer_wait_of) a process that stopped, a handle that names no process, a process past its deadline and the largest times.

odin test src/library/modus/contract/byte_order checks the reads and the writes of a number in each order: 0, 1, the largest value, the place of each byte, a write that leaves its neighbors unchanged. The checksum has its edges: no byte, one byte, the fold of a carry that makes a new carry, the largest sum, and the example of RFC 1071, whose sum before its fold (0x2DDF0) shows that the sum keeps its carries.

One place for the byte order and the checksum

The network packages, the network service and the tool read and write each number of a header, and compute each checksum of the Internet, with one package: src/library/modus/contract/byte_order. The TPM client, the boot program, the history file of the line editor, the files of the principals, the disk grant table and the manual pages use it too. It holds the reads and writes of 16, 32 and 64 bits in network order and in the other order, the sum of RFC 1071 with its fold, and the sum of the pseudo-header of UDP and TCP over IPv4. The design: The byte order and the checksum of the Internet in the repository.

Against an independent implementation

The peer uses src/library/modus/tcp too: it tests the library against itself. So the test also runs the system's TCP against a stack that this project did not write:

With the controlled peer

QEMU gives the peer each frame of the network device as one UDP datagram on the loopback of the host (-netdev dgram). The peer reads each frame with its own code, not with src/library/modus/network. It answers ARP, an echo request and a datagram to port 7, and it carries each call of the tool to the remote service on a call stream, and the call answer back (tools/modustool/machine/peer.odin, peer_remote.odin).

A third network machine (scenario_tcp) has the peer of the tool on -netdev dgram, as scenario_network. The tool tells the peer to run one case at a time. The peer is a TCP client of server, and it changes the frames between its library and the machine with a generator of numbers that the case seeds, so each run makes the same changes: 5 % loss, a reorder, duplicates, a zero window of its receive buffer.

The case "damaged" sends two segments by hand on a live connection, after a first answer: an ACK with an option of length 0 and one bit of its checksum changed, then the same ACK with the checksum of its bytes. The library of server drops both; the log has "server: 1 segments dropped for a wrong checksum". The client then sends two more requests on the same connection, and the case passes when both are answered: "closed, the remote first: 3 requests". The second request is the one that shows the rule: the server can answer the first one before its network service acts on a release.

What the tests found

  • With batches of segments, a receiver must still send one duplicate ACK for each segment after a hole; with one ACK for a batch, no fast retransmit starts. The record counts the ACKs that it owes.
  • recover of NewReno starts at the initial sequence number, not at 0: with 0 and an initial number above 2^31, no fast retransmit can start.
  • Avoidance of the silly window can stop a sender with a small window and nothing in flight: the persist timer ends that case too.
  • The congestion window stops at the largest window that the remote gave: without that limit, it grows with no end when the window of the remote limits the sender.
  • 1 MiB with 5 % loss in each direction, on the host link of the tests: 5 to 10 s with Reno and NewReno, 1.5 to 2.7 s with Limited Transmit. The timeouts that remain come mostly from a retransmission that the link dropped too: SACK would remove more of them.
  • libslirp acknowledges the FIN of a connection of guestfwd and does not send its own: the connection of fetch stays in FIN-WAIT-2.
  • The measures (the machine test, QEMU with KVM, 4 processors, while other machine tests ran on the host; one run unless said):
    • Between the peer and server: 1 MiB from the server in 52.9 ms (19.8 MB/s), 1 MiB to the server at 20.2 MB/s.
    • With 5 % loss in each direction: 0.8 and 0.7 MB/s (48 segments sent again; 2.2 and 0.8 MB/s in another run). With 10 % reordered: 16.6 and 15.3 MB/s. With 10 % repeated: 16.1 and 14.9 MB/s. A zero window of 1.5 s: 4 probes.
    • The handshake seen by server (SYN to the ACK of its SYN, ACK): 61 to 135 us at least. GET / answered and acknowledged in 157 to 224 us.
    • With libslirp: the host fetched 1 MiB at 58.6 to 64.9 MB/s and sent 1 MiB at 57.6 to 61.0 MB/s (the clock of the host). server measured 92.9 to 98.4 MB/s out and 81.9 to 90.4 MB/s in.
    • fetch measured the handshake in 261 to 266 us, 1 MiB in at 105.3 to 140.7 MB/s, 1 MiB out at 11.4 to 11.9 MB/s, and GET /hello in 42.6 to 43.5 ms. The cause of that time is not known: the tool answers at once, so the time is in QEMU, libslirp or the wait of fetch.
    • With 16 connections, the answers were acknowledged 0.2 to 30 ms after their request, in the order of the connections: the peer runs one step for each frame.
    • The window of a connection is 32 KiB (the receive buffer), so one connection cannot exceed 32 KiB for each round trip. The test asserts no speed.

The HTTP server

server shows the TCP library at work: it serves web pages over HTTP to each client that comes to its port 80. It reads hostile input with fixed bounds, and its pages come from its own private store, which the principal fills from the console.

server is a simple HTTP/1.1 server (RFC 9110, RFC 9112), in the process as its TCP is: one thread, one table of 48 connections (CAPACITY, with the ones in TIME-WAIT), one session of fixed size for each (its input of 8192 bytes, web.REQUEST_HEAD_LIMIT, and its answer), and no allocation. Each connection has a send buffer of 64 KiB and a receive buffer of 32 KiB.

  • The reading of a head is request_read of src/library/modus/web, for hostile input: a bound for each part, and a problem with its status (400, 405, 408, 413, 414, 431, 501, 505) for each rule that a head breaks.
  • Connections stay open after an answer; "Connection: close" or HTTP/1.0 ends them. The bytes after a head stay in the input: they are the body, or the next request (pipelining). The answers go in the order of the requests.
  • What it serves comes from its grants (property 20): its own counts (/, /counts.json), and the pages of its private store (property 9). The principal changes the pages from the console through its exports (property 19): server.put, server.remove, server.pages, server.served. PUT and DELETE over HTTP stay off: without TLS the network is not authenticated.
  • Limits against a client that makes no progress (without them, one host could keep each record): 10 s with no request, 408 for a head after 10 s (also a head that starts after an answer), no byte of a body in 10 s, a body and the bytes to send under 4096 bytes in one second over a period of 10 s (also after this server closed), 24 connections for each remote address.
  • The pages and their origin: an answer of a page keeps the generation of its place, and a page that changes during it ends the connection with a RST. put and remove change the store first. The pages, / and /counts.json share one origin, and a page of the store runs script on it by design: the origin holds no secret, no cookie and no authority. Each answer says X-Content-Type-Options: nosniff.
  • The Date field: an answer has a field Date when the date page of the process (src/library/modus/contract/date) knows the date. With no date known, the answer has no Date: RFC 9110 6.6.1 asks a server with no clock to send none.
  • The pages and the requests that it keeps: at most 16 pages (PAGE_CAPACITY), and the last 18 access records in its window (ACCESS_HISTORY), each with its time in microseconds.
  • The requests as a record output: server writes the access record of each request into its record output requests (Record outputs and record inputs of a module: typed streams of records between processes in the repository), not on the log. Its fields are status, answer_size, answer_time, method, target and peer; the time runs from the first byte of the head to the last byte of the answer in the send buffer. An example row of server.requests |> first(1): 200 12 bytes 157 us GET /hello.html 10.0.2.2 port 49200. A reader wires it and receives each request from its joined record on, in order: server.requests |> where(status = 404) |> first(5) in the console, after connect("server"). With no reader, a write costs one load and the record is counted as discarded. server writes with no wait: a full ring of a reader that the console or a starter chose refuses the record with Full, and stream_counts(server.requests) says how many. Only a ring of the pace Always_Holds_Writer, as an audit asks, holds the server until it has room.
  • No TLS over TCP: the TLS 1.3 of the system is the one of QUIC (QUIC).

The listen grant of UDP

A QUIC server must answer clients that it does not know in advance, over UDP. The listen grant of UDP lets it answer each client that came to its port, and never reach a machine that did not come. It is the listen grant of TCP, with one rule changed for datagrams.

Written for QUIC (QUIC: QUIC on the network (the fourth layer, built, with Retry and the budgets of work)); modustool test quic and modustool test quic-real run it. A datagram endpoint can have a listen grant: one local UDP port that the root service names, and the remotes that came to it. Its rules are the ones of the listen grant of TCP above, with one change: a new remote is admitted on a datagram of 1200 bytes at least (datagram.LISTEN_FIRST_LEAST), where TCP admits it on a SYN. 1200 bytes is the least first datagram of a QUIC client (RFC 9000, section 14.1), so a stray small datagram of an unknown remote takes no place.

  • The table of admitted remotes is the one of TCP (network.Admitted): 64 places, the oldest place with no traffic for 120 s serves again, Release forgets a remote.
  • A UDP listen grant can name one remote address (datagram.Grant.address): then a datagram of another address is never admitted, whatever its size, and the endpoint counts it (Not_Granted). The port of the remote is not named: a QUIC client takes a new port for each connection. The grant of remote names the address of the host, 10.0.2.2: that address is the rule of who may call (QUIC: remote over QUIC (built)). A TCP listen grant names no address.
  • With QEMU user networking, each datagram that a hostfwd of UDP gives to the machine comes from 10.0.2.2. A forward of a UDP port of the host to the port 7100 would then let each sender that reaches that port call remote as the principal. The tool refuses a machine with such a forward (network_device_problem in tools/modustool/machine/machine_command.odin).
  • A UDP listen port is not a port PORT_FIRST + n of a client grant, and no other UDP listen grant has it.
  • A Send goes only to an admitted remote. To a remote that the process did not validate, the network service sends at most 3 times the bytes that came from it (status Amplification, error kind Over_Limit); the command Validate lifts that limit for a remote that proved its address to the process (QUIC: QUIC on the network (the fourth layer, built, with Retry and the budgets of work), says what a process that validates every remote gains). A send does not keep a place alive: only a datagram of the remote does.
  • Resolve and Echo are refused, as for each listen grant: the process answers, but it does not reach.
  • The process releases a remote whose datagram it refused (a forged Initial, a datagram of no connection), so that a flood of many addresses does not hold the table.

The kernel has no code for it. The network service does for a datagram of a listen grant what it does for each datagram: it checks the headers, finds the endpoint by the local port, checks the remote, and copies the datagram one time. The 1200 bytes of a first datagram and the 3 times of the limit count the data, with no UDP header.

QUIC: what it reuses, and what it needs

The design of QUIC is in QUIC. QUIC runs over UDP (RFC 9000), so it is a library in the process over a datagram endpoint (src/library/modus/quic). This section says what QUIC took from the work on TCP, and what it needed in addition.

It reuses from TCP:

  • The endpoint and its grant: a client grant of one remote, and the listen grant with its admitted remotes, for UDP in place of TCP. The table of admitted remotes is the one of the datagram endpoint, unchanged (the section above).
  • The form of the interface: a table of connection records and buffers of the caller, one step for a batch of datagrams, a table of events, the deadline of the next timer.
  • The ideas of loss and congestion: RFC 9002 takes the round trip estimate of RFC 6298, and its congestion control is NewReno. The code is not shared: src/library/modus/quic/recovery.odin has its own estimate and congestion window, and src/library/modus/quic imports nothing of src/library/modus/tcp.
  • The tests: the peer with loss, reorder and duplicates (tools/modustool/machine/peer_quic.odin). The test against a stack that this project did not write uses the QUIC client of OpenSSL through the UDP relay of the peer, not libslirp: with restrict=on, libslirp drops each UDP datagram that the machine sends.

It needs more than TCP gives:

  • TLS 1.3 (RFC 8446, RFC 9001): the key exchange (X25519), AEAD (AES-GCM or ChaCha20-Poly1305), HKDF. Cryptography has the primitives.
  • Randomness: keys need a secret that an attacker cannot guess. Each process takes it from its random generator, seeded by its starter (Randomness).
  • A check of the peer. A certificate needs a time of the day that an attacker cannot set: the date page has the date of the real-time clock, read one time, and the clock of the machine is not such a time. So QUIC uses raw public keys in place of certificates and a date (QUIC: TLS 1.3 for QUIC (the second layer, built)).

Device_Memory_Facts bit set

A bit set of the package operation of Device_Memory_Fact: 8 bytes, 2 bits. An alias of bit_set[Device_Memory_Fact; u64].

  • Domainbit 0
  • Windowsbit 1

Error_Record struct

A struct of the package errors: 56 bytes, aligned on 8 bytes, 0 bytes of padding. The error record: what a call that failed says about why, as seven integers.

  • kindi6408 bytes
  • uniti6488 bytes
  • operationi64168 bytes
  • argumenti64248 bytes
  • valuei64328 bytes
  • limiti64408 bytes
  • foundi64488 bytes

udp_header_write procedure of the package network

udp_header_write :: proc "contextless" (datagram: []u8, source_address, destination_address: u32, source_port, destination_port: u16, data_length: int) -> int

udp_header_write writes the header of a UDP datagram whose data_length.

src/library/modus/network/network.odin:367

udp_data_read procedure of the package network

udp_data_read :: proc "contextless" (datagram: []u8, remote_address, local_address: u32, rule: Udp_Checksum_Rule) -> (data: []u8, ok: bool)

udp_data_read gives the data of a UDP datagram that an endpoint.

src/library/modus/network/network.odin:404

network_service procedure of the package root

network_service :: proc "contextless" () -> (service: ^Started, status: system.Status)

network_service gives the network service that runs, or starts it.

src/modules/system/root/network.odin:120

Endpoint_Listens_Tcp type of the package network_service

Endpoint_Listens_Tcp :: struct {...}

An endpoint with a listen grant of TCP.

src/modules/system/network/facts.odin:31

Endpoint_Grant_Changed_To_None type of the package network_service

Endpoint_Grant_Changed_To_None :: struct {...}

The grant of an endpoint changed to none: a revocation.

src/modules/system/network/facts.odin:78

Endpoint_Ended type of the package network_service

Endpoint_Ended :: struct {...}

An endpoint ended, with the datagrams that it sent and received.

src/modules/system/network/facts.odin:84

Problem_Row type of the package datagram

Problem_Row :: struct {...}

One row of the table that Problems writes: the frames refused for one.

src/library/modus/contract/datagram/datagram.odin:291

ARP_CAPACITY constant of the package network

ARP_CAPACITY :: 16

The neighbors that the network service remembers.

src/library/modus/network/tables.odin:238

parse procedure of the package network

parse :: proc "contextless" (frame: []u8) -> (packet: Packet, problem: Problem)

parse reads one frame.

src/library/modus/network/network.odin:121

step procedure of the package tcp

step :: proc "contextless" (table: ^Table, incoming: []Incoming, now: u64, output: ^Output, events: []Event) -> (deadline: u64, event_count: int)

step does the work of one batch: it reads each segment that arrived, runs.

src/library/modus/tcp/tcp.odin:631

header_write procedure of the package tcp

header_write :: proc "contextless" (segment: []u8, source, destination: u32, header: Header, length: int)

header_write writes the header of a segment whose data is already at.

src/library/modus/tcp/segment.odin:139

header_granted procedure of the package network_service

header_granted :: proc "contextless" (endpoint: ^Endpoint, tag: u32, address: u32, header: []u8, count: int, now: u64) -> bool

header_granted checks a datagram or a segment of count bytes to send, in.

src/modules/system/network/main.odin:442

ipv4_frame procedure of the package network

ipv4_frame :: proc "contextless" (frame: []u8, destination, source: Hardware, source_address, destination_address: u32, protocol: u8, payload: int, identification: u16) -> int

ipv4_frame writes the headers of Ethernet and IPv4 of a frame whose.

src/library/modus/network/network.odin:348

data_pass procedure of the package network_service

data_pass :: proc "contextless" (count: ^Data_Count, bytes: int, data_bytes: int)

data_pass counts one pass of this service over bytes of a datagram or a.

src/modules/system/network/main.odin:366

arrived procedure of the package network_service

arrived :: proc "contextless" (place: int, length: int, now: u64)

arrived reads one frame that the frame service received, in a receive place.

src/modules/system/network/main.odin:653

endpoint_of procedure of the package root

endpoint_of :: proc "contextless" (name: string) -> datagram.Grant

A procedure with no comment in its source.

src/modules/system/root/network.odin:80

Grant type of the package datagram

Grant :: struct {...}

The grant of an endpoint.

src/library/modus/contract/datagram/datagram.odin:312

PORT_BLOCK constant of the package datagram

PORT_BLOCK :: 64

The local TCP ports of a client grant.

src/library/modus/contract/datagram/datagram.odin:94

grant_pack procedure of the package datagram

grant_pack :: proc "contextless" (grant: Grant) -> u64

grant_pack gives the grant of an endpoint in one value: the address << 16.

src/library/modus/contract/datagram/datagram.odin:322

grant_unpack procedure of the package datagram

grant_unpack :: proc "contextless" (value: u64) -> (grant: Grant, known: bool)

grant_unpack gives the grant of a value that grant_pack made.

src/library/modus/contract/datagram/datagram.odin:340

GRANT_KNOWN_BIT_COUNT constant of the package datagram

GRANT_KNOWN_BIT_COUNT :: 51

The bits that a grant word can hold: the port, the address and the three.

src/library/modus/contract/datagram/datagram.odin:308

endpoint_add_grant procedure of the package network

endpoint_add_grant :: proc "contextless" (word: u64) -> (grant: datagram.Grant, refusal: [7]u64, ok: bool)

endpoint_add_grant reads the grant word of Endpoint_Add (its argument 3).

src/library/modus/network/endpoint_grants.odin:33

endpoint_grant_change procedure of the package network

endpoint_grant_change :: proc "contextless" (form: Endpoint_Form, current: ^datagram.Grant, word: u64) -> (refusal: [7]u64, ok: bool)

endpoint_grant_change applies the grant word of Endpoint_Grant (its.

src/library/modus/network/endpoint_grants.odin:49

listen_port_taken procedure of the package network

listen_port_taken :: proc "contextless" (tcp: bool, port: u16, client_first: int, client_count: int, held: []Local_Ports) -> bool

listen_port_taken says if a listen port cannot go to a new endpoint: it.

src/library/modus/network/tables.odin:76

connection_of_segment procedure of the package tcp

connection_of_segment :: proc "contextless" (table: ^Table, item: Incoming) -> int

connection_of_segment gives the record of the connection that the two.

src/library/modus/tcp/tcp.odin:713

Connection type of the package tcp

Connection :: struct {...}

Connection is the record of one connection.

src/library/modus/tcp/tcp.odin:101

generator_from_context procedure of the package random

generator_from_context :: proc "contextless" (generator: ^Generator, ctx: ^system.Context) -> bool

generator_from_context seeds the generator of a process with the seed of.

src/library/modus/random/generator.odin:250

command_of_ring_word procedure of the package datagram

command_of_ring_word :: proc "contextless" (word: u32) -> (command: Command, ok: bool)

command_of_ring_word is the border of the kind of a command record of the.

src/library/modus/contract/datagram/datagram.odin:372

answer_wait_of procedure of the package system

answer_wait_of :: proc "contextless" (now: u64, deadline: u64, state: op.Process_State) -> Answer_Wait

answer_wait_of decides a wait for an answer from the state of the.

src/library/modus/system/answer_wait.odin:38

REQUEST_HEAD_LIMIT constant of the package web

REQUEST_HEAD_LIMIT :: 8192

The bytes of a request head, with its empty line: 431 over it.

src/library/modus/web/request.odin:9

request_read procedure of the package web

request_read :: proc "contextless" (bytes: []u8) -> (request: Request, complete: bool)

request_read reads the head of a request at the start of bytes.

src/library/modus/web/request.odin:207

put procedure of the package server

put :: proc "c" (name: ^string, text: ^string, error: ^errors.) -> i64

put writes a page in the private store of the server, and serves it at /name from now on.

src/modules/demonstrations/server/pages.odin:191

remove procedure of the package server

remove :: proc "c" (name: ^string, error: ^errors.) -> i64

remove takes a page out of the private store of the server: /name gives 404 from now on.

src/modules/demonstrations/server/pages.odin:269

pages global variable of the package server

pages: [PAGE_CAPACITY]Page_Entry

A global variable with no comment in its source.

src/modules/demonstrations/server/pages.odin:69

served procedure of the package server

served :: proc "c" (result: ^Served)

served gives the counts of the server: the requests that it answered, by class of status, its connections, its bytes and its pages.

src/modules/demonstrations/server/pages.odin:333

Date type of the package date_service

Date :: struct {...}

One answer of now().

src/modules/system/date/main.odin:114

PAGE_CAPACITY constant of the package server

PAGE_CAPACITY :: 16

A constant with no comment in its source.

src/modules/demonstrations/server/pages.odin:25

ACCESS_HISTORY constant of the package server

ACCESS_HISTORY :: 18

The last requests, that the window shows.

src/modules/demonstrations/server/http.odin:35

LISTEN_FIRST_LEAST constant of the package datagram

LISTEN_FIRST_LEAST :: 1200

The least bytes of a datagram that admits a new remote to a UDP listen.

src/library/modus/contract/datagram/datagram.odin:101

Admitted type of the package network

Admitted :: [datagram.ADMITTED_CAPACITY]Admitted_Remote

The admitted remotes of one endpoint.

src/library/modus/network/tables.odin:119

Echo type of the package quic_echo

Echo :: struct {...}

The echo of each record.

src/modules/demonstrations/quic_echo/main.odin:145