LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2015, 11:17 AM   #1
josefelk
LQ Newbie
 
Registered: Jul 2015
Posts: 7

Rep: Reputation: Disabled
Modifying Linux TCP parameters from user-space


Hi everybody,

I want to ask if it's possible to modify a TCP parameter (for example RTO) or to trigger a tcp function (fro example tcp_retransmit_skb()), from user space during a connection; I heard about Netlink sockets, but I don't know how it works, or how to use them.
I'll appreciate any kind of help, and thanks in advance

Youssef
 
Old 08-27-2015, 01:25 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by josefelk View Post
I want to ask if it's possible to modify a TCP parameter (for example RTO) or to trigger a tcp function (fro example tcp_retransmit_skb()), from user space during a connection;
First of all this question, while phrased differently, is remarkably similar to the one in this thread of yours. Please ensure you're not discussing same topic questions in different threads. As for the examples those are real bad ones because 0) while you can sort of set it for a route, RTO is not a TCP parameter but dynamically set based on RTT and 1) triggering tcp_retransmit_skb() is a given on sending traffic. I do get you want to change Live network stream characteristics though. If you can't reach your ultimate goal in one go due to knowledge hiatus, shouldn't you be starting with reading kernel.org networking documentation and relevant RFC's and some simple exercises I wonder?..


Quote:
Originally Posted by josefelk View Post
I heard about Netlink sockets, but I don't know how it works, or how to use them.
If you search for NFQUEUE, libnetfilter and SCAPY you should find the documentation and examples on your own. Else how about telling us what the scope was of your course handling TCP/IP networking, what documentation you've read, in detail what your assignment is, what code you've already produced and more precisely what you're looking for?
 
Old 08-27-2015, 04:33 AM   #3
josefelk
LQ Newbie
 
Registered: Jul 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi,

Thanks for reply @unSpawn, and I'm sorry if dispatched my question like this 'cause I tough that it's a different topic. And I really know how TCP works, and I have an idea about the implementation of Linux TCP.

As you now TCP is waiting for the RTO to retransmit in case of a timeout. And when the remote host is unreachable for a long time (especially in wired-wireless networks), the RTO backoff (doubling the RTO) can lead to a long idle time of TCP, even after the host is reachable again. And this is because TCP relates losses to congestion, and there is now mechanism to distinguish outage from congestion.

The idea I want to try, is a simple ping mechanism that I can trigger in timeout to do less backoff when the host is unreachable (because in my case there is no congestion)

I was thinking about crafting ICMP_ECHO packets inside kernel, but I saw in a lot of forums that it's a bad idea. So what's the best way to send my pings and if this have to be done in user-space how then to modify a variable inside kernel like backoff, or to trigger a kernel function. And correct me in something if I'm wrong.

Thanks in advance, and excuse me for being long
Cheers
 
Old 08-27-2015, 05:39 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by josefelk View Post
there is now mechanism to distinguish outage from congestion.
I didn't knew we could make that distinction at this point of time. Could you please point me to the relevant documentation or RFC?


Quote:
Originally Posted by josefelk View Post
excuse me for being long
Not at all!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying the Linux TCP implementation Sandeep reddy Linux - Newbie 7 08-06-2014 05:44 AM
[SOLVED] Custom TCP Parameters for multiple interfaces in Linux tdallagnol Linux - Newbie 4 02-16-2011 12:18 PM
Disable TCP/IP Stack from user-space kiran_cyberpro Linux - Networking 6 01-03-2009 07:36 AM
TCP Parameters in linux hafizali Linux - Networking 1 05-15-2008 07:26 PM
TCP/IP Parameters in LInux kodumuri_raghu Linux - Networking 3 07-12-2005 01:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration