Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44372 > unrolled thread

TCP reassembly

Started byHasil Sharma <hasilsharma7@gmail.com>
First post2013-04-25 16:35 -0700
Last post2013-04-25 23:35 -0400
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  TCP reassembly Hasil Sharma <hasilsharma7@gmail.com> - 2013-04-25 16:35 -0700
    Re: TCP reassembly Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-25 19:05 -0500
    Re: TCP reassembly Dave Angel <davea@davea.name> - 2013-04-25 23:35 -0400

#44372 — TCP reassembly

FromHasil Sharma <hasilsharma7@gmail.com>
Date2013-04-25 16:35 -0700
SubjectTCP reassembly
Message-ID<ee05b72e-86dc-4744-a733-64a804a41af8@googlegroups.com>
Hi everyone , 
How to reassemble the TCP data packets into objects viz. html , css , js image files etc . I have no idea how to implement it using python , please help ?

[toc] | [next] | [standalone]


#44373

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2013-04-25 19:05 -0500
Message-ID<mailman.1073.1366934711.3114.python-list@python.org>
In reply to#44372
On 2013.04.25 18:35, Hasil Sharma wrote:
> Hi everyone , 
> How to reassemble the TCP data packets into objects viz. html , css , js image files etc . I have no idea how to implement it using python , please help ?
TCP packets don't need to be reassembled. If your application receives TCP packets out of order, there is a problem with your networking
equipment (or possibly the TCP stack in your OS). I suspect that you actually mean that you want distinct bytes objects that represent
specific data. Sockets will give you a stream of bytes; how the data is separated is defined by the protocol. If you are dealing with HTTP,
it is much better to use an HTTP client library than raw sockets. In fact, there are many libraries available for many different protocols,
which are a better choice than dealing with sockets directly for all but the simplest protocols. You'll get a better answer if you tell us
what the problem is and what you are trying to accomplish.

-- 
CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1

[toc] | [prev] | [next] | [standalone]


#44380

FromDave Angel <davea@davea.name>
Date2013-04-25 23:35 -0400
Message-ID<mailman.1078.1366947366.3114.python-list@python.org>
In reply to#44372
On 04/25/2013 07:35 PM, Hasil Sharma wrote:
> Hi everyone ,
> How to reassemble the TCP data packets into objects viz. html , css , js image files etc . I have no idea how to implement it using python , please help ?
>


TCP reassembly has a specific meaning, and I doubt if that's what you 
mean.  If you reach down below the tcp layer in your OS, and get raw IP 
packets, then you have to do the reassembly yourself.  But if you open a 
TCP connection, the OS will already do any reordering, retrying, and 
reassembly for you.

Give a specific example of what you're trying, and what piece of it is 
failing for you.

tcpdump or wireshark can be used to examine low level protocol issues, 
if you really have such.  And python + scapy can generate pretty 
arbitrary packets.  But I rather doubt that's what you want.


-- 
DaveA

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web