You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HybridDog opened this issue
Mar 30, 2024
· 1 comment
Labels
BugIssues that were confirmed to be a bug@ NetworkNon-trivialA large amount of work is required to address this (sometimes to the point of being infeasible).
Minetest 5.9.0-dev-e8a8525bc (Linux)
Using LuaJIT 2.1.0-beta3
Built by GCC 13.2
Running on Linux/6.8.1-arch1-1 x86_64
BUILD_TYPE=Release
RUN_IN_PLACE=0
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
STATIC_SHAREDIR="/usr/local/share/minetest"
STATIC_LOCALEDIR="/usr/local/share/locale"
Irrlicht device
X11
Operating system and version
Arch Linux
CPU model
dual core Intel Core i5-6200U [MT MCP]
GPU model
No response
Active renderer
No response
Summary
Minetest detects and fixes network packet reordering if the packets are in the same channel (as far as I know).
TOCLIENT_BLOCKDATA, TOCLIENT_ADDNODE and TOCLIENT_REMOVENODE packets all modify the client-side map but TOCLIENT_BLOCKDATA is in a different channel than the other two:
If TOCLIENT_BLOCKDATA and TOCLIENT_ADDNODE (or TOCLIENT_REMOVENODE) packets arrive in the wrong order, the client-side map can contain different nodes than the server-side map although the server has sent all map updates (if I understand the code correctly).
Steps to reproduce
Use minetest_game and add this chatcommand:
localnplace_state=falseminetest.register_chatcommand("nplace", {
description="set_node and voxel_manip in the same mapblock",
privs= {server=true},
func=function(name)
localnode_vm="default:wood"localnode_set="default:stone"ifnplace_statethennode_vm, node_set=node_set, node_vmendnplace_state=notnplace_statelocalpos=vector.new(0, 511, 0)
minetest.set_node(pos, {name=node_set})
localvm=minetest.get_voxel_manip()
localarea_p1, area_p2=vm:read_from_map(pos, pos)
localdata=vm:get_data()
localnode_vm_id=minetest.get_content_id(node_vm)
fori=1, #datadodata[i] =node_vm_idendvm:set_data(data)
vm:write_to_map()
returntrue, ("Nodes changed: Set %s at %s and afterwards filled " .."the mapblock with %s"):format(
node_set, minetest.pos_to_string(pos), node_vm)
end
})
Configure the operating system to apply random delays to network packets on localhost. On Linux, this can be done with, for example, the traffic control command:
sudo tc qdisc add dev lo root handle 1: htb default 12
sudo tc qdisc add dev lo root netem delay 700ms 500ms
This adds 700 ms delay to packets with 500 ms jitter, which often leads to packet reordering.
To undo the traffic control manipulation later, execute sudo tc qdisc del dev lo root.
Join a world in singleplayer, teleport to (0, 511, 0) and execute the nplace chat command. Without packet reordering, the client-side map and the server-side one are the same. Otherwise, the TOCLIENT_ADDNODE packet from minetest.set_node and the TOCLIENT_BLOCKDATA packet from voxel manipuation arrive in the wrong order, so the client map has a wrong node in the corner.
Here's a video of the problem:
vm_setnode_packet_reordering.mp4
The text was updated successfully, but these errors were encountered:
sfan5
added
Bug
Issues that were confirmed to be a bug
and removed
Unconfirmed bug
Bug report that has not been confirmed to exist/be reproducible
labels
Mar 30, 2024
sfan5
added
Non-trivial
A large amount of work is required to address this (sometimes to the point of being infeasible).
@ Network
and removed
Non-trivial
A large amount of work is required to address this (sometimes to the point of being infeasible).
labels
Mar 30, 2024
BugIssues that were confirmed to be a bug@ NetworkNon-trivialA large amount of work is required to address this (sometimes to the point of being infeasible).
Minetest version
Irrlicht device
X11
Operating system and version
Arch Linux
CPU model
dual core Intel Core i5-6200U [MT MCP]
GPU model
No response
Active renderer
No response
Summary
Minetest detects and fixes network packet reordering if the packets are in the same channel (as far as I know).
TOCLIENT_BLOCKDATA, TOCLIENT_ADDNODE and TOCLIENT_REMOVENODE packets all modify the client-side map but TOCLIENT_BLOCKDATA is in a different channel than the other two:
minetest/src/network/serveropcodes.cpp
Lines 161 to 163 in e79587c
If TOCLIENT_BLOCKDATA and TOCLIENT_ADDNODE (or TOCLIENT_REMOVENODE) packets arrive in the wrong order, the client-side map can contain different nodes than the server-side map although the server has sent all map updates (if I understand the code correctly).
Steps to reproduce
This adds 700 ms delay to packets with 500 ms jitter, which often leads to packet reordering.
To undo the traffic control manipulation later, execute
sudo tc qdisc del dev lo root
.nplace
chat command. Without packet reordering, the client-side map and the server-side one are the same. Otherwise, the TOCLIENT_ADDNODE packet fromminetest.set_node
and the TOCLIENT_BLOCKDATA packet from voxel manipuation arrive in the wrong order, so the client map has a wrong node in the corner.Here's a video of the problem:
vm_setnode_packet_reordering.mp4
The text was updated successfully, but these errors were encountered: