Not able to detect FIN flag

18 views
Skip to first unread message

Suraj Kota

unread,
Jun 17, 2014, 12:48:52 PM6/17/14
to ns-3-...@googlegroups.com
Hie,
I have written this in ipv4-nix-vector-routing's route output. But, "caught fin packet" is never displayed.

if(p)
{
            TcpHeader tcpHeader;
            p->PeekHeader(tcpHeader);
            uint8_t tcpflags = tcpHeader.GetFlags () & ~(TcpHeader::PSH | TcpHeader::URG);
            if (tcpflags == TcpHeader::FIN)
            {
                std::cout<<"caught fin packet";
            }
}
I have checked the log of Tcpsocketbase also, the connection is being terminated properly.
In routeoutput of nix-vector-routing, How can I detect that the application has finished sending data and is about to close the socket ? Please help me out

Tommaso Pecorella

unread,
Jun 17, 2014, 3:47:19 PM6/17/14
to ns-3-...@googlegroups.com
if (tcpflags & TcpHeader::FIN)

T.

Suraj K

unread,
Jun 18, 2014, 2:10:29 AM6/18/14
to ns-3-...@googlegroups.com
Thankyou Man :) I always go wrong with the simple c++ concepts :D

K SURAJ
Information Technology
National Institute of Technology, Raipur


--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/k3cv46xt6ew/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages