-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Networking / bsdsocket.library not working correctly #1359
Comments
The bsdsocket.library emulation is largely based on FS-UAE's implementation, since WinUAE's was Windows-specific. Unfortunately, it looks like BlackIRC doesn't connect under FS-UAE either, so there are obviously some issues with the implementation. |
Ahh that explains I had the exact same issues with FS-UAE. |
I'll have to take a deep-dive into it and see if I can improve it, but it will probably have to wait a bit. :) |
FWIW I had a look at this using wireshark, and it gives me the impression that we're failing identd (RFC1413) ...that is, I see the initial connection negotiation, and then the remote server sends a packet that we never reply to. I can probably check this further (I know an IRC admin that will look at connection logs for me) ~ I'll need wait until he's back from holidays =) edit: wrong, it's failing before anything like that...I did however getting it running to a local server (start server first, then launch client)... ....I'll have to grab a pcap with it running in winuae/wine, and see what differs wrt the initial client>server response... |
Hmmm...okay...wrt 'DYNAMITE' pretty easy to see what's not happening ; bit harder to divine why... That's wireshark pcap using WinUAE v5.3.0 and a clone of the ClassicWB-P96 setup I use for this stuff. The first 3 exchanges are the client<>server auth, with the client sending an ACK upon completion...// same in amiberry ...then, the client side instantiates a HTTP/GET packet to the server, and the data resources are retrieved in this manner, to build/populate the server list window that appears at the client end. In amiberry, this HTTP/GET packet is not seemingly generated, nor transmitted to the server. Eventually the server end calls a timeout, and it's wash, rinse, repeat ad infinitum. I wouldn't expect it to be the bsdsocket.layer's job to generate that packet ....(unless it is being generated but ignored?).... ....the behavior wrt a 'Local' connection is the same in WinUAE as in amiberry ~ you have to launch the 'DServer.exe' process first, for 'Local' connection to work in the client.... ....interestingly, (could be a locale/timezone thing), even though the server list window does pop under WinUAE, and lists 2 servers, neither was apparently responding (retransmission packets) and could not be connected to ... so I couldn't confirm whether or not online gameplay actually worked..hmmm... @papa923829 -- could you connect to either of these servers? |
Alright. I've spend some time at that weekend to find out whats going on. I tested amiberry (standalone) - I tested WinUAE and installed MorphOS on qemu - and even asked old AMIGA Users to test it.
I hope this was kind of clear. So while amiberry has the most problems here, the main problems probably comes from the game/Dynamite itself. A pingtimeout while connecting from localhost makes it look very strange. So considering the same behavior happens with WinUAE and MorphOS it looks like WinUAE does pretty much everything right. Means if amiberry would "behave" like WinUAE, the network support surely would improve. Just in case if you think you want to test "MorphOS on qemu" to have a "more native environment" qemu-system-ppc -machine mac99,via=pmu -m 2048 -vga none -device sm501 -boot d -prom-env "boot-device=hd:,boot.img" -bios openbios-qemu.elf -device ide-hd,drive=hd-drive,bus=ide.0 -drive file=hdmos.img,if=none,id=hd-drive,format=raw -serial stdio -nic user,hostfwd=tcp::6318-:6318 -nic user,hostfwd=udp::6318-:6318 If there is anything I can do to further help you feel free to ask. I'm happy to assist. |
Thanks for checking, that's aligned with my findings ; there's more to it than just amiberry getting it wrong. And that's with the winuae based bsdsocket implementation, as well as the bsdsocket code amiberry uses from fs-uae. That makes it hard... To be clear, when I was referring to failed identd above, that was wrt the blackIRC client...(it is failing there as well ;) |
Looking at the wireshark logs, this roughly concurs with what I'm seeing -> https://objfw.nil.im/tktview/4c4b0ddef1 ...that is, if waitselect() is ignoring the timeout and waits forever, that would readily explain the wireshark traces I see... @midwan .... is this still an apparent problem wrt bsdsocket code used in amiberry? |
Some socket connections would not work properly in Amiberry (but also in most/all UAE implementations that were not WinUAE it seems, as they all use the same code). Specifically, the optvalue would not cover cases that the type was SO_RCVTIMEO, SO_SNDTIMEO and SO_LINGER. All of these use a different struct, instead of an int value, and the result was that we'd get an error when we called setsockopt() - which got reflected back to AmigaOS, as an invalid parameter.
I've implemented a fix, which might resolve these errors. I've only tested it with one simple tool here (sntp -> https://aminet.net/package/comm/net/sntp) which was giving me errors when it tried to open a socket and set a receive timeout (which sounds like what most of these issues are about). Please test when you get a chance and let me know? |
I tested sntp as mentioned in frames 10, 11 --- ask NS for IP of se.ntp.pool.org => NS replies with IP Note: this is an NTP protocol query, using assigned port :123 The program 'Dynamix' still fails as before, with no improvement... Same 3 frames .... this is a SYNC conversation that never (seemingly) completes (3 way handshake)... Considering the server doesn't reply to the last sent frame from the client, and given that WinUAE seemingly gets further than this, likely the next test will be to capture packets from the same scenario (using Dynamix in WinUAE), and compare the data ...ie; are we forming the 3rd frame correctly? Should we do something else after this frame is sent?... FTR, the bsdsocket layer still works as before (well, better than before really considering sntp now works ;) |
Thanks for the feedback! I'll try to run Dynamix on WinUAE under the debugger, to see what's happening, then compare that with Amiberry. Maybe I can find what fails. |
I'm not sure if this is obvious, but what version do I need to use to test the latest patch here? Or do I need to build it from git myself? |
For now (until a new release is published), you'll need to build it from source. |
Retested, still broken ~ HTTP connection to server not starting... |
Yes, nothing more was done regarding this. I have a separate branch in testing with, but it's not there yet. |
I have tested the recently released 7.0.0-RC3. Also I have tried to use the now enabled uaenet.device. It seems I can connect with MiamiDX to the internet , but when I start Dynamite Server, Amiberry freezes completely. You cannot even ungrab the mouse anymore. You have to kill it from "outside" (like switch to different VT - ctrl+alt+F3 - and kill amiberry from there). But I suppose this is a complete different problem. |
I have tested Amiberry (5.7.2 and preview 6.3) and tested my old Saved AMIGA OS Installation from my AMIGA past.
I have set up an AMIGA 040 with normal speed and with bsdsocket.library, RTG and stuff.
It booted all fine.
I started a game: dynAMIte and clicked on global server list - it should connect to an Server. And here the problem appears. It does not. It tries forever. Also when I start the server locally, I cannot connect to 127.0.0.1.
I have tested other Software:
I don't know how to report properly what works fine and not, also why it does or does not.
However I tested the exact same configuration with WinUAE and it worked correctly. It connects within seconds and also connecting to 127.0.0.1 works fine.
My System is Linux/Debian Bookworm X86_64.
I tested it on other systems as well, but there was not change of this behavior.
I also tried to connect with MiamiDX/A2065 emulation but it didn't work as well. MiamiDX couldn't retrieve an IP.
The text was updated successfully, but these errors were encountered: