def test_multicast_rpf(a, port_interface_mapping, exp_src_mac, exp_dst_mac):
fwd_pkt1 = Ether() / IP(src='10.1.0.3', dst='224.1.0.1') / TCP(sport=5793, dport=80)
fwd_pkt2 = Ether() / IP(src='10.1.0.5', dst='224.1.0.1') / TCP(sport=5793, dport=80)
exp_pkt1 = (Ether(src=exp_src_mac) /
IP(src='10.1.0.3', dst='224.1.0.1', ttl=fwd_pkt1[IP].ttl-1) / TCP(sport=5793, dport=80))
exp_pkt2 = (Ether(src=exp_src_mac) /
IP(src='10.1.0.5',dst='224.1.0.1', ttl=fwd_pkt2[IP].ttl-1) / TCP(sport=5793, dport=80))
# The ports 1 nad 0 are exchanged to check that the rpf and ingress port are different ,
# thus dropping the packets
pack = send_pkts_and_capture(port_interface_mapping, [{'port': 1, 'packet': fwd_pkt1},
{'port': 0, 'packet': fwd_pkt2}])
input_ports = {0, 1}
output = create_port_seq_list([], pack, input_ports)
return output
评论列表
文章目录