The program network
The network service: the one client of the frame service of the network device, and the service that gives each program with the grant one endpoint of datagrams (contract/datagram).
It speaks Ethernet, ARP, IPv4, ICMP echo (request and answer) and UDP, with the protocol library support/network: this program does the input and output, the library reads and writes the frames. It has one static address (10.0.2.15/24, the gateway 10.0.2.2: the network of QEMU).
The root service names the grant of each endpoint. A datagram endpoint reaches one remote address and one remote UDP port, or listens on one local UDP port and answers the remotes that came to it. A segment endpoint (TCP) has a client grant (one remote, from a block of local TCP ports) or a listen grant (one local TCP port, and the remotes that sent a segment to it). A request to another remote is refused with the detail of the grant; a datagram or a segment from another remote does not reach the program. TCP itself is in the program (support/tcp): this service checks the IPv4 header, the TCP checksum and the ports of each segment, and keeps no state of a connection (docs/NETWORK.md).
One thread. It waits on the completions of the frame ring, on the control ring of the root service, and on the command queue of each endpoint, with the deadline of the oldest request that waits for an answer. The data of a datagram is copied one time, between the datagram region of the program and the frame region; the kernel is not on the path of the data (property 5).
| Fact | Value |
|---|---|
| Source | programs/network |
| Boot image | in the boot image; the image is not built, so its size is not known |
| Imports | none |
| Imported by | none |
Exports
| Export | What it does |
|---|---|
| entry() |
Read from the source of the module, as the build reads it to describe the exports (tools/kerneltool/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | {.Network_Device} | |
| Budget: pages, programs, threads | {pages = 2048, programs = 1, threads = 1} | Not named in things_of: the budget of each other program. |
Read from grants_of and things_of in programs/root/main.odin; budget_of in the same file adds the limits of processor time and of log records.
