feat(core): ARP after Java, measured with Java FILIUS
An ARP lookup asks, waits a round trip, asks once more and gives up after another round trip; then host unreachable, observed at the sender itself or sent back by the router (for ICMP only for an echo request). A waiting sender wakes after what else happens at that time. A ping then waits a round trip for its answer, counted from when it left. Swift asks twice at once while events run and lets the packet wait without end when the address exists anywhere in the network; the option swiftArp keeps that for the Swift comparison, and three scenarios are compared with Swift until the trace where ARP fails or a ping goes unanswered. arpJava.test.ts compares ArpRun: both pings match; the two UDP stories wait for Java's transport thread (next step). DNS without a server now matches Java too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,15 @@ function javaText(frame: JavaFrame): string {
|
||||
return `${macs} UDP ${ends} ${frame.payload}`;
|
||||
}
|
||||
|
||||
/** The ICMP type numbers Java logs. */
|
||||
const ICMP_TYPES: Record<string, number> = {
|
||||
echoReply: 0,
|
||||
destinationNetworkUnreachable: 3,
|
||||
destinationHostUnreachable: 3,
|
||||
echoRequest: 8,
|
||||
timeExceeded: 11,
|
||||
};
|
||||
|
||||
const FLAG_LETTERS: [number, string][] = [
|
||||
[TCP_FLAG.synchronize, 'S'],
|
||||
[TCP_FLAG.acknowledgement, 'A'],
|
||||
@@ -77,7 +86,7 @@ function engineText(frame: EthernetFrame): string {
|
||||
return `${macs} ARP ${arp.operation} ${arp.senderIPAddress} > ${arp.targetIPAddress}`;
|
||||
}
|
||||
const packet = frame.payload.packet;
|
||||
if (packet.payload.kind === 'icmp') return `${macs} ICMP`;
|
||||
if (packet.payload.kind === 'icmp') return `${macs} ICMP ${ICMP_TYPES[packet.payload.message.kind]}`;
|
||||
if (packet.payload.kind === 'tcp') {
|
||||
const segment = packet.payload.segment;
|
||||
const flags = FLAG_LETTERS.filter(([bit]) => (segment.flags & bit) !== 0).map(([, letter]) => letter).join('');
|
||||
|
||||
Reference in New Issue
Block a user