Strange byte gets added to the first packet

Putchakayala, Prabhat S. psp at mitre.org
Wed Jan 13 12:44:45 PST 2010


Juli, thanks for the quick reply. Thinking of it as "interface_codec" and "peer_codec" made it a lot more intuitive, so if there is a name change in the future, that gets my vote :) I made the changes and ran it on my single laptop and everything worked perfectly.

However, we tried repeating the test across two computers (one WANProxy on each) and got some weird errors unrelated to yesterday's (I think) 

1263411367.600943 [/wanproxy] INFO: WANProxy 0.5.2
1263411367.601061 [/wanproxy] INFO: Copyright (c) 2008-2009 WANProxy.org.
1263411367.601085 [/wanproxy] INFO: All rights reserved.
1263411367.601137 [/wanproxy/config] INFO: Configuring WANProxy.
1263411367.602644 [/io/system] INFO: Starting IO system.
1263411367.602951 [/event/system] INFO: Starting event system.
1263411371.748167 [/xcodec/decoder] ERR: Extended functions not implemented yet.
1263411371.748264 [/splice] DEBUG: Unexpected event: <Error>/0 [Success]
1263411371.748307 [/splice/pair] DEBUG: Unexpected event: <Error>/0 [Success]
1263411371.748352 [/wanproxy/proxy/client] ERR: Unexpected event: <Error>/0 [Success]

The errors are printed by the receiving proxy (ie, if computer A is sending to computer B, the proxy closest to B prints this) right as it is about to receive the first packet. The same test (with the IP addresses changed) works fine on just one computer. Do you know what these errors mean?

Thanks again!
Prabhat

Commands:
Server: $ nc -lp 8000
Client: $ nc localhost 3300
Server: Type "testing"
Client: Connection closes and error message is printed in WANProxy's terminal

Config files:
Server:
create codec codec0
set codec0.codec XCodec
activate codec0

create interface if0
set if0.family IPv4
set if0.host "10.0.0.1"
set if0.port "3301"
activate if0

create peer peer0
set peer0.family IPv4
set peer0.host "localhost"
set peer0.port "8000"
activate peer0

create proxy proxy0
set proxy0.interface if0
set proxy0.decoder codec0
set proxy0.peer peer0
set proxy0.encoder None
activate proxy0

Client:
create codec codec0
set codec0.codec XCodec
activate codec0

create interface if0
set if0.family IPv4
set if0.host "127.0.0.1"
set if0.port "3300"
activate if0

create peer peer0
set peer0.family IPv4
set peer0.host "10.0.0.1"
set peer0.port "3301"
activate peer0

create proxy proxy0
set proxy0.interface if0
set proxy0.decoder None
set proxy0.peer peer0
set proxy0.encoder codec0
activate proxy0


-----Original Message-----
From: Juli Mallett [mailto:juli at clockworksquid.com] 
Sent: Tuesday, January 12, 2010 4:07 PM
To: Putchakayala, Prabhat S.
Cc: wanproxy at lists.wanproxy.org
Subject: Re: Strange byte gets added to the first packet

Hi Prabhat,

The naming of the fields in the proxy object are actually very confusing.

The "decoder" codec handles traffic going between the proxy and an
incoming connection.  The "encoder" codec handles traffic going
between the proxy and an outgoing connection.

So on the side that plaintext comes in on you want to have the
"decoder" set to "None".  On the side where plaintext goes back out
you want to have the "encoder" set to "None".

I suppose that "incoming_codec" and "outgoing_codec" would be better
names.  I'll make that change in the near future assuming nothing
better comes up.  (Or perhaps "interface_codec" and "peer_codec" to
match the fields for the connections they correspond with?)

Juli.

On Tue, Jan 12, 2010 at 08:59, Putchakayala, Prabhat S. <psp at mitre.org> wrote:
> Hello list,
>
>
>
> I have a small WANProxy scenario setup on a single computer for preliminary
> tests and I noticed some odd behavior. After a TCP connection is made, the
> first packet has a random byte inserted at the beginning of it after it
> passes through one of the proxies. Here is a brief example using netcat. The
> server is started on port 4001, and the client makes requests to port 3000.
> Our config files are attached to the end, but here is a summary:
>
>
>
> WANProxy 1: listening on port 3000, forwarding to port 4000. Applying the
> codec in both directions
>
> WANProxy 2: listening on port 4000, forwarding to port 4001. Applying the
> codec in both directions
>
>
>
> The server: $ nc -lp 4001
>
> The client: $ nc localhost 3000
>
>
>
> The following message is typed in the server: testing
>
> The following message appears in the client: �testing
>
>
>
> In case it fails to show up in this message, the byte in front of the second
> “testing” is \xef
>
>
>
> Our best guess is that some of the information needed for deduplication is
> left in the packet. We did a more complicated test using two computers on
> the network rather than just one, and the same thing happens. Anyone know
> what we are doing wrong?
>
>
>
> Thanks a lot!
>
> Prabhat
>
>
>
> Here are our config files:
>
>
>
> Server:
>
> create codec codec0
>
> set codec0.codec XCodec
>
> activate codec0
>
>
>
> create interface if0
>
> set if0.family IPv4
>
> set if0.host "127.0.0.1"
>
> set if0.port "4000"
>
> activate if0
>
>
>
> create peer peer0
>
> set peer0.family IPv4
>
> set peer0.host "localhost"
>
> set peer0.port "4001"
>
> activate peer0
>
>
>
> create proxy proxy0
>
> set proxy0.interface if0
>
> set proxy0.decoder codec0
>
> set proxy0.peer peer0
>
> set proxy0.encoder codec0
>
> activate proxy0
>
>
>
> Client:
>
> create codec codec0
>
> set codec0.codec XCodec
>
> activate codec0
>
>
>
> create interface if0
>
> set if0.family IPv4
>
> set if0.host "127.0.0.1"
>
> set if0.port "3000"
>
> activate if0
>
>
>
> create peer peer0
>
> set peer0.family IPv4
>
> set peer0.host "localhost"
>
> set peer0.port "4000"
>
> activate peer0
>
>
>
> create proxy proxy0
>
> set proxy0.interface if0
>
> set proxy0.decoder codec0
>
> set proxy0.peer peer0
>
> set proxy0.encoder codec0
>
> activate proxy0
>
> _______________________________________________
> wanproxy mailing list
> wanproxy at lists.wanproxy.org
> http://lists.wanproxy.org/listinfo.cgi/wanproxy-wanproxy.org
>
>


More information about the wanproxy mailing list