Skip to contentSkip to conversation

Network channels.

PATCH Evgeniy Polyakov 1 participant 1 message Sep 7, 2008

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi.

I'm pleased to announce new netchannels release.

Netchannel is a peer-to-peer abstraction, which pushes whole protocol processing to the end hosts without involving kernel to perform protocol checks and maintain appropriate states. Because of its archtecture it allows to be completely protocol-agnostic and maintain single netchannel storage for effectively any protocol.

Protocol processing was moved to the small and fast userspace network stack [1]

Netchannels feature include:
* Very high bulk performance with small packets (check userspace network stack [1] for more details).
* Completely lockless netchannel processing (packet queueing and netchannel lookup in the global storage are protected by RCU).
* Unified storage for all kinds of protocols: TCP/UDP, IP/IPv6, whatever you decide to implement on top of hardware layer you use.
* No protocol processing. This is pushed to the peer itself. For example to the userspace network stack.
* Ability to inject packet into the network without root priveledges.

Original idea belongs to Van Jacobson.

This version has a major interface rewrite, unified storage changes and data queueing redesign. Patch is against Sep 6 vanilla git tree.

TODO list includes:
* Ability to improve receiving latencies (queue packets from hardware interupt handler and not software interrupt).
* Automatically scale netchannel hash table on demand.

Links.
1. Userspace network stack.
http://tservice.net.ru/~s0mbre/old/?section=projects&item=unetstack

2. Netchannels.
http://tservice.net.ru/~s0mbre/old/?section=projects&item=netchannel

dceeb70a6a4f5cd90dbabde78bc543f85ef05860

arch/x86/ia32/ia32entry.S +1 -0
index ffc1bb4..f77e4d6 100644
@@ -832,4 +832,5 @@ ia32_sys_call_table:
 	.quad sys_dup3			/* 330 */
 	.quad sys_pipe2
 	.quad sys_inotify_init1
+ 	.quad sys_netchannel_create
 ia32_syscall_end:
arch/x86/kernel/syscall_table_32.S +1 -0
index d44395f..3f97ba0 100644
@@ -332,3 +332,4 @@ ENTRY(sys_call_table)
 	.long sys_dup3			/* 330 */
 	.long sys_pipe2
 	.long sys_inotify_init1
+ 	.long sys_netchannel_create
include/asm-x86/unistd_32.h +1 -0
index d739467..4895385 100644
@@ -338,6 +338,7 @@
 #define __NR_dup3		330
 #define __NR_pipe2		331
 #define __NR_inotify_init1	332
+#define __NR_netchannel_create	333
 
 #ifdef __KERNEL__
 
include/asm-x86/unistd_64.h +2 -0
index 3a341d7..fbf5c2f 100644
@@ -653,6 +653,8 @@ __SYSCALL(__NR_dup3, sys_dup3)
 __SYSCALL(__NR_pipe2, sys_pipe2)
 #define __NR_inotify_init1			294
 __SYSCALL(__NR_inotify_init1, sys_inotify_init1)
+#define __NR_netchannel_create			295
+__SYSCALL(__NR_netchannel_create, sys_netchannel_create)
 
 
 #ifndef __NO_STUBS
include/linux/netchannel.h new file +94 -0

94 lines not on this page · raw message

include/linux/netdevice.h +9 -0
index 488c56e..2d02e98 100644
@@ -1233,6 +1233,15 @@ extern int		dev_hard_start_xmit(struct sk_buff *skb,
 					    struct net_device *dev,
 					    struct netdev_queue *txq);
 
+#ifdef CONFIG_NETCHANNEL
+extern int netchannel_recv(struct sk_buff *skb);
+#else
+static inline int netchannel_recv(struct sk_buff *skb) 
+{
+	return -1;
+}
+#endif
+
 extern int		netdev_budget;
 
 /* Called by rtnetlink.c:rtnl_unlock() */
include/linux/syscalls.h +2 -0
index d6ff145..aceb5a9 100644
@@ -625,4 +625,6 @@ asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
 
 int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
 
+asmlinkage long sys_netchannel_create(void __user *arg, unsigned int flags);
+
 #endif
kernel/sys_ni.c +2 -0
index 08d6e1b..835dc5b 100644
@@ -168,3 +168,5 @@ cond_syscall(compat_sys_timerfd_settime);
 cond_syscall(compat_sys_timerfd_gettime);
 cond_syscall(sys_eventfd);
 cond_syscall(sys_eventfd2);
+
+cond_syscall(sys_netchannel_create);
net/Kconfig +2 -0
index 7612cc8..b3d6ba9 100644
@@ -66,6 +66,8 @@ source "net/netlabel/Kconfig"
 
 endif # if INET
 
+source "net/core/netchannel/Kconfig"
+
 config NETWORK_SECMARK
 	bool "Security Marking"
 	help
net/core/Makefile +1 -0
index b1332f6..cc0e6a9 100644
@@ -14,5 +14,6 @@ obj-$(CONFIG_XFRM) += flow.o
 obj-y += net-sysfs.o
 obj-$(CONFIG_NET_PKTGEN) += pktgen.o
 obj-$(CONFIG_NETPOLL) += netpoll.o
+obj-$(CONFIG_NETCHANNEL) += netchannel/
 obj-$(CONFIG_NET_DMA) += user_dma.o
 obj-$(CONFIG_FIB_RULES) += fib_rules.o
net/core/dev.c +4 -0
index 60c51f7..f561f33 100644
@@ -2229,6 +2229,10 @@ int netif_receive_skb(struct sk_buff *skb)
 		}
 	}
 
+	ret = netchannel_recv(skb);
+	if (!ret)
+		goto out;
+
 #ifdef CONFIG_NET_CLS_ACT
 	skb = handle_ing(skb, &pt_prev, &ret, orig_dev);
 	if (!skb)
net/core/netchannel/Kconfig new file +11 -0
new file mode 100644
index 0000000..d879111
@@ -0,0 +1,11 @@
+config NETCHANNEL
+	bool "Network channels"
+	---help---
+	  Network channel is a peer-to-peer abstraction, which allows to create
+	  high performance dataflow between two hosts. 
+	  Main advantages are:
+	  	unified address cache (there is no split to IPv6/IPv4)
+		protocol processing moved to userspace
+		dynamic scalable object storage
+		cache friendly packet storage in single netchannel
+			(allows to reduce skb size)
net/core/netchannel/Makefile new file +1 -0
new file mode 100644
index 0000000..75a6897
@@ -0,0 +1 @@
+obj-y += netchannel.o storage.o user.o
net/core/netchannel/netchannel.c new file +474 -0

474 lines not on this page · raw message

net/core/netchannel/storage.c new file +176 -0

176 lines not on this page · raw message

net/core/netchannel/user.c new file +246 -0

246 lines not on this page · raw message

Signature · 1 line
	Evgeniy Polyakov