<div dir="ltr"><div><div><div><div><div>You are right! I want to pretend that a connection is open.<br></div>I've done this: <br><br>def send_tcp(seqNum, srcMAC, dstMAC,srcIP,dstIP,srcPort,dstPort,inport):<br> tcp_packet = tcp()<br>
tcp_packet.srcport = dstPort<br> tcp_packet.dstport = srcPort<br> tcp_packet.len = tcp.MIN_LEN+20 <br> tcp_packet.win=1<br> tcp_packet._setflag(tcp_packet.SYN_flag,1)<br> tcp_packet._setflag(tcp_packet.ACK_flag,1)<br>
tcp_packet.seq=0<br> tcp_packet.ack=1<br> ipv4_packet = ipv4()<br> ipv4_packet.iplen = ipv4.MIN_LEN + tcp_packet.len<br> ipv4_packet.protocol = ipv4.TCP_PROTOCOL<br> ipv4_packet.dstip = IPAddr(dstIP)<br> ipv4_packet.srcip = IPAddr(srcIP)<br>
ipv4_packet.set_payload(tcp_packet)<br> eth_packet = ethernet()<br> eth_packet.set_payload(ipv4_packet)<br> eth_packet.src = srcMAC #MAC Controller<br> eth_packet.dst = dstMAC<br> eth_packet.type = ethernet.IP_TYPE<br>
msg = of.ofp_packet_out(data = eth_packet)<br> msg.actions.append(of.ofp_action_output(port = inport))<br> for connection in core.openflow.connections:<br> connection.send(msg)<br><br></div>Here the controller aswers to a SYN packet with a SYN/ACK packet via packet_out. But I still have a problem...<br>
</div>I've done a wireshark capture and in the information about this packet it tells me: <br><br> Packet Out (CSM) (78B) => 45506 > 5001 [SYN, ACK] Seq=0 Ack=0 Win=1, bogus TCP header length (0, must be at least 20)<br>
<br></div>wich fields I'm forgetting to set? And why, if I setted ack=1 it is 0?<br><br></div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/25 Murphy McCauley <span dir="ltr"><<a href="mailto:murphy.mccauley@gmail.com" target="_blank">murphy.mccauley@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The .win attribute of the TCP class should be an integer, and it's just put into the 16-bit window field verbatim. IIRC, in the absence of window scaling, this is just the number of bytes (beyond whatever is being ACKed) that you're willing to receive. (If you're just trying to get a client to think a connection is open, I think you can probably just set it to 1 -- 0 may not be a good idea.)<br>
<br>
I'd check the RFC or a good TCP reference for additional information. Or just try it. :)<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Murphy<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Nov 25, 2013, at 12:38 AM, Silvia Fichera <<a href="mailto:fichera.sil@gmail.com">fichera.sil@gmail.com</a>> wrote:<br>
<br>
> Hi all,<br>
> I would like send a TCP - SYN/ACK packet from the controller to one host.<br>
> I already know how to buid UDP packet and send it in flooding, so I think I can follow the same way with TCP fields.<br>
> I need to set a minimal congestion window as I can receive only the ACK. Is it measured in bit? How much should be the right dimension?<br>
><br>
> Thanks<br>
><br>
> --<br>
> Silvia Fichera<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Silvia Fichera
</div>