Posts

Data transmission over TCP

Image
Data transmission over TCPIn the first article we discussed how the TCP connection initiation and termination is performed and how we can see this in Wireshark. In this article, we will discuss the actual TCP data transmission procedure.TCP analysis articlesTCP connection establishment and terminationData transmission over TCPThe happy scenarioTCP is using the cumulative acknowledgement approach, in which the TCP receiver is normally sending an ACK that represents the amount of contiguous data it got. The procedure of TCP transmission is as followsAt the connection start, each side of the connection picks some random number called initial sequence number ISN. This number represents the number of the first byte this side will send to the other side. To make analysis easier, Wireshark will show this field starting from 0 but you can get the actual sequence number from the raw sequence number field on the Wireshark expert view.For each byte sent, the transmitting side will increase the s…

Basic TCP analysis with Wireshark - Part 1

Image
Basic TCP analysis with WiresharkTCP is a reliable connection-based protocol that is used by many of the application layer protocols we use every day. HTTP, HTTPS, and FTP are only a few examples from the list. This is the first article in a series that illustrates the basics of the TCP protocol and its analysis using Wireshark. Basic knowledge of how to use Wireshark is needed.TCP analysis articlesTCP connection establishment and terminationData transmission over TCPWhat is TCPThere are many transport layer protocols, from which TCP and UDP are the most popular. TCP is an acronym for Transmission Control Protocol and it has the following characteristicsConnection based: In TCP, a connection is established between the two communicating hosts and the state of this connection is maintained on the two hosts. Usually, the two hosts are named client and server and the client is the host who initiates the connection to the server.Reliable: TCP is a reliable protocol. It will add a checksum…

C++ enums

C++ enumsC++ enum is a user-defined type that allows us to give textual names for integer values. Using enums you can increase code readability and reduce the probability of faults due to usage of hardcoded values. I will talk here about C++ different enumerations types and usages. Note that at least C++ 11 is required.In C++, there are two types of enumsScoped enumsUnscoped enumsUnscoped enums - called also plain enums - are very similar to the C language enums. We will start with them illustrating their C like usage, then introduce the new features added to them on C++.Unscoped enumsYou can use enums in C++ the same way as in C. The following code creates an enum that represents the traffic sign colors// Creating an enum for the traffic sign light colorsenum trafficSignColors { red, yellow, green, }; Enumerators have an integer type that can at least hold it's enumerators' greatest value. By default the first enumerator will have the value of 0 and the value will…