如何在Windows上模拟networking分区?

在一个实现聚类algorithm的项目上工作。 集群的一个重要属性是在面对networking分区时尊重保证。

为了certificate集群工作,我需要一种方法来在我的Windows开发环境中模拟分区。

在下面的例子中,我将使用term节点,在这个上下文中是一个Tcp侦听器,它启动一个Ip并接受一个端口上的传入连接。 例如在C#中: new TcpListener("10.16.8.9", 12345)

testing用例:N2从N1和N3分区

 Given I have a cluster of 3 nodes running on one NIC with 3 IPs N1 running at 10.16.8.9 N2 running at 10.16.8.10 N3 running at 10.16.8.11 Dev can connect to N1, N2, N3 When A partition occurrences for N2 Then N2 cannot reach N1 and N3 N1 can reach N3 N3 can reach N1 Dev can connect to N1, N2, N3 

插图

在这里输入图像说明

如果我想通过Windows工具阻止/恢复从N2到N2的stream量,我有什么select?