-1

Can Apache Thrift Library modify the headers in a TCP or UDP packet? Please provide your feedback and replies.

mspms
  • 501
  • 1
  • 5
  • 8
  • Can Apache Thrift change the DSCP field of a TCP or UDP packet? – mspms Jul 26 '17 at 10:35
  • What is main goal? – Jacek Cz Jul 26 '17 at 12:46
  • I just want to know if Apache Thrift Library can modify the headers of a UDP or TCP packet? Is it possible? – mspms Jul 26 '17 at 12:48
  • 1
    Tactical advice: If someone asks what the goal ist, he/she does it because he wants to get some more context in order to answer your question better. Poor questions get poor answers. You want good answers? Ask good questions and provide necessary information. Simply repeating the question w/o adding more info will not help you with that. – JensG Jul 29 '17 at 22:26
  • Any news regarding this. @JensG even though i am not the questioner, i need it to pass headers. Is there an update on Thrift, or should i do another question.. – rpajaziti Sep 30 '22 at 15:51
  • 1
    @rpajaziti - codeSF provided a great answer. There's not much I can add here. – JensG Oct 08 '22 at 16:36

1 Answers1

1

Short Answer: No

Long Answer: You can easily add the functionality yourself

Apache Thrift uses transports to perform device I/O. The TSocket transport is used to do TCP I/O (it is the most used transport in my experience, underlying most Thrift RPC apps). TSocket does not however let you set arbitrary L4 headers.

That said, Transports are modular which means you can create your own custom transports and use them with the rest of Apache Thrift easily (no need to write serializers, servers, etc.).

For example, you could fork TSocket and make whatever changes you like and then use it with Thrift. This is not difficult but you would need to modify the TSocket impl for each language you want to use this technique with. Also there is no wide spread UDP transport implementation in Thrift (though again you could generalize TSocket).

codeSF
  • 1,162
  • 9
  • 16
  • So you are saying that we can add the functionality to change the headers of TCP packet ourself. Am i right? – mspms Jul 27 '17 at 05:06
  • So we have to modify the TSocket class to implement the functionality of modifying a TCP header? – mspms Jul 27 '17 at 09:05
  • yes, you can copy TSocket and create a custom transport that modifies headers using socket options or RAW sockets. – codeSF Jul 28 '17 at 05:21