Skip to content

GSD

Sections
Personal tools
You are here: Home » Members » jop's Home » SSFNet Patches

SSFNet Patches for Group Communication and P2P

Document Actions

This is a collection of patches to SSFNet 1.5 developed while simulating group communication and peer-to-peer application level protocols. They should apply cleanly also to version 2.0. I make them available in the hope that someone else finds them useful. Note that these patches are not in any way endorsed by the authors of SSFNet and may introduce serious bugs. Please be careful.

Safe

The patches in this collection are very simple and have been reasonably well tested. Existing code should be unaffected:

  • sockapi.diff - Adds recvfrom() and sendto() to the socket API, allowing UDP sockets to be used unconnected. This enables simulation of more realistic UDP-based protocols and applications.
  • bcast.diff - Implements IP broadcast in LAN links using address 0xffff. Unconnected socket API patches are likely to be necessary to make use of this.
  • tcpleakfix.diff - Removes references to free segments in the TCP receive window. This will result in a reduction of memory used by simulations with a large number of mostly idle TCP connections.

Unsafe

tcpsmallpkts.diff changes the semantics of the write() call on TCP sockets, making it block only if there isn't enough local buffer space. Originally, a call to write() blocks until all data has been transmitted and acknowledged, regardless of buffer availability. The original semantics is OK for bulk transfers, but it isn't good enough for many application level protocols based on TCP which exchange small packets. The implementations faces two different problems:

  • When writing simulated bytes with attached objects, multiple objects will be allowed in transit simultaneously and have to be managed. This is not trivial, as each object should be delivered only with the corresponding amount of bytes.
  • It should be possible that bytes in different calls to write() are coalesced into a single TCP segment. This was messy! :-) Someone with a better understanding of the implementation and the spec should review it.

This patch can be tested with tcpsmallpkts-test.diff that modifies a server to return data in chunks configured by a new DML option named chunk_size.

Created by jop
Last modified 2005-02-23 11:19 AM
 

Powered by Plone

This site conforms to the following standards: