Ack number generated by receiver
Hello everyone,
I'm trying to print out ACK numbers that are generated by the receiver, which are put in ACK packets. I have added "printk" inside the ip_queue_xmit() function, which resides inside the file /net/ipv4/ip_output.c. Here you can see part of code that I've added this print:
if (inet_opt && inet_opt->opt.is_strictroute && rt->rt_uses_gateway)
goto no_route;
/* OK, we know where to send it, allocate and build IP header. */
skb_push(skb, sizeof(struct iphdr) + (inet_opt ? inet_opt->opt.optlen : 0));
skb_reset_network_header(skb);
iph = ip_hdr(skb);
*((__be16 *)iph) = htons((4 << 12) | (5 << 8) | (inet->tos & 0xff));
if (ip_dont_fragment(sk, &rt->dst) && !skb->ignore_df)
iph->frag_off = htons(IP_DF);
else
iph->frag_off = 0;
iph->ttl = ip_select_ttl(inet, &rt->dst);
iph->protocol = sk->sk_protocol;
ip_copy_addrs(iph, fl4);
printk( KERN_ALERT "[IpQueueXmit] src:%i.%i.%i.%i, dst:%i.%i.%i.%i, seq=%lu, ack=%lu, wnd=%d, sack=%d%d%d%d%d%d%d\n",
iph->saddr & 0xFF, (iph->saddr >> 8) & 0xFF, (iph->saddr >> 16) & 0xFF, (iph->saddr >> 24) & 0xFF,
iph->daddr & 0xFF, (iph->daddr >> 8) & 0xFF, (iph->daddr >> 16) & 0xFF, (iph->daddr >> 24) & 0xFF,
th->seq, th->ack_seq, th->window,
(tcb->sacked & TCPCB_SACKED_ACKED),
(tcb->sacked & TCPCB_SACKED_RETRANS),
(tcb->sacked & TCPCB_LOST),
(tcb->sacked & TCPCB_TAGBITS),
(tcb->sacked & TCPCB_REPAIRED),
(tcb->sacked & TCPCB_EVER_RETRANS),
(tcb->sacked & TCPCB_RETRANS) );
Noe I have a simple client-server application. I'm recording this printks on the client side. Here what I see out there:
Dec 16 17:59:12 debian kernel: [ 71.812741] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=598397731, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.812835] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=1408881443, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.813728] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=3690452003, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.813976] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=588567843, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.815431] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=3274364195, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.816066] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2608846115, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.816668] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2475742499, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.817291] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=1677120803, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.820520] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=3958691363, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.820633] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=1667290915, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.820754] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2743981859, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.822583] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=730650659, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.822684] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=331339811, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.823166] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=1125046563, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.823767] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=1935530275, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.824592] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2746013987, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.827362] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=732682787, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.827474] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2736184099, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.827584] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=188209955, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.827672] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2474695459, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.829383] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=727571491, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.830072] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=4090747939, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.831229] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=3142245667, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.831833] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2210520355, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.834096] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=197189155, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.834240] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=3676692259, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.835094] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=1663361059, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.835204] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=864739363, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.837317] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2335826211, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.838943] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=322495011, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.839068] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=999875107, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.839875] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=3281445667, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.840005] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=3958825763, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.841147] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2611012643, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.843652] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=597681443, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.843788] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=4227065123, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.844600] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2613044771, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.844720] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=4217235235, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.844825] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2608129827, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.845212] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2475026211, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.845930] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2337007651, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.848464] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=323676451, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.848585] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2343954723, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.848708] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=2077747491, wnd=60696, sack=0000000
Dec 16 17:59:12 debian kernel: [ 71.849299] [IpQueueXmit] src:172.16.33.128, dst:172.16.33.129, seq=910346536, ack=1939728931, wnd=60696, sack=0000000
I exactly don't know what is wrong with ACK number. It is not increasing constantly, and changes randomly.
Does anybody know what is the problem with this? Am I doing something wrong somwhere?
Thanks!
Categories
- All Categories
- 206 LFX Mentorship
- 206 LFX Mentorship: Linux Kernel
- 732 Linux Foundation IT Professional Programs
- 339 Cloud Engineer IT Professional Program
- 165 Advanced Cloud Engineer IT Professional Program
- 66 DevOps Engineer IT Professional Program
- 131 Cloud Native Developer IT Professional Program
- 119 Express Training Courses
- 119 Express Courses - Discussion Forum
- 5.9K Training Courses
- 40 LFC110 Class Forum - Discontinued
- 66 LFC131 Class Forum
- 39 LFD102 Class Forum
- 219 LFD103 Class Forum
- 16 LFD110 Class Forum
- 32 LFD121 Class Forum
- 17 LFD133 Class Forum
- 6 LFD134 Class Forum
- 17 LFD137 Class Forum
- 70 LFD201 Class Forum
- 3 LFD210 Class Forum
- 2 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 2 LFD237 Class Forum
- 23 LFD254 Class Forum
- 680 LFD259 Class Forum
- 109 LFD272 Class Forum
- 3 LFD272-JP クラス フォーラム
- 10 LFD273 Class Forum
- 91 LFS101 Class Forum
- LFS111 Class Forum
- 2 LFS112 Class Forum
- 1 LFS116 Class Forum
- 3 LFS118 Class Forum
- 2 LFS142 Class Forum
- 3 LFS144 Class Forum
- 3 LFS145 Class Forum
- 1 LFS146 Class Forum
- 2 LFS147 Class Forum
- 8 LFS151 Class Forum
- 1 LFS157 Class Forum
- 10 LFS158 Class Forum
- 4 LFS162 Class Forum
- 1 LFS166 Class Forum
- 3 LFS167 Class Forum
- 1 LFS170 Class Forum
- 1 LFS171 Class Forum
- 2 LFS178 Class Forum
- 2 LFS180 Class Forum
- 1 LFS182 Class Forum
- 4 LFS183 Class Forum
- 30 LFS200 Class Forum
- 737 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 17 LFS203 Class Forum
- 111 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 49 LFS241 Class Forum
- 43 LFS242 Class Forum
- 37 LFS243 Class Forum
- 13 LFS244 Class Forum
- 1 LFS245 Class Forum
- 44 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 143 LFS253 Class Forum
- LFS254 Class Forum
- LFS255 Class Forum
- 6 LFS256 Class Forum
- LFS257 Class Forum
- 1.2K LFS258 Class Forum
- 9 LFS258-JP クラス フォーラム
- 114 LFS260 Class Forum
- 151 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 23 LFS267 Class Forum
- 18 LFS268 Class Forum
- 29 LFS269 Class Forum
- 199 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 2 LFW111 Class Forum
- 257 LFW211 Class Forum
- 176 LFW212 Class Forum
- 12 SKF100 Class Forum
- SKF200 Class Forum
- 791 Hardware
- 199 Drivers
- 68 I/O Devices
- 37 Monitors
- 98 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 85 Storage
- 753 Linux Distributions
- 82 Debian
- 67 Fedora
- 16 Linux Mint
- 13 Mageia
- 23 openSUSE
- 147 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 350 Ubuntu
- 464 Linux System Administration
- 39 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 91 Linux Security
- 78 Network Management
- 101 System Management
- 47 Web Management
- 56 Mobile Computing
- 17 Android
- 28 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 365 Off Topic
- 113 Introductions
- 171 Small Talk
- 20 Study Material
- 522 Programming and Development
- 291 Kernel Development
- 213 Software Development
- 1.1K Software
- 211 Applications
- 180 Command Line
- 3 Compiling/Installing
- 405 Games
- 311 Installation
- 79 All In Program
- 79 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)