New stack: Difference between revisions

From KolibriOS wiki
Jump to navigation Jump to search
mNo edit summary
 
(60 intermediate revisions by 2 users not shown)
Line 1: Line 1:
;This page describes the development of the new network stack for KolibriOS
;This page describes the development of the new network stack for KolibriOS
;You can find the latest source code of this development branch on svn://kolibrios.org/kernel/branches/net ([http://websvn.kolibrios.org/listing.php?repname=Kolibri+OS&path=%2Fkernel%2Fbranches%2Fnet%2F websvn])
; Since SVN #3556, the code has been merged in trunk and is now available in the english, russian spanish and italian builds of kolibrios!
;You can download an image file with pre-compiled library, applications, kernel and drivers on the [http://builds.kolibrios.org/new-stack/ builds page]''<br />
;You can find the latest source code on svn://kolibrios.org/kernel/trunk ([http://websvn.kolibrios.org/listing.php?repname=Kolibri+OS&path=%2Fkernel%2Ftrunk%2F websvn])
;You can download an image file with pre-compiled library, applications, kernel and drivers on the [http://builds.kolibrios.org/ builds page]''<br />
;All bugs may be reported to [http://bugs.kolibrios.org KolibriOS bug tracker]
;All bugs may be reported to [http://bugs.kolibrios.org KolibriOS bug tracker]


== Kernel ==
== Progress ==


The old kernel functions 52 and 53 have been removed and the [[New_network_api]] has been created.<br />
System functions 52, 53 have been replaced by functions 74 (Network hardware access), 75 (BSD sockets) and 76 (Network settings and statistics). ''See sysfuncs.txt for details. <br />
Internally, the stack has been completely rewritten (mostly from scratch)<br />
Internally, the network stack has been completely rewritten (mostly from scratch).<br />
All network drivers have been converted and or rewritten to operate with the new network stack.<br />


*;What works:
*;Working:
**Attaching multiple network drivers/devices to the kernel
**Attaching multiple network drivers/devices to the kernel
**Sending and receiving Ethernet/IPv4/UDP/ICMP/ARP/TCP packets
**Sending and receiving Ethernet/IPv4/UDP/ICMP/ARP/TCP packets
**Queuing of packets when nescessary
**Queuing of packets when necessary
**UDP/TCP/RAW(ICMP/..) sockets (POSIX compatible)
**UDP/TCP/RAW(ICMP/IP..) sockets (POSIX compatible)
**Blocking sockets
**IPC/local sockets '' (needs testing)
**Dedicated network buffers '' (NET_buff_alloc, NET_buff_free)
**IP address assignment for all network interfaces


*;Under construction
*;TODO:
**TCP code '' (TODO: rewrite timers, further implement the code of 4.4BSD)
**Link detection for all network drivers (Currently works on RTL8139, RTL8169, forcedeth, mtd80x, i8254x)
**Sockets code
**Improved routing
**network drivers '' (can't have enough of those, right?)
**TCP: reassembly queue, testing (timestamps, RTT, PAWS, ...), ...
**programs '' (Any help here is especially appreciated)
**PPP '' (need help developing/testing)
**blocking sockets '' (should work reasonably already)
**IPC/local sockets
 
*;Future plans
**Routing
**Port trunking?
**...


== Drivers ==
== Drivers ==
Line 34: Line 33:
The specifications of the new network drivers can be found in the article [[Writing_network_drivers_for_KolibriOS]].<br />
The specifications of the new network drivers can be found in the article [[Writing_network_drivers_for_KolibriOS]].<br />


=== Working (more or less) ===
'''[[Hardware_Support#Network | Currently supported network hardware]]'''
*3c90x/3c59x
*DEC21x4x
*i8254x (Intel eepro 1000)
*MTD80x
*PCnet32
*r6040
*rhine (VIA)
*RTL8029
*RTL8139
*RTL8169
*SIS900
 
[[http://bugs.kolibrios.org/issues_rss.php?username=hidnplayr&key=9d4579bd56bbf12716258a18ec5296e7&project_id=3&filter_id=16 known bugs in network drivers]]
 
=== Work In Progress ===
*i8255x (Intel eepro 100)
*forcedeth
 
=== Planned for future ===
*marvell yukon (i have id5005)
*broadcom netXtreme (bcm57xx)


=== Unsupported PCI card? ===
'''Unsupported PCI card?''' If you have a PCI/PCI-X/PCI-express ethernet card which is not listed above, and would like to acces the internet in KolibriOS, you may send me the card, and I'll send you one back that is already supported.<br>
If you have a PCI ethernet card wich is not listed above, and would like to acces internet in KolibriOS, send me the card, and I'll send you one that is supported already.<br>


== Programs ==
== Programs ==


=== ARPcfg ===
=== FTPc ===
This program allows you to view the ARP entries.<br />
[[Image:ftpc.gif]]<br>
In future, you should be able to add and remove static entry's using this progam.
CLI FTP client. <br />
''Uses console.obj''<br />
<br />
Also see: [[Using kolibrios.org with ftpc]]


=== FTPd ===
=== FTPd ===
Full fledged FTP daemon. Fully configureable through ini files.
Full fledged FTP daemon. Fully configureable through ini files. <br />
Status: Basic commands work. Program is not stable yet.
Status: Basic commands work. <br />
''uses libini.obj, libio.obj and console.obj''
''uses libini.obj, libio.obj and console.obj, TODO: STOR command, dont use libio, ...''


=== IRCC ===
=== IRCc ===
New IRC client. Under construction.
[[Image:Ircc.gif]]<br>
New IRC client. Under construction. <br />
''uses network.obj, libini.obj and box_lib.obj''
''uses network.obj, libini.obj and box_lib.obj''


=== NetCFG ===  
=== NetCFG ===  
[[Image:netcfg.gif]]<br>
This program is used to load the network drivers.<br />
This program is used to load the network drivers.<br />
You can run it with parameter 'F' to silently load first detected card, or parameter 'A' to load all cards. <br />
You can run it with parameter 'F' to silently load first detected card, or parameter 'A' to load all cards. <br />
Line 81: Line 63:


=== Netstat ===  
=== Netstat ===  
[[Image:ipv4.png]]<br>
This program allows you to read the status of ethernet, ipv4, icmp, arp udp and tcp.<br />
This program allows you to read the status of ethernet, ipv4, icmp, arp udp and tcp.<br />
''TODO: allow user to set ARP settings, and save those to .ini file.''


=== nslookup ===  
=== nslookup ===  
Line 87: Line 71:
''This program uses network.obj and console.obj''
''This program uses network.obj and console.obj''


=== ping (formerly called ICMP) ===
=== ping ===
A program to ping a remote host<br />
[[Image:ping.gif]]<br />
Only fixed packet size for now<br />
A program to ping a remote host using the ICMP protocol<br />
Only fixed packet size for now.<br />
''uses network.obj, libini.obj and console.obj''
''uses network.obj, libini.obj and console.obj''
=== SSH ===
[[Image:Ssh.png]]<br />
SSH client
''uses network.obj, libcrash.obj and console.obj''


=== SynergyC ===
=== SynergyC ===
Line 96: Line 86:
This version is compatible with version 1.3.1<br />
This version is compatible with version 1.3.1<br />
Only mouse events are accepted in the current version.<br />
Only mouse events are accepted in the current version.<br />
''There is a bug in the loading of libraries wich might cause program to crash on loading''<br />
''There is a bug in the loading of libraries which might cause program to crash on loading''<br />
''uses network.obj, libini.obj and console.obj''
''uses network.obj, libini.obj and console.obj''


=== Telnet ===   
=== Telnet ===   
[[Image:telnet.gif]]<br>
A simple telnet client<br />
A simple telnet client<br />
''This program uses network.obj and console.obj''
''This program uses network.obj and console.obj''


=== TFTPc ===  
=== TFTPc ===  
[[Image:tftpc.gif]]<br>
A TFTP client with a GUI. <br />
A TFTP client with a GUI. <br />
'' uses libio.obj, network.obj and box_lib.obj''
'' uses libio.obj, network.obj and box_lib.obj''


=== VNCclient ===
=== VNCclient ===
Under construction
This program allows you to control a remote computer. The remote computer must be running a VNC server that support the RFB 3.3 protocol.<br>
The client currently supports RAW, CopyRect, RRE and TRLE encodings.<br>
Authentication to a password protected VNC server is possible through the "VNC Authentication" algorithm.<br>
There is currently no support for encryption.<br>
''TODO: ZRLE, ..''


=== Zeroconf ===  
=== Zeroconf ===  
This program reads settings from zeroconf.ini and configures the tcp/ip stack accordingly <br />
This program reads settings from network.ini and configures the tcp/ip stack accordingly <br />
You may choose for a manual setup, or dhcp / link-local.
You may choose for a manual setup, or dhcp / link-local.<br />
''TODO: keep listening for DHCP release packets etc.''


=== NetSurf ===
=== NetSurf ===
Sourcerer is working on a Netsurf port for KolibriOS, hopefully it will work hand in hand with the new network stack, somewhere in the near future!
Under construction <br />
''TODO: Improve front-end, ...''
 
=== SocketDBG ===
Program that can be used for printing socket variables, usefull for debugging.
 
=== PPPoE ===
PPPoE dialer - unfinished
 
=== TCPserv ===
TCP server demo program, this program can be used with iperf client to measure performance of the stack.


== Libraries ==
== Libraries ==


=== network_lib ===
=== network.obj ===
The network library for KolibriOS, written by Clevermouse.
Network library for KolibriOS, written by Clevermouse. Primary functions are getaddrinfo, inet_ntoa.
 
=== http.obj ===
HTTP client library, can be used to fetch content from the web. <br>
Currently support HTTP/1.1 GET, POST and HEAD methods. HTTP proxy's are also supported (settings in network.ini).
 
== Applications, old vs new ==
 
{| class="wikitable" border="1"
|'''old'''
|'''new'''
|'''remarks'''
|-
|airc
|ircc
|IRC client (rewritten from scratch)
|-
|arpstat
|netstat
|ARP configuration utility (rewritten)
|-
|chess
|/
|may be ported
|-
|dhcp
|/
|replaced by zeroconf
|-
|dnsr
|nslookup
|Name service lookup (DNS resolver)
|-
|downloader
|downloader
|rewritten
|-
|ethstat
|/
|N/A
|-
|ftps
|ftpd
|FTP daemon (server)
|-
|https
|/
|may be ported, better to rewrite
|-
|icq
|/
|may be ported
|-
|ipc
|/
|may be ported
|-
|local
|/
|may be ported
|-
|mp3s
|/
|may be ported
|-
|netsendc
|/
|may be ported
|-
|netsends
|/
|may be ported
|-
|nntpc
|/
|may be ported
|-
|popc
|/
|may be ported (or replaced with liza?)
|-
|ppp
|/
|N/A (a new utility should be made)
|-
|rccc
|/
|may be ported
|-
|rccs
|/
|may be ported
|-
|remote
|/
|may be ported
|-
|smtps
|/
|may be ported
|-
|stackcfg
|netstat
|Network configuration utility (rewritten from scratch)
|-
|telnet
|telnet
|rewritten from scratch
|-
|terminal
|/
|N/A
|-
|tftpa
|/
|may be ported
|-
|tftpc
|tftpc
|Trivial File Transer Protocol Client
|-
|VNCclient
|vncc
|ported
|-
|ym
|/
|may be ported
|-
|zeroconf
|zeroconf
|ported
|}


== I need your help! ==
== We need your help! ==
;If you think you can help the further development of this branch in any way, please post on the forum or join the IRC channel.  
;If you think you can help with further development of networking applications, driver or kernel code in any way, please let us know through the forum or IRC channel.  


[[Category:Coding]]
[[Category:Coding]]
[[Category:System_documentation]]
[[Category:System_documentation]]

Latest revision as of 12:42, 10 July 2021

This page describes the development of the new network stack for KolibriOS
Since SVN #3556, the code has been merged in trunk and is now available in the english, russian spanish and italian builds of kolibrios!
You can find the latest source code on svn://kolibrios.org/kernel/trunk (websvn)
You can download an image file with pre-compiled library, applications, kernel and drivers on the builds page
All bugs may be reported to KolibriOS bug tracker

Progress

System functions 52, 53 have been replaced by functions 74 (Network hardware access), 75 (BSD sockets) and 76 (Network settings and statistics). See sysfuncs.txt for details.
Internally, the network stack has been completely rewritten (mostly from scratch).
All network drivers have been converted and or rewritten to operate with the new network stack.

  • Working
    • Attaching multiple network drivers/devices to the kernel
    • Sending and receiving Ethernet/IPv4/UDP/ICMP/ARP/TCP packets
    • Queuing of packets when necessary
    • UDP/TCP/RAW(ICMP/IP..) sockets (POSIX compatible)
    • Blocking sockets
    • IPC/local sockets (needs testing)
    • Dedicated network buffers (NET_buff_alloc, NET_buff_free)
    • IP address assignment for all network interfaces
  • TODO
    • Link detection for all network drivers (Currently works on RTL8139, RTL8169, forcedeth, mtd80x, i8254x)
    • Improved routing
    • TCP: reassembly queue, testing (timestamps, RTT, PAWS, ...), ...
    • PPP (need help developing/testing)

Drivers

In net-branch, the network drivers are external drivers, as described in Writing_drivers_for_KolibriOS.

The specifications of the new network drivers can be found in the article Writing_network_drivers_for_KolibriOS.

Currently supported network hardware

Unsupported PCI card? If you have a PCI/PCI-X/PCI-express ethernet card which is not listed above, and would like to acces the internet in KolibriOS, you may send me the card, and I'll send you one back that is already supported.

Programs

FTPc

Ftpc.gif
CLI FTP client.
Uses console.obj

Also see: Using kolibrios.org with ftpc

FTPd

Full fledged FTP daemon. Fully configureable through ini files.
Status: Basic commands work.
uses libini.obj, libio.obj and console.obj, TODO: STOR command, dont use libio, ...

IRCc

Ircc.gif
New IRC client. Under construction.
uses network.obj, libini.obj and box_lib.obj

NetCFG

Netcfg.gif
This program is used to load the network drivers.
You can run it with parameter 'F' to silently load first detected card, or parameter 'A' to load all cards.
No parameters will load the GUI.

Netstat

Ipv4.png
This program allows you to read the status of ethernet, ipv4, icmp, arp udp and tcp.
TODO: allow user to set ARP settings, and save those to .ini file.

nslookup

Commandline DNS client.
This program uses network.obj and console.obj

ping

Ping.gif
A program to ping a remote host using the ICMP protocol
Only fixed packet size for now.
uses network.obj, libini.obj and console.obj

SSH

Ssh.png
SSH client uses network.obj, libcrash.obj and console.obj

SynergyC

Software KM-switch, (Synergy - client) for windows/unix/.. versions, see http://synergy-foss.org
This version is compatible with version 1.3.1
Only mouse events are accepted in the current version.
There is a bug in the loading of libraries which might cause program to crash on loading
uses network.obj, libini.obj and console.obj

Telnet

Telnet.gif
A simple telnet client
This program uses network.obj and console.obj

TFTPc

Tftpc.gif
A TFTP client with a GUI.
uses libio.obj, network.obj and box_lib.obj

VNCclient

This program allows you to control a remote computer. The remote computer must be running a VNC server that support the RFB 3.3 protocol.
The client currently supports RAW, CopyRect, RRE and TRLE encodings.
Authentication to a password protected VNC server is possible through the "VNC Authentication" algorithm.
There is currently no support for encryption.
TODO: ZRLE, ..

Zeroconf

This program reads settings from network.ini and configures the tcp/ip stack accordingly
You may choose for a manual setup, or dhcp / link-local.
TODO: keep listening for DHCP release packets etc.

NetSurf

Under construction
TODO: Improve front-end, ...

SocketDBG

Program that can be used for printing socket variables, usefull for debugging.

PPPoE

PPPoE dialer - unfinished

TCPserv

TCP server demo program, this program can be used with iperf client to measure performance of the stack.

Libraries

network.obj

Network library for KolibriOS, written by Clevermouse. Primary functions are getaddrinfo, inet_ntoa.

http.obj

HTTP client library, can be used to fetch content from the web.
Currently support HTTP/1.1 GET, POST and HEAD methods. HTTP proxy's are also supported (settings in network.ini).

Applications, old vs new

old new remarks
airc ircc IRC client (rewritten from scratch)
arpstat netstat ARP configuration utility (rewritten)
chess / may be ported
dhcp / replaced by zeroconf
dnsr nslookup Name service lookup (DNS resolver)
downloader downloader rewritten
ethstat / N/A
ftps ftpd FTP daemon (server)
https / may be ported, better to rewrite
icq / may be ported
ipc / may be ported
local / may be ported
mp3s / may be ported
netsendc / may be ported
netsends / may be ported
nntpc / may be ported
popc / may be ported (or replaced with liza?)
ppp / N/A (a new utility should be made)
rccc / may be ported
rccs / may be ported
remote / may be ported
smtps / may be ported
stackcfg netstat Network configuration utility (rewritten from scratch)
telnet telnet rewritten from scratch
terminal / N/A
tftpa / may be ported
tftpc tftpc Trivial File Transer Protocol Client
VNCclient vncc ported
ym / may be ported
zeroconf zeroconf ported

We need your help!

If you think you can help with further development of networking applications, driver or kernel code in any way, please let us know through the forum or IRC channel.