How to Play a Nullmodem Link Game With Two MiSTers?

rsn8887
Posts: 71
Joined: Sun May 24, 2020 9:48 pm
Has thanked: 23 times
Been thanked: 12 times

How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by rsn8887 »

I think I need some help setting up a virtual nullmodem connection between two MiSTers running AO486 at my home. I would like to play a nullmodem (direct link) game of Oxyd between two MiSTers using AO486 COM1. The game manual says that either a nullmodem cable or a modem can be used. It allows typing in commands like atdt if one uses a modem.

On MiSTer 1 and 2, I set the UART to Modem and TCP. However, after that I am stuck. I am missing a way to tell my MiSTer 1 what the IP address of MiSTer 2 is for the virtual nullmodem connection. I tried to enter atdt 192.168.0.116 on MiSTer 1, and ATA on MiSTer 2 but it didn't work. Nothing happened. I expected to be able to see the characters I enter on MiSTer 1 on MiSTer 2 and vice versa.

Is there a setting somewhere to enter the destination IP? For example, Dosbox allows to configure a virtual nullmodem connection and enter the destination IP in the dosbox config. I got a nullmodem game of Oxyd between two laptops running dosbox to work that way. I need to find such a setting on MiSTer.

Other network stuff with my MiSTer works. For example, I can connect AO486 to the internet using Windows 95 and PPP, I can connect my C64 core to neohabitat using an ATDT command, I can connect the Amiga core to the internet using Miami, I can browse the SMB folder, FTP works, etc.

EDIT: Both MiSTers are on the same local WIFI network.
MostroW
Posts: 323
Joined: Tue Aug 18, 2020 3:32 pm
Has thanked: 140 times
Been thanked: 43 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by MostroW »

i'm not familiar with the game itself, but a lot of the games of that era also had IPX/SPX protocol support, if this game does as well, you could install that protocol under the network adapter?
rsn8887
Posts: 71
Joined: Sun May 24, 2020 9:48 pm
Has thanked: 23 times
Been thanked: 12 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by rsn8887 »

I got it to work with Per.Oxyd!!!!

- Set the game to COM 1 and 19200 baud in the game options on both MiSTers.

- Set the UART in AO486 OSD Menu to Modem, TCP, 19200 baud on both MiSTers.

- In the Per.Oxyd title screen on both misters, click once on the two player icon to enable network game setup. The two player icon will change from grey to black.

- On first MiSTer, type ATDT192.168.0.116:23 (replace the iP with the ip of your second MiSTer). Note that all letters you type will be repeated, so you are typing semi blind. This is the normal echo like on a real modem. The echoing is a sign that stuff is working. Hit enter.

- You should hear a dial sound simulating a real modem. Wait for the sound to go away. Now click the two player icon on one of the two misters to start a two player link game. When the level description text appears, press mouse button again to start the level. MiSTer 1 will be the black marble, MiSTer 2 will be the white marble.
21E364B9-7FA7-4158-BCB4-4F70A3730EBC.jpeg
21E364B9-7FA7-4158-BCB4-4F70A3730EBC.jpeg (406.53 KiB) Viewed 1534 times
CC6D61B3-8A3B-4EE1-8E82-B72682B8B3E3.jpeg
CC6D61B3-8A3B-4EE1-8E82-B72682B8B3E3.jpeg (268.1 KiB) Viewed 1534 times
Gameplay is smooth over Wi-Fi!
rsn8887
Posts: 71
Joined: Sun May 24, 2020 9:48 pm
Has thanked: 23 times
Been thanked: 12 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by rsn8887 »

I know why it doesn’t work with Oxyd 1: the game is hardcoded to use COM 2 and it seems MiSTer Modem is hardcoded to use COM 1 :/
bbond007
Top Contributor
Posts: 519
Joined: Tue May 26, 2020 5:06 am
Has thanked: 85 times
Been thanked: 198 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by bbond007 »

rsn8887 wrote: Thu Aug 18, 2022 11:59 pm I got it to work with Per.Oxyd!!!!

- Set the game to COM 1 and 19200 baud in the game options on both MiSTers.

- Set the UART in AO486 OSD Menu to Modem, TCP, 19200 baud on both MiSTers.
You can also use UDP mode to eliminate the need for dialing (like a true null-modem link).

Simply set the "UDP_SERVER=" option in /media/fat/MidiLink.INI to the IP or hostname of the OTHER MiSTer.

You must do this on both MiSTers.

Anyway, the UDP connection may offer lower latency than TCP (modem), however, because I have Nagle's algorithm disabled, its probably not much lower.
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by Malor »

TCP versus UDP latency won't matter, because the difference is so tiny. If you're on a local wired network, it wouldn't matter which you used. If you're on wireless, or if you're using this method to talk to a distant machine on the Internet, you probably want TCP, to get its error correction. Serial-link games probably won't do any error checking, so you'd get crashes if packets were dropped or corrupted via UDP. TCP should retransmit dropped packets and prevent corruption, while adding like a tenth of a millisecond latency, if even that much. (TCP processing is extremely fast.)

Games that would only run on direct serial links might not like the latency of a remote machine, but TCP versus UDP wouldn't really affect that. Games that are meant to run on modems will be entirely insensitive to Internet lag, because modems often had about 300ms ping times.

edit: it's pointed out just below that Nagle's algorithm can play heck with a serial->TCP connection. It tries to batch small packets into larger ones, which would totally screw up delivery timing. UDP wouldn't have that problem.
bbond007
Top Contributor
Posts: 519
Joined: Tue May 26, 2020 5:06 am
Has thanked: 85 times
Been thanked: 198 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by bbond007 »

Malor wrote: Wed Aug 24, 2022 6:12 am Games that are meant to run on modems will be entirely insensitive to Internet lag, because modems often had about 300ms ping times.
2400 BPS and slower modems have very little latency. The lag came in with faster modems that introduced data-compression (ie v.42 bis) and error-correcting protocols.

Battle Chess is a good example of a game that runs at 300 BPS and is also very sensitive to lag.
Malor wrote: Wed Aug 24, 2022 6:12 am TCP versus UDP latency won't matter, because the difference is so tiny. If you're on a local wired network, it wouldn't matter which you used.
Knights of the Sky would only work on UDP (on my local network) until I disabled Nagle's algorithm for TCP.
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by Malor »

(edit, replacing original comment, because I thought Nagle's was the slow-start algorithm.)

You're right, Nagle's might be a problem. It tries not to send small packets, which is exactly what a serial->TCP link should be doing. It needs precisely timed data, so it should be sending numerous, regular small packets, instead of irregular large ones.

That probably should be the default in the Mister transport layer. You might want to raise it as a bug. Having the Mister code disable Nagle's would probably improve serial links a ton, in almost every case.

I would raise the bug myself, but I have only one MiSTer and would have a hard time testing it. It sounds like you could verify the bugfix, where I couldn't.
bbond007
Top Contributor
Posts: 519
Joined: Tue May 26, 2020 5:06 am
Has thanked: 85 times
Been thanked: 198 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by bbond007 »

Malor wrote: Fri Aug 26, 2022 5:45 am You're right, Nagle's might be a problem. It tries not to send small packets, which is exactly what a serial->TCP link should be doing. It needs precisely timed data, so it should be sending numerous, regular small packets, instead of irregular large ones.

That probably should be the default in the Mister transport layer. You might want to raise it as a bug. Having the Mister code disable Nagle's would probably improve serial links a ton, in almost every case.

I would raise the bug myself, but I have only one MiSTer and would have a hard time testing it. It sounds like you could verify the bugfix, where I couldn't.
What bug? I already disable the Nagle for TCP/Modem (March 18, 2019). Once I did that Knights of the Sky started working with TCP. My point is that in practice these old modem games are not as insensitive to lag as you suggest...
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by Malor »

If you disable Nagle's algorithm, I presume you're doing it at the OS level, which would disable it for everything, AFAIK. Mister should be disabling it for this type of TCP connection on its own, so you don't have to mess up every other TCP client.
bbond007
Top Contributor
Posts: 519
Joined: Tue May 26, 2020 5:06 am
Has thanked: 85 times
Been thanked: 198 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by bbond007 »

Malor wrote: Fri Aug 26, 2022 3:23 pm If you disable Nagle's algorithm, I presume you're doing it at the OS level, which would disable it for everything, AFAIK. Mister should be disabling it for this type of TCP connection on its own, so you don't have to mess up every other TCP client.
I'm not disabling it at the OS level. I'm disabling it at the socket level for just the outbound/inbound TCP sockets I'm using.

https://github.com/MiSTer-devel/MidiLin ... sock.c#L17
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: How to Play a Nullmodem Link Game With Two MiSTers?

Unread post by Malor »

So are you using a custom-built binary? Per-socket is the correct approach, and belongs in the shipping binary if it's not already there.
Post Reply