p-quic / pquic

The PQUIC implementation, a framework that enables QUIC clients and servers to dynamically exchange protocol plugins that extend the protocol on a per-connection basis
https://pquic.org
MIT License
126 stars 20 forks source link

Server exit with code = -1 immediately #3

Closed Winters123 closed 4 years ago

Winters123 commented 4 years ago

HI, When I make pquic, there is an error reported: it said IPV6_DONTFRAG is not defined. Then I modified all this macro as 0. It compiled successfully. But when I ran ./picoquicdemo . The terminal shows Starting PicoQUIC server on port 4443, server name = ::, just_once = 0, hrr= 0, 0 local plugins and 0 both plugins Server exit, ret = -1 Server exit with code = -1 I used CentOS 7 as the environment. How should I proceed?

Thanks and regards, Xiangrui

qdeconinck commented 4 years ago

Did you enable IPv6 on your running host?

mpiraux commented 4 years ago

Hello, Be sure to run ./picoquicdemo from the its own directory. You probably need a newer kernel to get that flag defined. I would suggest to define it to its real value, i.e. 62, instead of zero. If you still encounter an error, could you post a strace log of the server execution as well ?

Winters123 commented 4 years ago

Did you enable IPv6 on your running host?

No I didn't. Should I enable it? Because I thought this demo is based on IPv4.

Thanks, Xiangrui

qdeconinck commented 4 years ago

The picoquicdemo server binds two UDP sockets, one on IPv4 on 0.0.0.0, the other one on IPv6 with ::. I suspect the creation of the second socket being the source of your error. To make the server work, either you can do the following changes:

and recompile picoquic with make.

Or you enable IPv6 on your machine.

Does one of these solutions work for you?

Winters123 commented 4 years ago

Hello, Be sure to run ./picoquicdemo from the its own directory. You probably need a newer kernel to get that flag defined. I would suggest to define it to its real value, i.e. 62, instead of zero. If you still encounter an error, could you post a strace log of the server execution as well ?

Sorry for the delayed reply. I changed the flag to the real value (62). And I used strace to monitor the whole process on the client-side.

Here is what I got from the strace log: Screenshot from 2019-10-28 18-39-53

It seems that the client returned with the value 0. Is this the sign of a successful installation? And btw, what is the kernel version for you to compile the whole project? I used 3.10 for it (might be a little bit outdated).

Thanks, Xiangrui

Winters123 commented 4 years ago

The picoquicdemo server binds two UDP sockets, one on IPv4 on 0.0.0.0, the other one on IPv6 with ::. I suspect the creation of the second socket being the source of your error. To make the server work, either you can do the following changes:

  • picoquic/picosocks.h: line 108: replace 2 by 1
  • picoquic/picosocks.c: line 56: remove AF_INET6,

and recompile picoquic with make.

Or you enable IPv6 on your machine.

Does one of these solutions work for you?

Thanks for the solution provided. I changed the IPV6 flags to the value that Maxime told me (with IPv6 enabled on the OS). And the client returned with 0 when the test finished.

But when I disabled IPv6 options (like you mentioned in OP1), the client exit with a strace log like this. Screenshot from 2019-10-28 18-04-30

Thanks, Xiangrui

mpiraux commented 4 years ago

It seems that the client returned with the value 0. Is this the sign of a successful installation?

It's the sign of a successful execution at least. By looking closely at the full log, you should see that data is exchanged on a few streams that eventually get gracefully closed.

But when I disabled IPv6 options (like you mentioned in OP1), the client exit with a strace log like this.

I recommend not to change the code to make it IPv4 only, I suspect there are few other places to change than the two ones mentioned by Quentin. IPv6 can be trivially enabled these days.

Winters123 commented 4 years ago

It seems that the client returned with the value 0. Is this the sign of a successful installation?

It's the sign of a successful execution at least. By looking closely at the full log, you should see that data is exchanged on a few streams that eventually get gracefully closed.

But when I disabled IPv6 options (like you mentioned in OP1), the client exit with a strace log like this.

I recommend not to change the code to make it IPv4 only, I suspect there are few other places to change than the two ones mentioned by Quentin. IPv6 can be trivially enabled these days.

sure. Thanks for both of you :)