Tcp Flags for 3 way handshake

本文详细介绍了TCP协议中三次握手的过程及意义。通过SYN和ACK标志位的交互,确保了连接建立的可靠性。首次握手发送方设置SYN标志并发送初始化序列号(ISN),接收方以SYN-ACK回应确认序列号加一,最后完成握手通过ACK确认。

TCP Flags For 3 Way Handshake

TCP uses a three-way handshake to establish a reliable connection. The connection is full-duplex, and both sides synchronize (SYN) and acknowledge (ACK) each other. The exchange of these flags is performed in three steps: SYN, SYN-ACK, ACK.

SYN and ACK TCP flags are used for TCP 3 way handshake to establish connections.

  • SYN (Synchronize sequence number). This indicates that the segment
    contains an ISN. During the TCP connection establishment process, TCP
    sends a TCP segment with the SYN flag set. Each TCP peer acknowledges
    the receipt of the SYN flag by treating the SYN flag as if it were a
    single byte of data. The Acknowledgment Number field for the
    acknowledgment of the SYN segment is set to ISN + 1.
  • ACK (Acknowledgment field is significant). This indicates that the
    Acknowledgment field contains the next byte expected on the
    connection. The ACK flag is always set, except for the first segment
    of a TCP connection establishment.

Reference:

10.6.3 Packet Layer 4 Sanity Checks 10.6.3.1 TCP SYN Packet with Data The TCP 3-way connection setup handshake begins with a TCP SYN packet, and is followed by a TCP SYN/ACK reply. If the TCP SYN or SYN/ACK packets contain any additional TCP data beyond the TCP header, this may indicate that the packet is being used for some type of denial-of-service attack. The Bridge engine offers a mechanism to detect TCP SYN and SYN/ACK packets that have associated TCP data, assign a packet command, and to treat the packet as a security breach event. For IPv4, a TCP SYN packet with data is identified if the following is true: (IPv4<IHL>*4 + TCP<Data Offset>*4) < (IPv4<Total Length>) For IPv6, a TCP SYN packet with data is identified if the following is true: (TCP<Data offset>*4) < (IPv6<payload length>) The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command, it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the TCP SYN-with-Data Command, use the <TCP SYN With Data Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2227). 10.6.3.2 TCP Without Full Header A TCP packet without the full TCP header is a potential security threat. A TCP packet is considered without full header if the TCP header size is less than 20 bytes. For fragmented packets it is required that TCP header of the first fragment is at least 20 bytes. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the TCP without Full Header Command, use the <TCP Without Full Header Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2227) accordingly.TCP over MAC Multicast/Broadcast IPv4/6 TCP is a reliable point-to-point L4 protocol, and is not intended to be transported over a MAC Broadcast or Multicast packet. A packet identified as an IPv4/6 TCP packet with a MAC DA a over Broadcast or Multicast address is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command, it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the TCP-over-MC/BC Command, use the <TCP Over MC Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2227). 10.6.3.4 Zero TCP Flags A TCP packet with the flags all set to zero is illegal and is a potential security threat. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command, it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the TCP-Flags-Are-Zero Command, use the <TCP Flages Zero Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2227) accordingly. 10.6.3.5 TCP Flags with FIN-URG-PSH A TCP packet with the TCP FIN, URG, and PSH flags set is illegal and is a potential security threat. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counte Configuration To configure the FINwithURGwithPSH Command, use the <FIN With URG With PSH Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2227) accordingly. 10.6.3.6 TCP Flags with SYN-FIN A TCP packet with the TCP SYN and FIN flags both set is illegal and is a potential security threat. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the SYNwithFIN Command, use the <SYN With FIN Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2228) accordingly. 10.6.3.7 TCP Flags with SYN-RST A TCP packet with the TCP SYN and RST flags both set is illegal and is a potential security threat. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the SYNwithRST Command, use the <TCP SYN With RST Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2228) accordingly. 10.6.3.8 TCP Flags with FIN without ACK A TCP packet with the TCP FIN flag set and ACK flag reset is a potential security threat. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the FINwithoutACK Command, use the <TCP FIN without ACK Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2227) accordingly. 10.6.3.9 Zero TCP/UDP Port A TCP/UDP packet with a zero source or destination port is illegal and is a potential security threat. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the TCPUDPZeroPort Command, use the <TCPUDP Zero Port Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2228) accordingly. 10.6.3.10 Source IP (SIP) is Destination IP (DIP) An IP packet with a source IP address equal to the destination IP address is a potential security threat. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the SIPisDIP Command, use the <SIP is DIP command> field in the Bridge Command Configuration2 Register (Table 324 p. 2226) accordingly TCP/UDP Source Port is Destination Port A TCP/UDP packet with a source L4 port equal to the destination L4 port is a potential security threat. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To configure the SPORTisDPORT Command, use the <TCP/UDP SPORT is DPORT Command> field in the Bridge Command Configuration3 Register (Table 325 p. 2227) accordingly. 10.6.3.12 Fragmented ICMPv4 A fragmented ICMPv4 packet is a potential security threat. The packet is assigned one of the following commands:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned a DROP command it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration To assign the command for fragmented ICMPv4 packets, use the <Fragmented ICMP Command> field in the Bridge Command Configuration1 Register (Table 323 p. 2226) accordingly. ARP MAC SA Mismatch The Address Resolution Protocol (ARP) is defined in RFC 826. ARP packets contain a MAC header followed by the ARP payload data. The ARP payload data contains a field called <source hardware address>. Ethernet ARP packets must have a MAC header SA that matches the ARP payload <source hardware address>. If this is not the case, the packet is suspicious and may be a denial-of-service attack. Per ePort the ARP SA mismatch check for ARP packets can be enabled. If MAC SA mismatch is discovered a global command is applied to the ARP packet. The global command options are:  FORWARD  MIRROR  TRAP  HARD DROP  SOFT DROP If the packet is assigned DROP command, it is considered a security breach event (Section 10.6.5, Bridge Security Breach Events), and it is counted by the Bridge Drop Counter (Section 10.15.1.1, Bridge Drop Counter). Configuration  To configure the global ARP MAC SA Mismatch Command, use the <ARP SA Mismatch Enable> field in the Bridge Global Configuration0 Register (Table 319 p. 2215).To configure the per-ePort ARP MAC SA Mismatch Drop enable, use the <ARP SA Mismatch Command> field in the Bridge Command Configuration0 Register (Table 322 p. 2223) 翻译一下
11-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值