Forum Discussion
Original_D_2018
Nimbostratus
Aug 06, 2015iRule to create TPDU header
I have a project to grab the source IP address from a client connection and create a fixed length TPDU header to send to the backend server. I need some help to accomplish this:
These are my beginnin...
VernonWells
Employee
Aug 06, 2015You are heading in the right direction. A few small things right off the bat:
- Generally you don't need to set IP::client_addr, TCP::client_port and TCP::payload to a variable. For Tcl, it is faster not to do so (particularly for the payload);
- You don't need to unset variables. Variables are scoped to the connection (unless they are declared global -- but don't do that -- or in the static:: namespace) so they will be freed when the connection closes.
With those quibbles out of the way: what is the server expecting? Does it want 32-bits (the IP) followed by 16 bits (the port) followed by the original data, or does it want the IP address as text, the literal colon, then the port, as text? Also, should this data be inserted at the start of the TCP stream (that's easy) or with each TCP segment (that's difficult, maybe impossible)?
- Original_D_2018Aug 06, 2015
Nimbostratus
Thanks, 1. The data is expected at the start, in other words it is a header with the original TCP payload as its data 2. It is a protocol but for some reason I have not found its specific rfc/spec except for what I will list below. So I can't say which format the server is expecting the data as yet. I am hoping a TPDU expert can help me. The TPDU messages have the following structure: Bytes 0 - 3The string literal"IP36" Bytes 4 - 5 An operation code Bytes 6 - 29An IPv4 identifier constant "00000000000000000000FFFF" Bytes 30 - 37A representation of an IP address Bytes 38 - 39A representation of a port Balance of available bytesMessage data (Optional) Where the field values are defined as follows: •Operation code: This is used to indicate the type of activity being communicated, for example, a connection has been established to the remote entity. •IP address and port: This is set to the remote address of the source for which the notification is being sent. For example, for a message received, this will contain the remote address of the source entity connected to a SAP from which the message was routed. •Message data: If present, this will generally contain a transactional message received from the source entity. - Original_D_2018Aug 06, 2015
Nimbostratus
Also what is the best event to send the data to the server? And what command/reserve word to use to send the data to the selected server?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects