Skip to content
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

[FR] udpbd support #325

Open
DanTheMan827 opened this issue Oct 27, 2020 · 9 comments
Open

[FR] udpbd support #325

DanTheMan827 opened this issue Oct 27, 2020 · 9 comments
Assignees

Comments

@DanTheMan827
Copy link

DanTheMan827 commented Oct 27, 2020

From what I understand, SMB uses a lot of the IOP memory resulting in some games crashing.

Wouldn't it be possible to make a custom protocol that takes less memory and doesn't have as much overhead?

Something without authentication or writing that has only a couple commands like:

List games
Select game
Read bytes x from offset x

I would personally much rather prefer a protocol with better game compatibility that requires a small server app than one that doesn't need a custom server but isn't as compatible with games.

@citronalco
Copy link

citronalco commented Oct 27, 2020

The most basic and memory saving thing would be to simply transfer ethernet frames (like https://sourceforge.net/projects/etherdfs/ does for DOS PCs) - but it's so basic that it lacks the required throughput for PS2. And it requires a custom programme on the server side. So you'd have to invent a protocol (maybe adapt ATA-over-ethernet or something similar) and write client and server.

Faster and easier would be something like NBD (Network Block Device). It is standardized, and there are already client and server implementations. But only for Linux, which would leave quite some OPL users behind.

Here (#86) is something in the works that could cut the required space for SMB in half. I believe that's the most promising track.

@uyjulian
Copy link
Member

uyjulian commented Nov 6, 2020

At the moment, udpbd is a lighter weight protocol which has been implemented and works correctly independently, but it does not work correctly when used with OPL. Progress is in GitLab SaaS in ps2max/Open-PS2-Loader repo in bdm-2020 branch.

@rickgaiser
Copy link
Member

rickgaiser commented Nov 7, 2020

UDPBD (UDP Block Device) is designed specifically for the PS2. It aligns the data inside each packet so that the IOP can use DMA to transfer 128byte blocks directly from the network cards fifo into the application buffer. The protocol is very simple and defined here (inside the modified SMAP driver):
https://gitlab.com/ps2max/ps2sdk/-/blob/udpbd/iop/network/smap/src/udpbd.h
And here (inside the pc/server side test application:
https://gitlab.com/ps2max/udpbd-server/-/blob/master/udpbd.h

Consider it a proof of concept that was never finished into something usefull. It worked a few yeas ago, but I'm not sure it will still compile and run with all the changes there have been to ps2sdk.
IOP CPU and memory usage was very low. And speeds (for the first time ever I think) where true 100Mbps.

@DanTheMan827
Copy link
Author

udpbd sounds exactly like what I was describing

@DanTheMan827 DanTheMan827 changed the title [FR] Custom network protocol [FR] udpbd support Nov 9, 2020
@bignaux
Copy link
Member

bignaux commented Apr 22, 2021

@citronalco there is https://cloudbase.it/ceph-for-windows/ and other, btw i quite finish the nbd server on OPL.

@bignaux
Copy link
Member

bignaux commented May 15, 2021

Since NBD server is merged in OPL, i invite you to setup a nbd client and try it!

@DanTheMan827
Copy link
Author

The samba improvements in recent versions did fix compatibility with a game that previously didn't work (Amplitude)

@bignaux
Copy link
Member

bignaux commented Sep 9, 2021

@rickgaiser : it could be good to have udpbd to replace smb but what about turn it to a compliant tftp client ?

@rickgaiser
Copy link
Member

udpbd uses a special alignment (2 bytes extra to align the data to a 4 byte boundary), that make it incompatible with all standard protocols. But basically it's UDP with 2 dummy bytes, making (zero copy) DMA tansfers possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants