Skip to content

LAN sync with other clients on local network #2010

Closed as not planned
Closed as not planned

Description

@biva

Hello,

I'm in Africa and we have both a slow and expensive bandwidth (illimited plans are very rare). In addition, in a climate change perspective, it would be useful to limit bandwidth usage over large distances to save energy. In order to optimize this, we'd like to have the ability to sync over a LAN both with the server if it's on the LAN, and especially with other clients on the same LAN, who have already synced.

It is a cool and efficient existing Dropbox feature (https://help.dropbox.com/installs-integrations/sync-uploads/lan-sync-overview). And a lot of discussions have already started, both on owncloud and Nextcloud, but it looks like there's no activity anymore for years (nextcloud/server#7092, nextcloud/server#8331, owncloud/client#230).

Would it be possible to consider this feature? Thank you!

For reference, other links where this feature is requested:
Nextcloud:

owncloud:

Client configuration

Client version: 2.6.4stable-Win64 (build 20200303)

Activity

  1. RogoTe commented on Jun 4, 2020

    @RogoTe

    Just for the reference... Have you ever looked at syncthing.net and pydio?

  2. michaelstingl commented on Jun 5, 2020

    @michaelstingl
    Contributor

    Just for the reference... Have you ever looked at syncthing.net and pydio?

    @RogoTe maybe you could provide some more context/pointers. Syncthing doesn't have a central server, and Pydio doesn't have LAN sync? (afaik)

  3. biva commented on Jul 17, 2020

    @biva
    Author

    @RogoTe I'm not a dev so I can't know if they are good strategies. I think they were already mentioned in previous posts (notably owncloud/client#230 (comment)). [Edit] Synchthing was also discussed in nextcloud/server#8384

    How would the Nextcloud team consider this feature request?

  4. wizdude commented on Jul 17, 2020

    @wizdude

    Syncthing doesn't have a central server, and Pydio doesn't have LAN sync? (afaik)

    Syncthing is designed to be peer to peer and your main server can most certainly be the central server. Replication occurs between the peers and the preference will be to use the local LAN where possible. Ideally I'd like to see this technique implemented into the Nextcloud desktop agent rather than supporting two different pieces of software.

  5. zephyrus00jp commented on Jul 17, 2020

    @zephyrus00jp

    Hi, I wrote in 2015 at owncloud/client#230

    I am not entirely sure what Dropbox does (especially the communication with its server: it is encrypted using SSL, I think.), but as someone mentioned that there are peer-discovery and communication.
    I found out about it when I checked the LAN activity for UPnP and other low-level lan activity.
    Wireshark is your friend.

    --- That is, Dropbox uses the same underlying protocol used by UPnP to broadcast a request or announce the availability of files and then let the peers to exchange files after a certain negotiations.

    Its payload seems to contain the file list and other information that tells, based on my educated guess,
    with server's PKI signature (to avoid forgery) [that is the client asks for the server to
    create such a list with the server signature], that the client has the
    files (timestamp, checksum) and the authority to hand out the files.

    --- Maybe for the files the particular client has created/updated recently (i.e., has just uploaded to the server. Obviously, this client has the most up-to-date copy of the files.)

    When the other client checks with the server and finds that it needs to download a set of files, it can
    ask the local LAN first to see if other PCs have such files, and when one PC answers yes with the above list (and it is signed with server's key), it can begin copying the file using SSL using a key based on RSA/DH or whatever.
    Of course, there may be a few more version-related information, etc. to make sure
    the server can keep track of what version files were placed into each client with the LAN sync feature
    and that the proper syncing will continue.

    So if you have Dropbox installed on your PCs in your LAN, monitor the LAN traffic with a packet capture tool.
    Create/modify/delete files on one PC or the other, and you will see what I described above.

    I am not claiming Dropbox's method is the best, but it uses an established protocol (RFC) to broadcast the new file/modification and to exchange application-level command/data/response and so owncloud/nextcloud should do something similar.

  6. zephyrus00jp commented on Jul 17, 2020

    @zephyrus00jp

    A concrete algorithm would be.
    When a client creates/modifies (or removes) a file, and this is propagated to the owncloud/nextcloud server after the ordinary processing (transaction-wise), the server issues a notice (signed by server PKI key to avoid forgery) that this client, let's call this Client C (I am not entirely sure how the client is identified uniquely. IP address may not cut it. It is easy to spoof it later on. Maybe a MAC and other PC identification combined. If each client has its own PKI key pair, obviously, that client can be identified by its public key.) has the copy of a file, let's call it file A, and others can copy it instead of copying it from the server.

    Now upon receiving the notice from the server,
    this client C advertises that it has the latest copy of File A by broadcasting the notice on the LAN (this is similar to UPnP).
    Let's pick up another client D on the LAN.
    Client D always listens for such an announcement on the LAN.
    Upon hearing this announcement,

    • client D verifies its authenticity by checking the server PKI sign of the notice,
    • asks client C for a copy of the file
      (a negotiation ensues)
    • copying of the file is done from Client C to Client D.

    (Possible additional step to let Client D also act as the source of the latest copy of File A.)
    Upon the successful completion of the file copy, client D can notify the server
    that it has the latest copy of the file A by sending its check sum etc. (via secure channel.)

    • upon learning that Client D indeed seems to have the latest copy of the file (it can lie but it will be exposed at the end of the copying process with another client since the checksum does not match if client D does not have the authentic copy or corrupt copy.)
      the server can issue another notice that Client D indeed has the latest copy of the file A.
    • Upon receiving the notice from the server Client D broadcast the notice in the LAN.

    Client C, upon hearing the broadcast, checks its file store, and knows that it already has the latest copy (I am not familiar with owncloud/nextcloud internal, but I assume it has some file ID (based on a hash?)/relative-path-to-the-repostiry-root to make it easy for the identification.) ignores it.

    Other clients which may have missed the earlier broadcast from Client C (broadcast is not reliable, you see), can now talk to Client D to initiate the copy process if they don't have the latest copy of file A.

    The broadcast can be repeated at 1, 2, 5, 10 min and thereafter 1 hour apart for a day or something like that.

    That was a push side.

    The pull side would be simply this.
    Currently, owncloud/nextcloud clients can begin downloading files from a server after it learns the server has newer files.
    Upon figuring that, instead of starting the downloading files from the server, the client can initiate the request from a LAN by broadcasting the request:

    • the client sends out the list of files that it needs. (It has learned that it does not have the latest copy after talking to the server.)

    Clients that have such files will respond that they have the latest copy of certain files among the requests.
    What happens afterward is left as an exercise to the reader. The server can ascertain that a client, let's call client E, seems to have such files by checking such a claim by checking the hash of files sent from the client. The requesting client already knows the authentic hash of the requested file, and so at the end of copying, the mismatched check sum means either a corrupted file or bogus claim.
    Anyway, requesting client can pick up the positive response among such responses and begin talking for file transfer.

    It is doable securely. Just fill in the details and we are all done. Famous Last Words.

  7. biva commented on Aug 13, 2020

    @biva
    Author

    Thanks @zephyrus00jp ! In addition, shouldn't we verify the authenticity of the file to be downloaded? (I think NC uses this anyway to verify if 2 files are different or not, I don't remember if it's a hash or something similar).

    @er-vin thanks for the enhancement label: is there any chance that the NC team considers this an interesting feature? Thanks again :)

  8. er-vin commented on Aug 13, 2020

    @er-vin
    Member

    @er-vin thanks for the enhancement label: is there any chance that the NC team considers this an interesting feature? Thanks again :)

    Interesting feature? Definitely yes. But to be honest there are a ton of other features waiting as well and time is limited. Although I like the idea, don't expect something from us any time soon on that one.

  9. biva commented on Aug 13, 2020

    @biva
    Author

    :( I understand time is limited and I respect your job and your choices: you develop Nextcloud and I'm nobody to complain because of your choices as I'm just a user. But how to advocate this topic? Indeed, in my opinion, Nextcloud could consider it as a higher priority because:

    1. It is a project that would have an impact in Africa (and other low-connectivity regions), a place which is not often considered for its specificities in IT projects
    2. It would have a climate change impact, and the IT sector should, as others, do its part (and maybe more than others if we consider the growing impact of IT in the CO2 emissions)
  10. er-vin commented on Aug 13, 2020

    @er-vin
    Member

    Well, I know... your arguments are sound. Still, I won't make empty promises and in all likelihood it'd come after more pressing matters we have.

    Of course, if someone starts working on it I'd be happy to help review.

  11. biva commented on Aug 14, 2020

    @biva
    Author

    Thanks @er-vin :) By curiosity, does it mean that you will bring these arguments in your internal discussions to decide if Nextcloud can make a specific effort for this issue? Thanks again for your consideration.

  12. er-vin commented on Aug 17, 2020

    @er-vin
    Member

    It means the same that I've said before: I like it, currently we don't have the bandwidth for it, we probably won't have the bandwidth for it for a long while.

  13. Railsimulatornet commented on Sep 6, 2020

    @Railsimulatornet

    I really hope that this feature will come, it would save a lot of traffic.

  14. Frizou commented on Sep 20, 2020

    @Frizou

    Nextcloud.com knows LAN Synchronization functionality is missing, see: https://nextcloud.com/fr_FR/compare/

  15. 33 remaining items

  16. pylorak commented on Oct 26, 2023

    @pylorak

    Some ISP-provided modem-router hardware prevent users from doing this as the ISP forces the use of their hardware. NAT reflection/loopback et al tend to be highly lacking on a lot of consumer hardware.

    Also consider that a lot of users cannot access their IPTV if they ditch their ISP-provided modem-router hardware. For some contracts, it's actually going against the agreement to use anything but what they provide in that regard.

    NAT reflection/loopback is a totally separate feature/function which is not required for the solution that I and many others have described (redirecting to the LAN address using a local DNS server). So the lack of this feature in consumer hardware is not a problem and is irrelevant here.

    The only router feature that is beneficial for the proposed solution is the ability to configure the DNS server addresses that are handed out to DHCP-clients. This is supported by almost every router, even by ISP-provided ones. Also, even this feature is optional, because in the extremely rare case where configuring the DNS server addresses is not possible in the router, you can still configure the DNS server address statically on clients, or adjust their hosts files.

  17. HammyHavoc commented on Oct 26, 2023

    @HammyHavoc

    Some ISP-provided modem-router hardware prevent users from doing this as the ISP forces the use of their hardware. NAT reflection/loopback et al tend to be highly lacking on a lot of consumer hardware.
    Also consider that a lot of users cannot access their IPTV if they ditch their ISP-provided modem-router hardware. For some contracts, it's actually going against the agreement to use anything but what they provide in that regard.

    NAT reflection/loopback is a totally separate feature/function which is not required for the solution that I and many others have described (redirecting to the LAN address using a local DNS server). So the lack of this feature in consumer hardware is not a problem and is irrelevant here.

    The only router feature that is beneficial for the proposed solution is the ability to configure the DNS server addresses that are handed out to DHCP-clients. This is supported by almost every router, even in ISP-provided ones. Also, even this feature is optional, because in the extremely rare case where this is not possible, you can still configure the DNS server address statically on clients, or adjust the hosts files.

    Scenario: you run a Nextcloud server for your family members. It's a holiday. They all come over to your house, they're snapping away with photos and video, sharing them with each other, and they bring your WAN to its knees because they haven't got the statically configured settings. Is it fringe? Sure.

  18. pylorak commented on Oct 26, 2023

    @pylorak

    Some ISP-provided modem-router hardware prevent users from doing this as the ISP forces the use of their hardware. NAT reflection/loopback et al tend to be highly lacking on a lot of consumer hardware.
    Also consider that a lot of users cannot access their IPTV if they ditch their ISP-provided modem-router hardware. For some contracts, it's actually going against the agreement to use anything but what they provide in that regard.

    NAT reflection/loopback is a totally separate feature/function which is not required for the solution that I and many others have described (redirecting to the LAN address using a local DNS server). So the lack of this feature in consumer hardware is not a problem and is irrelevant here.
    The only router feature that is beneficial for the proposed solution is the ability to configure the DNS server addresses that are handed out to DHCP-clients. This is supported by almost every router, even in ISP-provided ones. Also, even this feature is optional, because in the extremely rare case where this is not possible, you can still configure the DNS server address statically on clients, or adjust the hosts files.

    Scenario: you run a Nextcloud server for your family members. It's a holiday. They all come over to your house, they're snapping away with photos and video, sharing them with each other, and they bring your WAN to its knees because they haven't got the statically configured settings. Is it fringe? Sure.

    Static client configuration was a last resort in my answer. Realistically, you can configure this in almost every router, including ISP-provided ones.

    Also, what are you arguing about? I didn't say native support for LAN sync in NC isn't needed, I actually said the opposite of that. I was just pointing people to a workaround in the meantime that will work for most private users of NC.

  19. HammyHavoc commented on Oct 26, 2023

    @HammyHavoc

    Some ISP-provided modem-router hardware prevent users from doing this as the ISP forces the use of their hardware. NAT reflection/loopback et al tend to be highly lacking on a lot of consumer hardware.
    Also consider that a lot of users cannot access their IPTV if they ditch their ISP-provided modem-router hardware. For some contracts, it's actually going against the agreement to use anything but what they provide in that regard.

    NAT reflection/loopback is a totally separate feature/function which is not required for the solution that I and many others have described (redirecting to the LAN address using a local DNS server). So the lack of this feature in consumer hardware is not a problem and is irrelevant here.
    The only router feature that is beneficial for the proposed solution is the ability to configure the DNS server addresses that are handed out to DHCP-clients. This is supported by almost every router, even in ISP-provided ones. Also, even this feature is optional, because in the extremely rare case where this is not possible, you can still configure the DNS server address statically on clients, or adjust the hosts files.

    Scenario: you run a Nextcloud server for your family members. It's a holiday. They all come over to your house, they're snapping away with photos and video, sharing them with each other, and they bring your WAN to its knees because they haven't got the statically configured settings. Is it fringe? Sure.

    Static client configuration was a last resort in my answer. Realistically, you can configure this in almost every router, including ISP-provided ones.

    Also, what are you arguing about? I didn't say native support for LAN sync in NC isn't needed, I actually said the opposite of that. I was just pointing users to a workaround in the meantime that will work for 99% of all private users of NC.

    I'm not "arguing" about anything, and whether you support LAN sync or not doesn't negate the suggestions made, which aren't appropriate for a sizeable number of people.

    E.g., https://www.quora.com/Why-dont-ISP-routers-allow-you-to-change-the-DNS/answer/Khairul-Aizat-28

    On some ISP-provided hardware, you must use the ISP-provided DNS. This affects what gets dished out via DHCP in terms of DNS.

  20. sunjam commented on Oct 28, 2023

    @sunjam

    NextCloud could maybe wrap the source of eg syncthing: https://github.com/syncthing/syncthing

    Was already discussed and formally rejected here:

    Do note that Syncthing can already be integrated with Nextcloud folder mounts as described here: nextcloud/server#8384 (comment)
    Also see the discussion on adding delta sync support:

  21. i2h3 commented on May 19, 2026

    @i2h3
    Contributor

    From my point of view this feature is unfeasible to implement in Nextcloud desktop client directly. It appears like third party tools already mentioned are better for this purpose. The Nextcloud desktop client architecture is based completely on the centralized server model. This feature indeed looks nice from the user perspective but technically it might require a full rewrite. 😅

  22. ktuulos commented on May 19, 2026

    @ktuulos

    This is mostly just a matter of will. Dropbox is also based completely on the centralized server model, but dropbox has adopted the content-addressed block idea. There is no reason, why this 4MB content-addressed block mechanism could not be implemented on parallel to current Nextcloud file transfer mechanism.

  23. i2h3 commented on May 19, 2026

    @i2h3
    Contributor

    @ktuulos Then go ahead! 🙂 I am looking forward to your pull request.

  24. oleua commented on Sep 16, 2026

    @oleua

    It is sad... :(

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedfeature: 🔄 sync engineos: 🍎 macOSos: 🚪 Windowsos: 🐧 Linux

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions