Official eMule-Board: Ip Packet Fragmentation In Search Responses - Official eMule-Board

Jump to content


Page 1 of 1

Ip Packet Fragmentation In Search Responses

#1 User is offline   netfinity 

  • Master of WARP
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1658
  • Joined: 23-April 04

Posted 05 May 2006 - 05:16 PM

When doing a search for a popular keyword, you will naturaly get a lot results. In order to avoid fragmentation eMule limits the number of results to 50 in each response packet. If there is more results, those will be sent in separate packets.

Now it turns out that if the search returns file descriptions, we may easily end up with fragmented IP packets. This is because a file description result is around 100 bytes (estimated with ethereal traces) each and 50 of them gives around 5 kB of data. With a compression of 30 - 50 % (estimated with ethereal traces) this gives us a packet size of 2500 - 3500 bytes wich is greater than the MTU size of 1500 bytes. Result is that each packet containing file description results will be split in atleast two IP packets.

My suggestion is that instead of using a fixed limit of 50 results, force a send when the bytes in the packet exceed the MTU when a 40% compression ratio assumed.

Eg.
...
uint32 uLen = sizeof(byPacket)-byIO.GetAvailable();
if (uLen + 100 > 2500)
{
    ...
    CKademlia::GetUDPListener()->SendPacket(byPacket, uLen, uIP, uPort);
    ...
}
...


/netfinity
eMule v0.50a [NetF WARP v0.3a]
- Compiled for 32 and 64 bit Windows versions
- Optimized for fast (100Mbit/s) Internet connections
- Faster file completion via Dynamic Block Requests and dropping of stalling sources
- Faster searching via KAD with equal or reduced overhead
- Less GUI lockups through multi-threaded disk IO operations
- VIP "Payback" queue
- Fakealyzer (helps you chosing the right files)
- Quality Of Service to keep eMule from disturbing VoIP and other important applications (Vista/7/8 only!)
0

#2 User is offline   elboiler 

  • Member
  • PipPip
  • Group: Members
  • Posts: 40
  • Joined: 03-August 04

Posted 29 July 2006 - 12:15 AM

Hi! I just would like to say that packet fragmentation in Kad searches is true. So I searched here and found this topic.

I use Jetico as firewall. It has a rule which "deny (denies) all fragmented packets". This rule makes kad searches results almost to zero. Disabling that rule in Jetico, kad searches are great and very fast.
Jetico can log every time that a fragmented packet is received... if you need more information (log entries), just ask.

So... ehm... I'm not a skilled programmer, sorry I can't really help you... just want to say that you may take care of that issue and try to solve it in next eMule version, please. Could be Netfinity's suggestion a good one?

Thanks :flowers:
Bye

This post has been edited by elboiler: 29 July 2006 - 12:16 AM

0

#3 User is offline   Kry 

  • No Support
  • PipPipPipPipPipPipPip
  • Group: Member_D
  • Posts: 2018
  • Joined: 27-June 03

Posted 29 July 2006 - 12:50 AM

Sorry to say it, but denying fragmented packets is so wrong. SO wrong.
Retired aMule developer.
Minister of Strange Operative Systems and Sarcasm (S.O.S & S) in President Birk's New World Order
0

#4 User is offline   Haos 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 30-March 06

Posted 29 July 2006 - 12:57 PM

As i know Jetico, nothing s there without the purpose. Possibly some exploit based on packet fragmentation.
Visit www.reactos.org - Opensource Operating System project,
desgined to be 100% compatible with Win 2000/XP

ReactOS Project - Tester and Polish translation team member


Now LowID to LowID connections are possible thanks to the first NAT & FireWall Traversal mod: NeoMule.


Polish Pirate Party:
0

#5 User is offline   Enig123 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 553
  • Joined: 22-November 04

Posted 29 July 2006 - 01:11 PM

Look'n'Stop also blocked many fragmented UDP packets when kad is on. Is it possible to do something on emule side to avoid generating fragmented packets?
0

#6 User is offline   DavidXanatos 

  • Neo Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1469
  • Joined: 23-April 04

Posted 29 July 2006 - 03:30 PM

For what reason do firewalls blcok fragmented packets, where is the danger in such?

David
NeoLoader is a new file sharing client, supporting ed2k/eMule, Bittorent and one click hosters,
it is the first client to be able to download form multiple networks the same file.
NL provides the first fully decentralized scalable torrent and DDL keyword search,
it implements an own novel anonymous file sharing network, providing anonymity and deniability to its users,
as well as many other new features.
It is written in C++ with Qt and is available for Windows, Linux and MacOS.
0

#7 User is offline   netfinity 

  • Master of WARP
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1658
  • Joined: 23-April 04

Posted 29 July 2006 - 04:00 PM

Most probably the firewall blocks them because it has to keep track of what fragments are linked as there is no UDP or TCP header in the fragmented packets which is needed to route the packets properly if it's a NAT.

Possibly, you could make a DOS attack by generating a lot of fake fragments that the receiver has to queue til all fragments of the packet has been received which never happen's as the bad guy had made sure of that.

/netfinity
eMule v0.50a [NetF WARP v0.3a]
- Compiled for 32 and 64 bit Windows versions
- Optimized for fast (100Mbit/s) Internet connections
- Faster file completion via Dynamic Block Requests and dropping of stalling sources
- Faster searching via KAD with equal or reduced overhead
- Less GUI lockups through multi-threaded disk IO operations
- VIP "Payback" queue
- Fakealyzer (helps you chosing the right files)
- Quality Of Service to keep eMule from disturbing VoIP and other important applications (Vista/7/8 only!)
0

#8 User is offline   Haos 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 30-March 06

Posted 29 July 2006 - 05:24 PM

I dunno if that`s the problem, but somewhere i heard about the exploit to craft a packet looking like a harmless one (possibly fragmented) to make it bypass the firewalls. It is as a info return channel from a trojan client.
Visit www.reactos.org - Opensource Operating System project,
desgined to be 100% compatible with Win 2000/XP

ReactOS Project - Tester and Polish translation team member


Now LowID to LowID connections are possible thanks to the first NAT & FireWall Traversal mod: NeoMule.


Polish Pirate Party:
0

#9 User is offline   leuk_he 

  • MorphXT team.
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5975
  • Joined: 11-August 04

Posted 13 August 2006 - 09:35 PM

Just google for fragmented udp and you understand why some choose to block it:

http://www.security....ocument397.html

and the teardrop DOS attack is alos based on fragmented (udp) packets.

It is just not good idea to block ALL fragmented udp packets as those firewalls do.
Download the MorphXT emule mod here: eMule Morph mod

Trouble connecting to a server? Use kad and /or refresh your server list
Strange search results? Check for fake servers! Or download morph, enable obfuscated server required, and far less fake server seen.

Looking for morphXT translators. If you want to translate the morph strings please come here (you only need to be able to write, no coding required. ) Covered now: cn,pt(br),it,es_t,fr.,pl Update needed:de,nl
-Morph FAQ [English wiki]--Het grote emule topic deel 13 [Nederlands]
if you want to send a message i will tell you to open op a topic in the forum. Other forum lurkers might be helped as well.
0

#10 User is offline   netfinity 

  • Master of WARP
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1658
  • Joined: 23-April 04

Posted 13 August 2006 - 10:18 PM

Could be that simple that some NATs just don't have the necessary code to route fragmented packets. In order for a NAT to route a packet it doesn't just need the IP address but also the destination port number. This port number is in the TCP/UDP header which is only present in the first fragment, so if the NAT doesn't keep track of fragment headers it will only be able to route the first fragment but not the remainder.

This is cheap but normally fragmented packets are uncommon and might have been considered neglectable.

/netfinity
eMule v0.50a [NetF WARP v0.3a]
- Compiled for 32 and 64 bit Windows versions
- Optimized for fast (100Mbit/s) Internet connections
- Faster file completion via Dynamic Block Requests and dropping of stalling sources
- Faster searching via KAD with equal or reduced overhead
- Less GUI lockups through multi-threaded disk IO operations
- VIP "Payback" queue
- Fakealyzer (helps you chosing the right files)
- Quality Of Service to keep eMule from disturbing VoIP and other important applications (Vista/7/8 only!)
0

#11 User is offline   kubba 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 13-February 06

Posted 20 August 2006 - 02:15 PM

any statefull firewall/nat can cope with fragmented packets, droping any suspicious traffic.
0

#12 User is offline   LorenzoC 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2478
  • Joined: 05-September 04

Posted 20 August 2006 - 08:49 PM

Jetico PF log (by default the rule is set on "reject", this is "accept"):
You can see the data splitted in 3 packets.
-----------------------------------------
20/08/2006 22:17:48.500 accept Allow All Fragmented Packets 1500 UDP incoming packet xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 4672 5072 TTL: 118; TOS: 0; ID: B933; Frag offset: 0
20/08/2006 22:17:48.510 accept Allow All Fragmented Packets 1500 UDP incoming packet xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx TTL: 118; TOS: 0; ID: B933; Frag offset: 185
20/08/2006 22:17:48.510 accept Allow All Fragmented Packets 466 UDP incoming packet xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx TTL: 118; TOS: 0; ID: B933; Frag offset: 370 (last)
------------------------------------------
This happens when you make a search that gets many results with long description (es. "britney"), as said by Netfinity. I don't know how I could make a restrictive rule to allow emule only since the information about the KAD port is includes only in the first packet. There are the remote and local IPs but It is not useful for emule.

This post has been edited by LorenzoC: 20 August 2006 - 08:51 PM

0

#13 User is offline   Haos 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 30-March 06

Posted 21 August 2006 - 03:13 PM

Jetico solves application rules before system rules, so if you`ll make an app rule, allowing fragmented packets in a ruleset directory, then forward only emule traffic (from Ask user directory) to this rule directory, it should be restrictive enough as well as allow fragmented packets to emule client.

It should work, but i`d have to check it to be sure...
Visit www.reactos.org - Opensource Operating System project,
desgined to be 100% compatible with Win 2000/XP

ReactOS Project - Tester and Polish translation team member


Now LowID to LowID connections are possible thanks to the first NAT & FireWall Traversal mod: NeoMule.


Polish Pirate Party:
0

#14 User is offline   LorenzoC 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2478
  • Joined: 05-September 04

Posted 21 August 2006 - 05:57 PM

I've studied Jetico for a while but I don't understand how to make it.
Application rules don't tell anything about fragments, so I can't connect "emule" to fragments.

It must be a System IP rule and they are allowed only inside the System IP Table. Then I can't connect Emule to fragments either, the IP could work but Emule needs "any - any". The port works only for the first fragment.

Now I've created a new IP rule in the System IP Table above the standard "reject" rule
That allowes UDP fragments, while the reject rule denies any protocol.

This post has been edited by LorenzoC: 21 August 2006 - 06:09 PM

0

#15 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 23 September 2008 - 09:03 AM

I want to push this topic. :flowers:

Implementing such a workaround isn't much work but will help a lot of users who don't know why they aren't getting any search results off KAD and are instead posting here.
0

#16 User is offline   CiccioBastardo 

  • Doomsday Executor
  • PipPipPipPipPipPipPip
  • Group: Italian Moderators
  • Posts: 5541
  • Joined: 22-November 03

Posted 25 September 2008 - 07:23 PM

Those fragmetned packets, however, use all the available payload, do they are more efficient than guessing the packet size. Which could still be wrong and bring to a fragmented packet.
The problem is not the client, it's the user
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users