Giter VIP home page Giter VIP logo

Comments (4)

mgqa34 avatar mgqa34 commented on May 30, 2024

通信量应该可以直接用流量统计的工具进行统计? 比如可以直接用iptables去监控从A机器到B机器的通信端口(默认应该是9370)流量

from fate.

sabakioukenasai avatar sabakioukenasai commented on May 30, 2024

通信量应该可以直接用流量统计的工具进行统计? 比如可以直接用iptables去监控从A机器到B机器的通信端口(默认应该是9370)流量

我采用standalone配置,在1.7.2版本中,FATE启动时会扫描9360和9380端口以保证他们没有被占有,有没有可能就是这两个端口模拟了两个参与方之间的通信呢?或许我只需要测量通过这两个端口之间的流量就可以了?

from fate.

dylan-fan avatar dylan-fan commented on May 30, 2024

standalone 模式,通信没有走grpc,上面两个端口测不到通信流量。如果测试流量的话,用集群模式部署。部署eggroll

from fate.

sabakioukenasai avatar sabakioukenasai commented on May 30, 2024

使用iptables监测host端发送往guest端9370端口的TCP流量。其中 192.168.40.172 是集群部署时 guest 端的ip地址,这条指令会将捕获到的包写入日志文件 /var/log/messages 中,并且在条捕获的流量信息中添加前缀 "Communication for DH PSI_16: "。然后我们构造大小为 2^16 的数据集,上传 dh_intersect 求交任务,即可捕获进行 2^16 大小集合求交时的通信量数据。

sudo iptables -I OUTPUT -p tcp -d 192.168.40.172 --dport 9370 -j LOG --log-prefix "Communication for DH PSI_16: "

捕捉完毕后,使用 awk 统计流量信息。该指令会找到包含了"Communication for DH PSI_16: "的每一行,然后求和len=xxx后的包长度值(以字节为单位),并输出。

grep "Communication for DH PSI_16: " /var/log/messages | awk '{split($0, arr, " "); for(i=1;i<=length(arr);i++) {if (arr[i] ~ /^LEN=/) {split(arr[i], lenArr, "="); sum += lenArr[2]}} } END {print "Total length: " sum}'

测量了dh_intersect的通信量后,采用相同方法测试rsa_intersect的通信量。不过需要先使用 sudo iptables -F OUTPUT 删除现有的过滤规则(可以使用 sudo iptables -L 查看已有过滤规则),再添加新的过滤规则:

sudo iptables -I OUTPUT -p tcp -d 192.168.40.172 --dport 9370 -j LOG --log-prefix "Communication for RSA PSI_16: "

只要每一次测量前删除所有过滤规则,并且每一次测量时日志文件中的前缀彼此不一致,就可以正确测量出通信量。

这里附上我测量的 dh_intersectrsa_intersect 协议在不同数据集上进行求交运算的通信量(MB),根据前面的设置,这里测量的应该是host向guest单向发送的数据量大小。

协议名 2^12 2^14 2^16 2^18
dh_intersect 2.36 9.36 37.27 149.38
rsa_intersect 2.47 9.81 39.15 156.5

from fate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.