cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
AxisTcp.hpp File Reference

: A class to access TCP header fields within data chunks transmitted over an AXI4-Stream interface. More...

#include "AxisRaw.hpp"
Include dependency graph for AxisTcp.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AxisTcp
 

Macros

#define TCP_HEADER_LEN   20
 
#define TCP_OPT_KIND_EOL   0
 
#define TCP_OPT_KIND_NOP   1
 
#define TCP_OPT_KIND_MSS   2
 
#define TCP_OPT_KIND_WSS   3
 
#define TCP_OPT_KIND_SACK   4
 

Typedefs

typedef ap_uint< 16 > LE_TcpSrcPort
 
typedef ap_uint< 16 > LE_TcpDstPort
 
typedef ap_uint< 16 > LE_TcpPort
 
typedef ap_uint< 32 > LE_TcpSeqNum
 
typedef ap_uint< 32 > LE_TcpAckNum
 
typedef ap_uint< 3 > LE_TcpResBits
 
typedef ap_uint< 4 > LE_TcpDataOff
 
typedef ap_uint< 6 > LE_TcpCtrlBits
 
typedef ap_uint< 16 > LE_TcpWindow
 
typedef ap_uint< 16 > LE_TcpChecksum
 
typedef ap_uint< 16 > LE_TcpUrgPtr
 
typedef ap_uint< 64 > LE_TcpData
 
typedef ap_uint< 16 > TcpSrcPort
 
typedef ap_uint< 16 > TcpDstPort
 
typedef ap_uint< 16 > TcpPort
 
typedef ap_uint< 32 > TcpSeqNum
 
typedef ap_uint< 32 > TcpAckNum
 
typedef ap_uint< 3 > TcpResBits
 
typedef ap_uint< 4 > TcpDataOff
 
typedef ap_uint< 6 > TcpCtrlBits
 
typedef ap_uint< 1 > TcpCtrlBit
 
typedef ap_uint< 16 > TcpWindow
 
typedef ap_uint< 16 > TcpChecksum
 
typedef ap_uint< 16 > TcpCsum
 
typedef ap_uint< 16 > TcpUrgPtr
 
typedef ap_uint< 8 > TcpOptKind
 
typedef ap_uint< 8 > TcpOptLen
 
typedef ap_uint< 16 > TcpOptMss
 
typedef ap_uint< 16 > TcpSegLen
 
typedef ap_uint< 8 > TcpHdrLen
 
typedef ap_uint< 16 > TcpDatLen
 

Detailed Description

: A class to access TCP header fields within data chunks transmitted over an AXI4-Stream interface.

Copyright 2016 – 2021 IBM Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

System: : cloudFPGA Component : Shell, Network Transport Stack (NTS) Language : Vivado HLS


: The Transmission Control Protocol (TCP) fields defined in this class refer to the format generated by the 10GbE MAC of Xilinx which organizes its two 64-bit Rx and Tx interfaces into 8 lanes (see PG157). The result of this division into lanes, is that the TCP fields end up being stored in LITTLE-ENDIAN order instead of the initial big-endian order used to transmit bytes over the physical media. As an example, assume that the 16 bits of the TCP "SourcePort" has a value of '0xABCD'. This field will be transmitted on the media in big-endian order .i.e, a '0xAB' byte followed by a '0xCD' byte. However, this field will ends up being ordered in little-endian mode (.i.e, 0xCDAB) by the AXI4-Stream interface of the 10GbE MAC.

Warning
: This class is to be used when an TCP segment is aligned to a 64-bit quadword. Refer to the methods of 'AxisIp4.hpp' to access the fields of a TCP segment that is embedded into an IPv4 packet, or the the methods of 'AxisEth.hpp' to access the fields of a TCP segment that is embedded into an IPv4 packet further embedded into an Ethernet frame.

@info : The format of a TCP segment transferred over an AXI4-Stream interface of quadwords is done in LITTLE-ENDIAN and is mapped as follows:

   6                   5                   4                   3                   2                   1                   0

3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | Destination Port | Source Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |C|E|U|A|P|R|S|F| Data | |N| | | Window |W|C|R|C|S|S|Y|I| Offset| Res |S| Acknowledgment Number | | |R|E|G|K|H|T|N|N| | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data (or Options, if DataOffset>5) | Urgent Pointer | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Definition in file AxisTcp.hpp.