Strange byte gets added to the first packet

Putchakayala, Prabhat S. psp at mitre.org
Thu Jan 14 13:38:28 PST 2010


Juli, thanks for pointing that out. The "Version" file in the WANProxy folder says 0.6.1 but like you saw, the binary prints 0.5.2. We didn't notice that. We were building using the 0.6.1 source code, but I think we might have accidentally been using the older version binary :( I guess we can try to reinstall WANProxy again and see what happens.

Sorry about that,
Prabhat

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

Hi Prabhat,

I don't know if you got my reply before — the messages you showed
earlier were for 0.5.2.  Did you upgrade after that?

Thanks,
Juli.

On Thu, Jan 14, 2010 at 06:20, Putchakayala, Prabhat S. <psp at mitre.org> wrote:
> Oops, sorry forgot to reply to all:
>
> Juli, we are using the latest version 0.6.1 on both computers.
>
> We tried to isolate the problem further and noticed the error only happens on one particular machine. If we swap the config files around and send traffic in the other direction (ie, B to A instead of A to B in my last post's example) the packet makes it across. But when A tries to reply, the same error is printed by B. It seems that in both configurations, the WANProxy closest to B is screwing up the encoded text -> plain text conversion.
>
> We set both codecs to None just to see what would happen and there was no error this time. I think you are right in that the encoding was not as expected, but I wonder where that difference is being introduced. If you can't think of anything else, we can try reinstalling
>
> Thanks,
> Prabhat
>
>
> -----Original Message-----
> From: Juli Mallett [mailto:juli at clockworksquid.com]
> Sent: Wednesday, January 13, 2010 4:23 PM
> To: Putchakayala, Prabhat S.
> Cc: wanproxy at lists.wanproxy.org
> Subject: Re: Strange byte gets added to the first packet
>
> Hi Prabhat,
>
> Are the two computers running the same version?  I could be misreading
> the configuration files, but it looks at a quick glance like that
> should work.  The "extended function" message there suggests to me
> that the encoding was not as expected.  If they are running the same
> version, it might be a good idea to update to 0.6.1, if possible:
>
> http://wanproxy.org/releases/wanproxy-0.6.1.tar.gz
>
> If they are running the same version and you don't wish to upgrade
> yet, let me know and I'll take a closer look at the configs.
>
> Thanks,
> Juli.
>
> On Wed, Jan 13, 2010 at 12:44, Putchakayala, Prabhat S. <psp at mitre.org> wrote:
>> 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