summaryrefslogtreecommitdiff
path: root/docs/network/README
blob: cad30acaa9e7cacc0a3f8bbbe63ebd57174cdd4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Goals:
- text-based protocols, telnetish, TCP/IPish
- comminucate over sockets (requests to services), both in client-
  (connect) and server-mode (bind,listen,accept)
- there should be no difference whether we talk to sockets, pipes
  of an external process or a file
- how events are colleted (select,poll,kqueue,/dev/poll,epoll,etc.)
  should be abstracted
- should be usable in single- and multithreaded environment
- we should scale, but not in the webserver-style (which would be
  optimization done too early in the wrong direction!)
- protocols should be designable like a Russian Nested Doll for being
  fast in business layer to device new protocols suiting the problem
- reach the 100MBit/s sustained transfer rate (yes I know, there are
  Gigabits/s NICs out there, but their speed is almost impossible to
  reach)
- low-level abstraction should try not to hide the BSD-API, but try to
  nivelate things in the direction of POSIX. So we are later able to
  add specific Unix or Windows code where we want. An abstraction as
  in Poco hinders us doing this because we have to think about everything
  from the beginning! Hard, or better impossible. Have two implementations

Links:
- Boost ASIO: on designing
- POCO Net classes: on designing
- ACE framework: on designing
- http://www.kegel.com/rn/: an epoll/kqueue abstraction interface in C,
  good for idea hunting
- http://www.kegel.com/c10k.html: how to get more than 10k clients on a
  machine, a lot of useful links
- http://www.bullopensource.org/posix: POSIX effort to normalize
  asynchronous I/O interfaces
- Boinc: http://boinc.berkeley.edu: some ideas around protocol FSMs in
  networking
- http://www.artima.com/articles/io_design_patterns1.html: on Reactor
  and Proactor and a hybrid the emulated Proactor
- http://www.developerweb.net/forum/forumdisplay.php?s=cb7c1122ba4551d2fa866b1d6cf2b97f&f=70:
  UNIX Socket FAQ: very good resource for all kind of detail problems
- http://www.madore.org/~david/computers/connect-intr.html: on the 
  behaviour of asynchronous connects on different Unixes
- Shpynx search engine: nice idea how to make Berkley sockets on Unix
  and Windows look alike, the problem is, it doesn't work as soon we
  take more sophisticated approaches:
  - async I/O on files, pipes doesn't work on Windows, there we need the
    Windows async event interface which doesn't look alike to select
  - select is very inefficient on Windows and also limited
- use POSIX getaddrinfo/getnameinfo as they provide a good top-level interface which 
  is quite portable (even on Windows)

Good code examples:
- UNPV12e of W. Richard Stevens (Unix Network Programming), the must-read
- postgresql has a good getaddrinfo replacement for Windows and Cygwin
- some very helpful tips: www_kame_net_newsletter_19980604.txt
- use POSIX getaddrinfo/getnameinfo as they provide a good top-level interface which 
  is quite portable (even on Windows)

Good code examples:
- UNPV12e of W. Richard Stevens (Unix Network Programming), the must-read
- postgresql has a good getaddrinfo replacement for Windows and Cygwin
- some very helpful tips: www_kame_net_newsletter_19980604.txt