Prioritize ACK Packets (TCP)

136 views
Skip to first unread message

Tommaso Bonato

unread,
Mar 22, 2023, 3:23:09 PM3/22/23
to ns-3-users
Hello,

I am wondering if there is a relatively simple solutions to have some sort of prioritization for ACK packets compared to "data" packets.
Because as of now, it seems that my ACK packets get stuck in the queue behind all the other data packets and hence they become useless for what I am using them for.
I have made a lot of changes to TCP / NS3 but I don't think I have touched this logic so I think it is not because of one of my changes.

Thanks a lot

BIKASH MAZUMDAR

unread,
Mar 22, 2023, 3:35:44 PM3/22/23
to ns-3-...@googlegroups.com
One option I can think is to maintain two separate queues.. 

In your dqueue method first dequeue from
Ack queue if it is not empty .. once ack queue is empty u can deque from data queue.. or u can choose other logic which is suitable for your solution..

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/e7b526de-d915-4798-a93d-d87933a2adf9n%40googlegroups.com.

Tommaso Pecorella

unread,
Mar 22, 2023, 6:39:30 PM3/22/23
to ns-3-users
Errr... TCP ACKs are not packets, they're a flag in the TCP header. TCP ACKs can not be "stuck" in the TCP queue, simply because they're added to the first data packet being sent.

Perhaps you're talking about application-layer ACKs. In that case you're referring to the "urgent" feature: https://linux.die.net/man/7/tcp

TCP supports urgent data. Urgent data is used to signal the receiver that some important message is part of the data stream and that it should be processed as soon as possible. To send urgent data specify the MSG_OOB option to send(2). When urgent data is received, the kernel sends a SIGURG signal to the process or process group that has been set as the socket "owner" using the SIOCSPGRP or FIOSETOWN ioctls (or the POSIX.1-2001-specified fcntl(2) F_SETOWN operation). When the SO_OOBINLINE socket option is enabled, urgent data is put into the normal data stream (a program can test for its location using the SIOCATMARK ioctl described below), otherwise it can be only received when the MSG_OOB flag is set for recv(2) or recvmsg(2).

Search for "urgent pointer" in TCP for further explanation.

Now, does ns-3's TCP support urgent data? Honestly, I don't think so (perhaps nobody asked for it). Moreover, it's a feature that is not used very often (but it's used in telnet and ssh).

Solution? Use two different sockets. Or don't fill the TCP send buffer.
Reply all
Reply to author
Forward
0 new messages