from where to start hacking tcp/ip protocol source..

from where to start hacking tcp/ip protocol source..

Post by praka » Thu, 19 Jul 2001 16:21:35



Hello,
I am writing a stack on top of tcp/ip. I want to write an interface
between my stack and tcp/ip. So in order to do that, firstly, I am
thinking to hack the tcp/ip source code of linux kernel 2.4.0. Can
anybody suggest me from where to start the hacking , and how the flow
goes. FYI I read the tcp/ip section of the book Internetworking with
TCP/IP by Douglos Comer & Stevens Vol I & II.
If anybody gives the suggestion regarding how to write the interface
it will be a pleasure.
Thanks & Regards.
Prakash
 
 
 

from where to start hacking tcp/ip protocol source..

Post by phil-news-nos.. » Thu, 19 Jul 2001 23:22:28



| Hello,
| I am writing a stack on top of tcp/ip. I want to write an interface
| between my stack and tcp/ip. So in order to do that, firstly, I am
| thinking to hack the tcp/ip source code of linux kernel 2.4.0. Can
| anybody suggest me from where to start the hacking , and how the flow
| goes. FYI I read the tcp/ip section of the book Internetworking with
| TCP/IP by Douglos Comer & Stevens Vol I & II.
| If anybody gives the suggestion regarding how to write the interface
| it will be a pleasure.
| Thanks & Regards.
| Prakash

Why not write it as a library.  If your protocol uses TCP connections
and/or UDP datagrams, then your library can create connection objects
to keep state and a set of functions/methods to implement the protocol
actions/messages/responses.  Applications that need to use your new
protocol can then use the library API to carry it out in an easy to
implement way.

--
-----------------------------------------------------------------
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |

-----------------------------------------------------------------

 
 
 

from where to start hacking tcp/ip protocol source..

Post by praka » Fri, 20 Jul 2001 16:03:24




> | Hello,
> | I am writing a stack on top of tcp/ip. I want to write an interface
> | between my stack and tcp/ip. So in order to do that, firstly, I am
> | thinking to hack the tcp/ip source code of linux kernel 2.4.0. Can
> | anybody suggest me from where to start the hacking , and how the flow
> | goes. FYI I read the tcp/ip section of the book Internetworking with
> | TCP/IP by Douglos Comer & Stevens Vol I & II.
> | If anybody gives the suggestion regarding how to write the interface
> | it will be a pleasure.
> | Thanks & Regards.
> | Prakash

> Why not write it as a library.  If your protocol uses TCP connections
> and/or UDP datagrams, then your library can create connection objects
> to keep state and a set of functions/methods to implement the protocol
> actions/messages/responses.  Applications that need to use your new
> protocol can then use the library API to carry it out in an easy to
> implement way.

Thanx for the reply & the suggestion. I can do as you told. But I want
to explore the tcp/ip source code. That's why I put the question as in
the subject. I just want a start to hack the kernel code.
Thanx & Regards.
Prakash.
 
 
 

1. TCP, UDP protocols vs. Unix domain protocols

Glancing through the current BSD sources the data goes through TCP (or UDP)
then through IP before it's detected that it's really for the local host.
Then the packet makes its way back up through IP and TCP.

There are two ways to send it to the local host: to the special IP address
configured for the loopback interface (normally 127.0.0.1) in which case
IP just sends it to that driver.  The loopback driver output routine just
puts the packet onto IP's input queue.  The other way is to send it to
your actual IP address.  In this case it looks like the packet makes it
into the ARP code [arpresolve()] where it's detected that the packet is for
the local host.  There's a flag here "useloopback" that default's to 1.
If this flag is true, the packet is just sent to the loopback driver
(same as for 127.0.0.1).  If the flag is false, however, the packet is
actually put onto the wire.  The comment in the code says that some
boards can't receive packets that they send, which is why it defaults
to 1.  But, someone at Xerox told me last week that this is really
false, and if the board can't receive its own transmissions then either
the board or the driver is broken.  (I don't know how true this is.)
If your kernel defines the variable "useloopback" check what its value
is, and try setting it to 0 and see what happens :-)

So the bottom line is that using TCP causes the packet to go through
TCP and IP, whereas a Unix domain stream socket avoids this.  As to
how much you save by using the Unix domain socket, I've never measured
this.

Realize that other implementations may do things completely differently.


2. Can't get BOCA2016 running

3. TCP/IP-Protocol Printer ?

4. time zone

5. What is TCP/IP Ident Protocol Server ?

6. LInux Sound Driver and .WAV files

7. tcp/ip protocol stack

8. Something wrong with make

9. Sockets over non-TCP/IP protocols

10. 3c509 and/or tcp/ip protocol in a fast network

11. Will Linux Connect to a Windows 98 WorkGroup using a TCP/IP Protocol?

12. Q: UNIX and the DirectPlay TCP/IP Protocol

13. how to insert protocol between ip layer and tcp layer