‫The transmission control protocol TCP provides a communication service at an intermediate level between
‫an application program and the internet protocol.
‫It provides host to host connectivity at the transport layer of the internet model.
‫DCP works with the Internet Protocol IP, which defines how computers send packets of data to each other.
‫Together, TCP and IP are basic rules defining the internet.
‫TCP is a connection oriented protocol, which means a connection is establish and maintain until the
‫application programs at each end have finished exchanging messages.
‫It determines how to fragment application data into packets that networks can deliver, sends packets
‫to and accepts packets from the network layer, manages flow control and because it is meant to provide
‫error free data transmission handles retransmission of dropped or garbled packets, as well as acknowledgement
‫of all packets that arrive.
‫Let's see the connection oriented, error free communication of TCP and an example when a web server
‫sends an HTML file to a client.
‫It uses the HTTP protocol to do so.
‫The CDP program layer asks the TCP layer to set up the connection and send the file.
‫The TCP stack divides the file into packets, numbers them and then forwards them individually to the
‫IP layer for delivery.
‫Although each packet in the transmission will have the same source and destination IP addresses, packets
‫may be sent along multiple routes.
‫The TCP program layer in the client computer waits until all of the packets have arrived, then acknowledges
‫those it receives and asks for the retransmission on any it does not based on missing packet numbers,
‫then assembled him into a file and delivers the file to the receiving application.
‫The TCP Three-Way handshake is a method used by TCP to set up a connection.
‫He three three-way handshaking technique is often referred to as Sin Sinek Ach.
‫Because there are three messages transmitted by TCP to negotiate and started TCP session between two
‫computers.
‫This three way handshake process is also designed so that both ends can initiate and negotiate separate
‫TCP socket connections at the same time.
‫That means the connection is full duplex.
‫You know what?
‫We have to take a break at this point and talk about TCP flags.
‫There are one bit flags in TCP headers, which are called TCP flags, TCP flags are used within TCP
‫packet transfers to indicate a particular connection state or provide additional information.
‫Ignoring easy CW, R and an s flags for now, they're basically Six TCP flags.
‫The in or synchronization flag is used as a first step in establishing a three way handshake between
‫two hosts.
‫Only the first packet from both the sender and the receiver should have this flag set.
‫The act flag, which stands for acknowledgement, is used to acknowledge the successful receipt of a
‫packet.
‫The rest flag, which stands for Reset, get sent from receiver to the sender when a packet is sent
‫to a particular host.
‫That was not expecting it.
‫The Finn flag, which stands for finished means there is no more data from the sender.
‫Therefore, it is used in the last packet sent from the sender.
‫The peace flag, which stands for Bush, is somewhat similar to the U.S. flag and tells a receiver to
‫process these packets as they are received instead of buffering them.
‫The ARE flag is used to notify the receiver to process the urgent packets before processing all other
‫packets.
‫So every legitimate TCP connection begins with a DHCP Three-Way handshake, which is used to exchange
‫sequence numbers so that loss packets can be transmitted and packets can be placed in the proper order.
‫If Machina wants to initiate a connection to Machine B, it will start by sending a TCP packet with
‫a sin control bit set.
‫This packet will include an initial sequence number, which I'll call here is an A because it comes
‫from machinery.
‫Which is 32 bits long and typically generated in a pseudo random fashion by the DCP software on the
‫shiny.
‫The act, no, another 32 bits in the TCP header is typically set to zero because it is ignored in this
‫initial sin.
‫Some operating system variants may make this act no non-zero, but either way, it's ignored by the
‫destination machine.
‫So if the destination port is open, that is there is something listening on that board, it must respond
‫with a snack packet back a packet that has both the Senate and Act control bits set at the same time.
‫This packet will have a sequence number of ice and be a pseudo random number assigned by Machine B for
‫this connection.
‫The sinek packet will have an acknowledgement number of ES and a plus one indicating that Machine B
‫has acknowledged this in packet from Machine A.
‫To complete the three way handshake, Machina responds with an act packet which has a sequence number
‫of ESN a plus one.
‫It's the next packet, so the sequence number has to change from the value in the original sin packet.
‫The acknowledgment number field is set to and B plus one, thereby acknowledging the snack packet.
‫Right?
‫So we have now exchanged sequence numbers, all packets going from A to B will have increasing sequence
‫numbers starting at Ismay, plus one going up by value of one for each byte of data transmitted in the
‫payloads of eight B packets.
‫Likewise, all responses back from B.
‫We'll have sequence numbers starting again is and B plus one.
‫And going up for each byte of data from bit away.
‫In essence, we have two streams of sequence numbers in the series packets one from A to B, originally
‫based on Iceni and the other from B2, A originally based on IAC and B.
‫Perfect.