LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-17-2005, 02:05 PM   #1
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
library for tcp/ip level programming? (C/C++)


hiho@ll

for learning purpose i need a library which is able to implement the TCP/IP protocol

what i want:
a library which uses raw sockets which i can use to send TCP/IP packets (and upper level packets, but that's not the main goal of the library)
i want to define when which packet should be sent
i'm more interessted in the packet flow than of the parts a packet consists of

i know libnet and libpcap but afaik these libs only implement a better API for raw sockets
i have to implement the ip protocol and the tcp protcol by myself
and i don't want to read the RFC for this
i only want to control
"now the TCP Connection ACK" should be sent
or
"send a TCP FIN Request"
such stuff

thx@ll
 
Old 12-17-2005, 04:52 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
AFAIK you have raw sockets and BSD sockets (that's more or less one, but...) and no interface in between. It means that you need to use raw sockets, in your case. The thing is that you want certain parts of the stack,
but not all.

From the things you mentioned, you can emulate them using BSD sockets (FIN after close and so on) and using iptables in a creative way (with passing packets to user space). It looks that's not all you need to do. When you come to IP level, it becomes much more complicated.

Different algorithms come into play. "Send FIN" is not that simple, FIN can look in many different ways depending on the implementation methods, options used and so on.

I don't know what's the purpose, but it looks to me you'll finish using raw sockets and filling the packets yourself.
 
Old 12-18-2005, 04:56 AM   #3
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Original Poster
Rep: Reputation: 30
thx Mara

seems youre right
i'll have a look at some progs which use libnet and the TCP and IP RFC

thx
 
Old 12-18-2005, 02:00 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I have one thing to write to you before you start writing the code: don't be too ambitious. See how much a 'real' TCP/IP stack weights... Make yours as simple as possible.
 
  


Reply



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
which programming language is used to do tcp/ip programming?? gajaykrishnan Linux - Networking 9 12-21-2012 05:16 AM
finding out TCP header details at socket level hari121 Linux - Networking 0 10-25-2005 01:54 AM
what is tcp/ip programming?? gajaykrishnan Programming 24 07-31-2004 04:20 AM
TCP/IP programming assman Programming 3 04-07-2004 11:48 PM
Time stamping TCP packets at the device driver level saintt Linux - Networking 2 12-20-2002 05:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:28 PM.

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