CS Basics: Understanding Data Packets, Protocols, Wireshark

Quest

I am trying to talk to SRCDS Server from node.js through the RCON protocol . The RCON protocol seems to be reasonably explained, implementations can be found at the bottom of the site in all major programming languages. Using them is simple enough, but understanding the protocol and development of the JS library is what I intended to do.

Background

As a self-taught programmer, I missed a lot of Computer Science Basics - I only found out what I needed to accomplish what I wanted. I started coding with PHP, ended up wrapping my head around OO, talking to databases, etc. I am currently programming with JavaScript, more specifically doing web things with node.js ..

Binary data?!?!

I have read and understood the absolute binary basics. But when it comes to packet data, I'm completely lost. I would like to read and understand the conclusion of wirehark, but I cannot make any sense if this happens. My biggest problem is probably that I don’t understand what the binary representation of various INT and STRING (char ..) from JS looks like and how I convert the data received from the server into something suitable for use in the program.

reference

, - . , ", , , C.S.".:) PHP, ( ) , JS. , , PHP, , JS node.js.

, , . , , , . , , - HOWTO PHP/JS..

!

+3
1

.

, . , , , libpcap . , , .

, :

TCP Header

TCP. . , .

. node. http://nodejs.org/docs/v0.4.8/api/buffers.html - , , , , [0] .

, . https://github.com/a2800276/hexy.js, .

node_pcap

https://github.com/mranney/node_pcap - wirehark, . udp: https://github.com/jmoyers/node_pcap/commit/2852a8123486339aa495ede524427f6e5302326d

mranney "unpack" code https://github.com/mranney/node_pcap/blob/master/pcap.js#L116-171

https://github.com/rmustacc/node-ctype

"" https://github.com/rmustacc/node-ctype/blob/master/ctio.js

, , . javascript, , "Number" "String". - , .. .

:

1) endianness - ( ), ,

2) Javascript Number - node -ctype , javascript Number. , float, double .. - javascript.

, , . , , , GUID .., .

,

, , . . . . , - , . , json , .

, , . Buffer # slice node -ctype, .

+5

All Articles