关于 python Jabber、Twisted、XMLRPC 和 SCP 的简单问题

发布于 2024-12-04 06:06:30 字数 861 浏览 0 评论 0原文

我对这些协议有一些疑问,仅在网络上搜索很难回答。所以就这样吧。请提前原谅我的无知,我知道这些问题至少有一个会让你感到畏缩。

SCP:SSH文件传输协议能否保证服务器运行时正确的数据到达那里?本质上,如果我用 scp 编写脚本,在收到文件后检查文件的哈希值是多余的吗?

Twisted:我正在与潜在经纪人一起使用 Twisted。这里同样的问题,检查哈希是否多余,如果我进行远程调用并且它返回一个好的值,我可以假设服务器不仅获得了数据,而且获得了正确的数据吗?这是 errbacks 的功能,还是其他错误的功能?我可能会自己用netstat之类的东西测试一下,但是使用PB时会发送很多额外的数据吗?每次调用远程函数时是否都必须通过网络重新发送 Avatar?

Jabber:关于保证也是如此,如果我发送一次并且它返回一个好的值,我是否可以假设服务器不仅收到了数据,而且收到了正确的数据?我见过 jabber 被称为“近实时”。这意味着什么,在一个数量级上,假设所有客户端/服务器都连接良好,预计会出现什么样的延迟。我一直在运行一个使用 jabber 的程序,它对我来说相当糟糕(必须不时重新启动,并不总是在传输后的几个小时内获得数据),这些问题是协议问题,还是代码只是写得不好吗?

XMLRPC:再次提供纠错保证。我用 python 编写了一个 SimpleXMLRPCServer/client 程序,它以每秒 10 个请求的速度崩溃了,这是标准的,还是我只是做得不好?

任何这些问题的答案都会很好,谢谢大家。

编辑:我正在编写一种分析算法,该算法将使用这些方法中的一种或某种组合来移动数据文件。我每秒将收到大量请求,而速度是一个问题。

然而,为此目的获取不正确的数据是不可接受的。我的印象是 TCP 确实保证了您的数据,但是在端点中获取数据是否意味着在磁盘上获取数据是正确的,我不知道。

I have a few questions about these protocols that I am having a really hard time answering just searching the web. So here goes. Please excuse my ignorance in advance, I know at least one of these questions will make you cringe.

SCP: Does the SSH file transfer protocol guarantee the correct data will get there is the server is running? In essence, if I write a script with scp is it redundant to check a hash of the file after I receive it.

Twisted: I am using Twisted with prospective broker. Same question here, is it redundant to check a hash, if I do a remote call and it returns a good value, can I assume the server not only got data, but it got the correct data? Is this the function of errbacks, or are those for other errors? I will probably test this myself with netstat or something, but is a lot of extra data sent when using PB? Does it have to resend the Avatar over the net every time it calls a remote function?

Jabber: Same thing about guarantees, if I do a send and it returns a good value, can I assume the server not only got data, but it got the correct data? I have seen jabber referred to as "near-real-time." What does that mean, on an order of magnitude, what kind of delays would one expect assuming all clients/servers are on a good connection. I have been running a program that uses jabber and it has been rather crappy for me (has to be restarted from time to time, doesn't always get the data within hours of it being transmitted), are these problems with the protocol, or is code simply poorly written?

XMLRPC: Again with the error correction guarantees. I wrote a SimpleXMLRPCServer/client program in python and it crapped out at 10 requests per second, is that standard, or did I just do a bad job?

Answers to any of these questions would be great, thanks guys.

Edit: I am writing an analysis algorithm which is going to be using one, or some combination of these methods to move datafiles. I am going to be getting a good amount of requests per seconds and speed is an issue.

However, getting incorrect data is unacceptable for this purpose. I was unser the impression TCP did guarantee you're data, but whether or not getting the data in an endpoint means getting it correct on disk, I don't know.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

檐上三寸雪 2024-12-11 06:06:30

SCP:SSH文件传输协议能否保证服务器运行时正确的数据到达那里?本质上,如果我用 scp 编写脚本,在收到文件后检查文件的哈希值是否是多余的。

一般来说,保证是一个强词。

TCP 单独努力提供可靠的传送、校验和、确认、序列号、重试意味着不应该有任何未检测到的错误。然而,它不能承受恶意干扰。

在 TCP 之上,SSH/SCP努力提供安全的(主机验证、加密、完整性检查)端到端数据传输,以便始终检测到恶意干扰。然而,这假设您正确使用它,例如主机密钥检查。

这对于大多数用例来说已经足够了。

但是,如果您想要三重确定并可能覆盖极其罕见的未检测到的磁盘错误,请读取文件并使用 sha256sum 等生成安全摘要。


您已经就类似主题发布了很多问题,您担心的是什么?网络级别错误?恶意干扰?


我用 python 编写了一个 SimpleXMLRPCServer/client 程序,它以每秒 10 个请求的速度崩溃了,这是标准的,还是我只是做得不好?

每秒10个有点低。这些是管道式的(一个 TCP 连接)吗?如果没有,您可能会在某个地方达到 SYN 速率限制。将管道性能与每个请求的单独连接进行比较。

SCP: Does the SSH file transfer protocol guarantee the correct data will get there is the server is running? In essence, if I write a script with scp is it redundant to check a hash of the file after I receive it.

Generally, guarantee is a strong word.

TCP alone endeavours to provide reliable delivery, checksums, acknowledgements, sequence numbers, retries together mean that there shouldn't be any undetected errors. It doesn't, however withstand malicious interference.

On top of TCP, SSH/SCP endeavours to provide secure (host authenticated, encrypted, integrity checked) end to end transmission of data, so that malicious interference is always detected. However, this assumes that you use it correctly, e.g. host key checking.

This is good enough for most use cases.

However, if you want to be triply-sure and to perhaps cover for extremely rare undetected disk errors, read the files and generate secure digests with e.g. sha256sum.


You have posted many questions on a similar theme, what is it that you are worried about? Network level errors? Malicious interference?


I wrote a SimpleXMLRPCServer/client program in python and it crapped out at 10 requests per second, is that standard, or did I just do a bad job?

10 per second is a bit low. Are these pipelined (one TCP connection)? If not, you could be hitting a SYN ratelimit somewhere. Compare pipelined performance to separate connections per request.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文