Menuet
cpu0: os + network driver
cpu1: UDP packet forwarding application
Linux Mint
[attachment=0]udp3.jpg[/attachment]
Fast UDP forwarding with SMP
Fast UDP forwarding with SMP
- Attachments
-
- udp3.jpg (77.05 KiB) Viewed 5377 times
Re: Fast UDP forwarding with SMP
Really nice results — the latency advantage holds across every configuration. Great to see what a lean assembly OS can still do in the network path. Thanks for sharing the numbers
Re: Fast UDP forwarding with SMP
; Start thread in CPU1
mov rax , 140
mov rbx , 3
mov rcx , threadentry
mov rdx , threadstack
mov r8 , 1 ; CPU1
int 0x60
; ..
threadentry:
; Open UDP socket - source
mov rax , 53
mov rbx , 0
mov rcx , 10000
mov rdx , 11000
mov rsi , [source_ip]
int 0x60
mov [socket1],rax
; Open UDP socket - destination
mov rax , 53
mov rbx , 0
mov rcx , 20000
mov rdx , 21000
mov rsi , [destination_ip]
int 0x60
mov [socket2],rax
; Enable events: Win, Kbd, Buttons, Network
mov rax , 40
mov rbx , 111b + 1 shl 7
int 0x60
still:
; Wait for event
mov rax , 10
int 0x60
; Read data
mov rax , 53
mov rbx , 13
mov rcx , [socket1] ; Source
mov rdx , buffer
int 0x60
mov [length],rax
; Send data
mov rax , 53
mov rbx , 4
mov rcx , [socket2] ; Destination
mov rdx , [length]
mov rsi , buffer
int 0x60
jmp stillWho is online
Users browsing this forum: No registered users and 1 guest