Three stories of socket calls on tcp-lan's network (exchange, closedPort, lostData): every frame with TCP flags and numbers, when each call started, returned or failed, and each socket's states. Network building and the packet log move from DhcpRun to ScenarioNetwork. Measured: 3 RTT per attempt (8250 ms at 90 %), an orderly close after a failed send, TIME_WAIT of 3 RTT, the passive side closing by itself on FIN, one SYN only (Java's retry loop ends after the first timeout). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
950 B
Java
27 lines
950 B
Java
// Runs a core scenario's network in Java FILIUS (ScenarioNetwork) and records
|
|
// what DHCP really does: every frame each network card saw and each host's
|
|
// address configuration at the end.
|
|
//
|
|
// DhcpRun <scenario.json> <milliseconds> <out.json>
|
|
//
|
|
// The scenario's steps are ignored: the network runs, in real time, for the
|
|
// given milliseconds. Threads make the times vary from run to run; the order
|
|
// of one client's messages does not.
|
|
|
|
public class DhcpRun {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
ScenarioNetwork network = ScenarioNetwork.read(args[0]);
|
|
network.start();
|
|
Thread.sleep(Long.parseLong(args[1]));
|
|
ScenarioNetwork.Json out = new ScenarioNetwork.Json();
|
|
out.open('{');
|
|
network.writeFrames(out);
|
|
network.writeDevices(out);
|
|
out.close('}');
|
|
network.stop();
|
|
ScenarioNetwork.write(args[2], out);
|
|
System.exit(0);
|
|
}
|
|
}
|