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_2018
Nimbostratus
Aug 06, 2015Also 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