Skip to contentSkip to conversation

NAT for DirectConnect (NeoModus P2P protocol)

DISCUSSION [email protected] 2 participants 4 messages Sep 7, 2003 – Sep 15, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

I tried to write a conntrack and nat modules for DirectConnect protocol. I have a slight problem with this though - DirectConnect uses both UDP (for search results) and TCP (for uploads/downloads). I took irc modules as an example and I got TCP connections working correctly. However with UDP only first returned search result gets past the router. I browsed the mailing list archive and only post related to this was about how the expectations work stating that only a single expectation is awaited.

Is there a way to work around this?

They way DirectConnect performs search:
IP --> SIP (search request on master TCP connection) IP <-- IP1 (search results from client 1 {UDP packet}) IP <-- IP2 (search results from client 2)
... and so on ...

Currently my code gets the first search result just fine, however further results do not drop into the module and thus do not get NATted.

If anyone has an idea, I would appreciate that. Besides, I wonder why hasnt anyone written the modules for DirectConnect already...it is becoming widely used P2P file sharing protocol lately.

Thanks in advance,
Jekabs

P.S. I am not subscribed to the list, could you please send response
directly to this mail?
http://games.inbox.lv - 1000s of FREE on-line games. Dress Up Doll, 3D Chess, Tetris, Mario, Car Racer, Pool and many more!

#1 lore raw
Quoted 1 line · On Sun, Sep 07, 2003 at 04:04:49AM +0300, [email protected] wrote:

I tried to write a conntrack and nat modules for DirectConnect protocol.

great.

Quoted 8 lines

I have a slight problem with this though - DirectConnect uses both UDP (for search results) and TCP (for uploads/downloads). I took irc modules as an example and I got TCP connections working correctly. However with UDP only first returned search result gets past the router. I browsed the mailing list archive and only post related to this was about how the expectations work stating that only a single expectation is awaited.

Is there a way to work around this?

There is another helper in patch-o-matic that does exactly the same thing. IIRC, it was the talk helper.

Quoted 8 lines

They way DirectConnect performs search:
IP --> SIP (search request on master TCP connection) IP <-- IP1 (search results from client 1 {UDP packet}) IP <-- IP2 (search results from client 2)
... and so on ...

Currently my code gets the first search result just fine, however further results do not drop into the module and thus do not get NATted.

so what you do is: You register an expectfn (which gets called when your expected connection gets established). Inside the expectfn, you re-add the expectation by calling ip_conntrack_expect_related().

Quoted 3 lines

Besides, I wonder why hasnt anyone written the modules for DirectConnect already...it is becoming widely used P2P file sharing protocol lately.

Well, I haven't even heared about it [since I'm not doing any p2p networking]. Is it free? Is there a free software implementation? Is there a free specification of the protocol?

Quoted 4 lines

Jekabs

P.S. I am not subscribed to the list, could you please send response directly to this mail?

sure.

please keep us posted about your progress with the helper!

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie
#2 lore raw

I have 2.4.21 kernel, but POM only has patches for 2.4.20.

I looked at the POM for 2.4.20 and the API for most conntract function is different from what I have in my 2.4.21 source tree which I downloaded from ftp.kernel.org.

Should I revert to 2.4.20 kernel and apply POM on top of that before continuing my efforts to make the subj! kernel modules?

Please respond to this email, as I am not subscribed to netfilter mailing list.

Thanks in advance,
Jekabs
http://games.inbox.lv - 1000s of FREE on-line games. Dress Up Doll, 3D Chess, Tetris, Mario, Car Racer, Pool and many more!

#3 lore raw
Quoted 5 lines · On Sun, Sep 14, 2003 at 02:41:36AM +0300, [email protected] wrote:

I have 2.4.21 kernel, but POM only has patches for 2.4.20.

I looked at the POM for 2.4.20 and the API for most conntract function is different from what I have in my 2.4.21 source tree which I downloaded from ftp.kernel.org.

? The API of the code in netfilter CVS (netfilter/patch-o-matic/{submitted,pending,base,extra}) is not any

Quoted 2 lines

Should I revert to 2.4.20 kernel and apply POM on top of that before continuing my efforts to make the subj! kernel modules?

no. Use a recent kernel (2.4.21 or 2.4.22) and apply patch-o-matic 'submitted' repository from CVS.

Quoted 2 lines

Thanks in advance,
Jekabs

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie