test_1.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:VPP_P4 作者: RuchaMarathe 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号