Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

TCP Retransmissions

Name: Anonymous 2009-01-04 23:05

Ordinarily, you're a terrible place to get code, /prog/, but I must yield.

I'm having trouble with AES encryption increasing on packet retransmissions, so I obviously must detect and discard retransmissions for encryption purposes. Since I'm using WinPcap, I figured that Ethereal would be a good place to go to see how it detects these events. I was wrong.

Example: http://pastebin.com/d165a8f15 [1]

I can't tell what the shit is going on with such ugly C code. Any of you have an enterprise-level solution to retransmission detection? Thanks for your time.

1: As accessed on 4 JAN 09 at 10 PM CST. It will evaporate within 24 hours.

Name: Anonymous 2009-01-06 12:48

>>40
So fucking what? The target will be inlined in Jcc just as in JMP.  No fucking target prediction.

Name: FrozenVoid !FrOzEn2BUo 2009-01-06 12:52

There is difference:
example JMP :
"This instruction is used to deviate the flow of a program without taking into account the actual conditions of the flags or of the data."
exmaple JA Label
"This means that the jump is only done if the CF flag is deactivated or if the ZF flag is deactivated, that is that one of the two be equal to zero."

Which one is faster?

Name: Anonymous 2009-01-06 12:56

>>42
With branch prediction, none is faster.

Name: FrozenVoid !FrOzEn2BUo 2009-01-06 12:59

>>43
Its faster to inline direct JMPs then predict what conditional/boolean JMP will do.

Name: Anonymous 2009-01-06 13:01

>>42
Also what the fuck does that have to do with gotos being faster than regular control structures anyway? You must be talking about using goto to leave inner loops or shit like that. That doesn't have anything to do with JMP being faster than Jcc. Just fucking die already, you fucking /g/-dwelling troll.

Name: FrozenVoid !FrOzEn2BUo 2009-01-06 13:05

>>18 says "Both goto and if/else becomes jcc in ASM anyway"
Which is plain wrong. Goto can compile to direct JMPs
in QBasic:
goto "end"
goto 20;

"You must be talking about using goto to leave inner loops or shit like that." Thats just like >>18 thinks

Name: Anonymous 2009-01-06 13:06

>>44
Why the fuck would you even make that comparison? What the fuck is your fucking point anyway? Also why don't you fucking write clearly, you fucking asspie? Is Enlish not your 1st language or something? God damn...

Name: FrozenVoid !FrOzEn2BUo 2009-01-06 13:08

>>47
English is my third language, however due constant practice i write very well.

Name: Anonymous 2009-01-06 13:10

>>46
My god, you fucking robot. What the fuck do you mean by gotos being faster than control structures then?

Name: Anonymous 2009-01-06 13:10

>>48
Oh, believe me, you don't. Not even close.

Name: FrozenVoid !FrOzEn2BUo 2009-01-06 13:17

>>49
I'm not sure if its worth explaining if you can't understand what i say.see http://en.wikipedia.org/wiki/Goto
this post quoted:
http://kerneltrap.org/node/553/2131

"Used over short distances with well-documented labels, a "goto" can be more
effective, faster, and cleaner than a series of complex flags or other
constructs. The "goto" may also be safer and more intuitive than the
alternative. A "break" is a goto; a "continue" is a "goto" -- these are
statements that move the point of execution explicitly.
"

Name: Anonymous 2009-01-06 13:20

>>51
That's what I said in >>45, you cunt.

Name: FrozenVoid !FrOzEn2BUo 2009-01-06 13:20

another quote from above:
That said, I have used exactly two "goto" statements in all the lines of C,
C++, Fortran 95, and (yes) COBOL I've written since leaving BASIC and
Fortran IV behind. In one case, a single "goto" doubled the speed of a
time-critical application; in the other case, "goto" shortens a segment of
code by half and makes the algorithm much clearer. I would not use a goto
willy-nilly for the fun of it -- unless I was entering an obfuscated code
contest ;)

We keep lowering the bar for technical prowess, it seems; if something has
the potential to be used "wrong", high-minded designers remove the offending
syntax rather than find or train competent programmers. This is why Java
removes pointers (among other things) -- it's not that pointers aren't
useful or efficient, it's that they require discipline from programmers.

Just because something is dogma doesn't mean it is absolute truth. If
anything, dogma should be sniffed quite carefully, since it tends to be
rather rank if you get close enough. Removing goto is a religious choice,
not a technical one.

I could draw parallels with idiotic laws in general society, but this
message is already marginal for this list.

Name: Anonymous 2009-01-06 13:27

STOP. TALKING. TO. HIM. YOU. STUPID. FUCKERS.

Name: Anonymous 2009-01-06 13:29

STOP SEEING HIS POSTS YOU STUPID FUCKERS

Name: FrozenVoid!FrOzEn2BUo 2009-01-06 14:26



    STOP SEEING MY POSTS YOU STUPID FUCKERS

Name: FrozenVoid!FrOzEn2BUo 2009-01-06 18:51




STOP PEEING MY GHOSTS YOU STUPID FUCKERS

Name: BurningSpace !TvdgKuS4ZM 2009-01-06 20:46

Why don't you use a JAVASCRIPT-based solution if you want to stop seeing them?

Name: Anonymous 2009-01-06 23:15

Meanwhile, back on the farm
>>1
Trying to read and understand code can often be difficult for large or complicated projects (I tried to read through parts of ffmpeg once open source? more like why the fuck do I need to document anything?).

Try running the project through Doxygen to make it easier to to cross-reference. of course that didn't make ffmpeg any easier to understand

There's also a program I ran across once whose sole purpose was for reading, browsing, and cross-referencing C/C++ code. Don't have the link on my atm.

Name: Anonymous 2009-01-06 23:27

>>59
learn c, problem solved.

Name: Leah Culver 2009-01-06 23:43

This thread has been closed and replaced with the following thread:

Subject: Discharges
Name: Leah Culver
Email: leah@vox.com

Body:

Hi guys, I know that you are mostly guys, but I hope there is at least one girl here that is able to help me. I have been having vaginal discharges recently. The discharge is a green-ish color and smells like cottage cheese mixed with coffee. Any help appreciated.

Name: Anonymous 2009-01-06 23:52

>>60
Brilliant, I managed to learn C in the last hour and can now read this <http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/mdec_8c-source.html>; with perfect clarity. My understanding of the code is deep and insightful. Why, I already identified dozens of bugs and can see the purpose of meaning within the delimiters.

0/10

Name: Anonymous 2009-01-07 0:23

It doesn't matter anyway because reconstructing a tcp data stream is fucking trivial.  You don't ``detect retransmissions'', you just copy down the byte ranges you see and consume everything up to the first hole.

Name: Anonymous 2009-01-07 3:49

>>64
Not really debug, just maintain the integrity of.

Currently, I check the current packet in any given direction for being exactly the same as the previous packet in the same directional sequence, but this does not seem to be enough.

Name: Anonymous 2009-01-07 4:21

>>66
I tried creating a class that contains 20 sequence numbers (arbitrary number that I figured was "good enough") and each time I receive a packet, I assign the sequence number to this array.

When I receive the 20th packet, it resets the index so it should be a rolling window.

However, when I check for matches of the current sequence number, it would seem that either it fails or somehow the code skips that if.

I've had it check to see if there's a match for the direction of the packet and I've had a single unit for sequence testing. Neither works. It's supposed to be: If a sequence number matches, then nothing happens until it gets the next packet.

What does happen is the encryption breaks nearly immediately. So either sequence numbers are matching when they aren't supposed to or they aren't matching when they are.

Logically, it's structured in the way that <capture device> <-> <session encryption/decryption/distribution> <-> <data interfacing>.

This means that it doesn't account for packets that don't get fed into the session. Ideas?

Name: Anonymous 2009-01-07 4:37

>>67
First line may be a bit ambiguous. I only assign sequence numbers if no matches are found first.

Name: Anonymous 2009-01-07 4:53

Not really. Testing on my home network connecting to an enterprise network at the moment. Interestingly enough, the stream that goes from here to there breaks first 100% of the time with my last version.

I moved the code to the dispatch spot instead of a higher scope and it seems to be faring much better. I also increased the number to 200.

However, I still have increased issues with just plain not dispatching any more packets period. On a positive note, it doesn't seem like the encryption is falsely increasing .. in my limited testing.

Name: Anonymous 2009-01-07 5:30

>>70
Still yields broken streams. I don't think this particular implementation of sequence checking is going to work out.

Name: Anonymous 2009-01-07 12:30

>>68
Are you assigning your own sequence numbers? You need to use the TCP sequence number from the TCP header to detect retransmissions.

Name: Anonymous 2009-01-07 15:25

>>73
I was using the TCP sequence numbers.

Name: Anonymous 2009-01-07 15:55

>>74
EXPERT TCP PROGRAMMER

Name: Anonymous 2010-12-17 1:33

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2011-01-31 19:54

<-- check em dubz

Name: Anonymous 2011-06-22 13:16

bump

Name: 2012-01-25 23:00


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List