IP networking under FreeDOS #1175
Replies: 4 comments 25 replies
-
Wow, cool!
It's a mTCP 2024-10-20? After some tests, I found that the DOSLynx' network stack works well, you can try it at https://copy.sh/v86?profile=msdos, run |
Beta Was this translation helpful? Give feedback.
-
I think I found the reason why HTGET.EXE (mTCP's HTTP GET command line client) in mTCP hangs at the end! To clarify, HTGET.EXE does not crash, it prints nicely to stdout while data is coming in but then sits there waiting for what appears to be the last chunk of data. HTGET.EXE responds to user input and can be exited normally. After some digging I came to the conclusion that TCP's graceful close handshake in fake network is incomplete. The required TCP state values are defined but hardly used, some details of the TCP state machine are missing. Then I found this FIN-related bug in TCPConnection.pump(): the second When I changed the second
it made HTGET.EXE work! Everything else using TCP broke though (which makes sense, with this hack any TCP connection is getting the FIN bit set as soon as it runs out of data to send), but this is a significant clue as to where the hanging connections in HTGET.EXE come from. I will try to properly complete the TCP state-related code in fake_network.js. I'm aiming at full support for all mTCP binaries under FreeDOS. mTCP's FTP server and their new NetDrive look really interesting. WispServerCpp works great, I run it inside a Debian VM on my Windows Desktop (VirtualBox) which gives me a local high-speed WISP server. I've installed a whole Debian 12 into V86 with network support using WISP, including |
Beta Was this translation helpful? Give feedback.
-
The problem with HTGET.EXE is fixed! When I run The response content gets forwarded chunk by chunk (1460 bytes each) from RAM to the application running under the guest OS by TCPConnection.pump(). The misbalance in bandwidth between the two sides is very important to understand what is going on here. Directly after the last call to TCPConnection.write() (when the WISP download is complete) TCPConnection.close() gets called, potentially (long) before the buffered response content has been forwarded to the guest. Closing the TCP connection by setting the FIN flag when we still have buffered data to send must be delayed until the send buffer is empty, only the last buffered package we forward to the guest must have its FIN flag set (that's how this flag is defined). That turned out to be very easy to fix, mTCP's HTGET.EXE now works just fine together with all the other TCP things. |
Beta Was this translation helpful? Give feedback.
-
Here are some network performance statistics that I now feel confident about. Even though they were created using Debian they are also relevant for FreeDOS. Test setup
For reproducible download speed tests I wrote bash script # FD13-LiveCD.zip: 374M
URL="http://10.0.0.44/download/FD13-LiveCD.zip"
curl -L -o /dev/null "$URL" 2>&1 | tr "\r" "\n" It prints nice statistics to stdout and discards downloaded data to the null device. Test results
wisp- and fetch-based networking have about the same performance (both use V86's fake network), whereas websocketproxy-based is quite far behind. A lesson learned: Always prefer network device "virtio" over "ne2k" if you can, ne2k dies midflight under sustained load. EDIT: replaced WISP server WispServerCpp with wisp-js, updated WISP results. Footnotes
|
Beta Was this translation helpful? Give feedback.
-
I have a FreeDOS image with V86 network support using mTCP. mTCP is under active development and comes shipped with FreeDOS.
Both UDP and TCP are working, so far I've tested DHCP and DNS packets as well as raw TCP streams. For TCP I've used a simple
nc
(netcat) which is part of mTCP. I'm using DHCP for auto-IP setup when FreeDOS boots, it works out of the box.Is anyone interested in this or is this nothing new and networking under FreeDOS has already been done before?
My local V86 network relay is WispServerCpp.
Currently I'm using a RTL8029AS network driver I found on the internet, not sure if that is neccessary (I'll try to switch to one of the drivers that comes with FreeDOS). Is there a recommended DOS packet driver for V86?EDIT: The generic NE2000 driver that is distributed with FreeDOS works, too (given the right arguments:C:\NET\FDNET\NE2000.COM 0x60 0xA 0x300
).Getting this to work involves a patch to src/browser/fake_network.js (add UDP checksum in write_udp()).
Here's the response for a HTTP GET-Request to http://www.osdever.net/FreeVGA/home.htm using
nc
:freedos-nc-osdever_net.webm
The HTTP Request is not echoed here, so you directly see the response after connect and a short pause, the "Bad Request" at the end is me pressing Ctrl+D.
Beta Was this translation helpful? Give feedback.
All reactions