Hi Sylvain, all rigth? I am here again...

Sorry, but the problem continues. Please but I have a suspicion. First I
explain you the status.

1) My setup is very simillar to your. I have two VM´s (Ubuntu) in a Win-7
host. Serial
using the "Host pipe" VirtualBox method.

2) Today (jan/21/2016), I updated my lwip and lwip-contrib git-repos
changing just the two files sent to you (lwipopts.h and simhost.c) in the
".../lwip-contrib/ports/unix/proj/unixsim" directory. Master branch.

3) In the VM#1, I run the pppd (linux), passive mode. Just after, the
"simhost" app is executed in VM#2.  The link ppp is established, with no
problem. I think that validates the serial and PPP connections.

The problem is with TCP mode. Today I use also the netcat tool like you. No
problem (example in client side:   echo "TEST" | nc 192.168.123.21 7).

I have a suspicion when the client opens and uses the same connection to
exchange several echo messages different from "netcat" behavior. I think.
Thus I picked up a echo-client int the internet (thank to Silver Moon).
When I use this "original client" the problem happens after 3 or plus echo
messages like in my implementation.

But when I use the "changed client" (open and close socket for each echo
message/prompt), no problem, all works fine.

Please, could you test the two attached clients files in your setup (on
pppd server host) ? Is there sense in my suspicion?

OBS:
   > gcc echo_client_original.c -o echoClientOriginal
   > gcc echo_client_changed.c -o echoClientChanged

Thanks.
Norberto




2016-01-20 22:16 GMT-02:00 Sylvain Rochet <[email protected]>:

> Hi Norberto,
>
> On Mon, Jan 18, 2016 at 01:01:12PM -0200, Norberto R. de Goes Jr. wrote:
> >
> > I would like remember you the code used to reproduce the PPP/TCP error is
> > practically the same of the lwip git-repos (lwip e contrib), last Friday
> > (jan/15/2016) version, only the "simhost.c" and "lwipopts.h" files with
> > little modifications (attached again), or better, I am not using my code
> to
> > show you the reported problem, but the behavior is the same.
>
> I tested your setup with VirtualBox using two Debian VMs and a serial
> bridge using the "Host pipe" VirtualBox method.
>
> I started the pppd deamon on one host this way:
>
> /usr/sbin/pppd silent local nocrtscts noauth  \
>     192.168.123.20:192.168.123.21 /dev/ttyS0
>
> And the latest lwIP Git with your two changed files in the unixsim
> project on the other host.
>
>
> This is what I have on the pppd server host:
>
> Jan 21 01:00:04 debian pppd[1797]: pppd 2.4.6 started by root, uid 0
> Jan 21 01:00:04 debian pppd[1797]: Using interface ppp0
> Jan 21 01:00:04 debian pppd[1797]: Connect: ppp0 <--> /dev/ttyS0
> Jan 21 01:01:51 debian pppd[1797]: local  IP address 192.168.123.20
> Jan 21 01:01:51 debian pppd[1797]: remote IP address 192.168.123.21
>
> And what I have on the lwIP host:
>
> # ./simhost
> System initialized.
> SNMP private MIB start, detecting sensors.
> TFCP/IP initialized.
> Applications started.
> ppp_link_status_cb: PPPERR_NONE
>    our_ip4addr = 192.168.123.21
>    his_ip4addr = 192.168.123.20
>    netmask     = 255.255.255.255
>
>
> I checked TCP, UDP, using various tools over this link (netcat, telnet),
> even at "full" speed, and it works perfectly fine.
>
> Sylvain
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>



-- 
Norberto R. de Goes Jr.
CPqD - DRC
Tel.: +55 19 3705-4241 / Fax: +55 19 3705-6125
[email protected] <[email protected]>
www.cpqd.com.br
/*
    C ECHO client example using sockets
*/
#include<stdio.h> //printf
#include<string.h>    //strlen
#include<sys/socket.h>    //socket
#include<arpa/inet.h> //inet_addr
 
int main(int argc , char *argv[])
{
    int sock;
    struct sockaddr_in server;
    char message[1000] , server_reply[2000];
     
    //Create socket
    sock = socket(AF_INET , SOCK_STREAM , 0);
    if (sock == -1)
    {
        printf("Could not create socket");
    }
    puts("Socket created");
     
    server.sin_addr.s_addr = inet_addr("192.168.123.21");
    server.sin_family = AF_INET;
    server.sin_port = htons( 7 );
 
    //Connect to remote server
    if (connect(sock , (struct sockaddr *)&server , sizeof(server)) < 0)
    {
        perror("connect failed. Error");
        return 1;
    }
     
    puts("Connected\n");
     
    //keep communicating with server
    while(1)
    {
        printf("Enter message : ");
        scanf("%s" , message);
         
        //Send some data
        if( send(sock , message , strlen(message) , 0) < 0)
        {
            puts("Send failed");
            return 1;
        }
         
        //Receive a reply from the server
        if( recv(sock , server_reply , 2000 , 0) < 0)
        {
            puts("recv failed");
            break;
        }
         
        puts("Server reply :");
        puts(server_reply);
    }
     
    close(sock);
    return 0;
}
/*
    C ECHO client example using sockets
*/
#include<stdio.h> //printf
#include<string.h>    //strlen
#include<sys/socket.h>    //socket
#include<arpa/inet.h> //inet_addr
 
int main(int argc , char *argv[])
{
    int sock;
    struct sockaddr_in server;
    char message[1000] , server_reply[2000];
     

     
    //keep communicating with server
    while(1)
    {

    //Create socket
    sock = socket(AF_INET , SOCK_STREAM , 0);
    if (sock == -1)
    {
        printf("Could not create socket");
    }
    puts("Socket created");
     
    server.sin_addr.s_addr = inet_addr("192.168.123.21");
    server.sin_family = AF_INET;
    server.sin_port = htons( 7 );
 
    //Connect to remote server
    if (connect(sock , (struct sockaddr *)&server , sizeof(server)) < 0)
    {
        perror("connect failed. Error");
        return 1;
    }
     
    puts("Connected\n");


        printf("Enter message : ");
        scanf("%s" , message);
         
        //Send some data
        if( send(sock , message , strlen(message) , 0) < 0)
        {
            puts("Send failed");
            return 1;
        }
         
        //Receive a reply from the server
        if( recv(sock , server_reply , 2000 , 0) < 0)
        {
            puts("recv failed");
            break;
        }
         
        puts("Server reply :");
        puts(server_reply);
    close(sock);
    }
     
    return 0;
}
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to