RYU 中如鉤構建TCP數據包,設置ACK等標誌
阿新 • • 發佈:2017-05-29
設置 log spa seq flag eth logs ack bits
e = ethernet.ethernet(dst=_eth.src, src=_eth.dst, ethertype=_eth.ethertype) i = ipv4.ipv4(dst=‘192.168.1.1‘,#_ipv4.src, src=_ipv4.dst, proto=_ipv4.proto, flags=_ipv4.flags ) t = tcp.tcp( dst_port=_tcp.src_port, src_port=_tcp.dst_port, seq=0, ack=1 ) t.bits = t.bits | tcp.TCP_ACK pkt = packet.Packet() pkt.add_protocol(e) pkt.add_protocol(i) pkt.add_protocol(t)
RYU 中如鉤構建TCP數據包,設置ACK等標誌