Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network Feature Example Failed #486

Open
buszk opened this issue Mar 7, 2020 · 1 comment
Open

Network Feature Example Failed #486

buszk opened this issue Mar 7, 2020 · 1 comment

Comments

@buszk
Copy link

buszk commented Mar 7, 2020

Hi all,

I want to explore the network feature of LKL and found the documentation not very helpful, so I wonder if I could get some help here.

I am using the provided sample conf.json and running command LKL_HIJACK_CONFIG_FILE="conf.json" bin/lkl-hijack.sh ip addr s

The result shows some errors and I'm very confused. They are 1) /dev/net/tun: failed to attach to: Operation not permitted, 2) no netdev available tap7, 3) Network is unreachable. The full output is as follows.

I would like some help with fixing the errors or pointing out why they exist.

LKL_HIJACK_CONFIG_FILE="conf.json" bin/lkl-hijack.sh ip addr s
/dev/net/tun: failed to attach to: Operation not permitted
/dev/net/tun: failed to attach to: Operation not permitted
LKL: Pin To CPU 0
[    0.000000] Linux version 5.3.0+ (buszk@debian) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 Tue Mar 3 22:28:04 EST 2020
[    0.000000] memblock address range: 0x7f9ca4000000 - 0x7f9ca7fff000
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16159
[    0.000000] Kernel command line: ip=dhcp
[    0.000000] Dentry cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory available: 64500k/65532k RAM
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 4096
[    0.000000] lkl: irqs initialized
[    0.000000] clocksource: lkl: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[    0.000000] lkl: time and timers initialized (irq1)
[    0.000003] pid_max: default: 4096 minimum: 301
[    0.000022] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.000025] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.003137] random: get_random_bytes called from _etext+0xb531/0x13ec2 with crng_init=0
[    0.006085] printk: console [lkl_console0] enabled
[    0.006342] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.006478] xor: automatically using best checksumming function   8regs
[    0.006810] NET: Registered protocol family 16
[    0.326411] raid6: int64x8  gen()  9281 MB/s
[    0.633181] raid6: int64x8  xor()  5944 MB/s
[    0.964759] raid6: int64x4  gen()  9940 MB/s
[    1.316995] raid6: int64x4  xor()  7179 MB/s
[    1.631363] raid6: int64x2  gen() 12244 MB/s
[    1.967435] raid6: int64x2  xor()  7961 MB/s
[    2.306273] raid6: int64x1  gen() 11062 MB/s
[    2.648061] raid6: int64x1  xor()  6253 MB/s
[    2.648133] raid6: using algorithm int64x2 gen() 12244 MB/s
[    2.648162] raid6: .... xor() 7961 MB/s, rmw enabled
[    2.648526] raid6: using intx1 recovery algorithm
[    2.649190] clocksource: Switched to clocksource lkl
[    2.649746] NET: Registered protocol family 2
[    2.650290] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    2.650346] TCP established hash table entries: 512 (order: 0, 4096 bytes, linear)
[    2.650468] TCP bind hash table entries: 512 (order: 0, 4096 bytes, linear)
[    2.650612] TCP: Hash tables configured (established 512 bind 512)
[    2.650954] UDP hash table entries: 128 (order: 0, 4096 bytes, linear)
[    2.651098] UDP-Lite hash table entries: 128 (order: 0, 4096 bytes, linear)
[    2.651604] workingset: timestamp_bits=62 max_order=15 bucket_order=0
[    2.652633] SGI XFS with ACLs, security attributes, no debug enabled
[    2.653078] io scheduler mq-deadline registered
[    2.653083] io scheduler kyber registered
[    2.655691] NET: Registered protocol family 10
[    2.656030] Segment Routing with IPv6
[    2.656190] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.656619] Btrfs loaded, crc32c=crc32c-generic
[   15.139332] Warning: unable to open an initial console.
[   15.139353] This architecture does not have kernel memory protection.
[   15.139355] Run /init as init process
no netdev available tap7
RTNETLINK answers: Network is unreachable
failed to set IPv4 gateway: Network is unreachable
RTNETLINK answers: No route to host
failed to set IPv6 gateway: No route to host
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
[   15.141086] reboot: Restarting system
@buszk
Copy link
Author

buszk commented Mar 7, 2020

After some digging with strace I found that the user does not have permission to call ioctl on /dev/net/tun. After switching to root, the script can run. Now the problem is that it is actually very slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant