@rkenmi - TCP/IP and HTTP - Part 1

TCP/IP and HTTP - Part 1


A basic run down of TCP/IP and HTTP.

TCP/IP and HTTP - Part 1


Back to Top

Updated on May 28, 2017
A Very Brief History

TCP/IP stands for Transmission Control Protocol / Internet Protocol.
During the Cold War, in retaliation of the USSR's Sputnik, the U.S. Department of Defense (DoD) started ARPA, the Advanced Research Projects Agency.

This agency created a an ancient network called ARPAnet (the ancestor of the Internet) and a few protocols, namely TCP and IP, as the means of data transport.

ARPAnet is the first packet-switching network and consequently, the TCP/IP protocols are created to deal with packets.

Model Layers

TCP/IP's DoD model is comprised of 4 layers:

  • Process/Application layer
    • Dealing with the protocols for handling the communication between applciations. For example, the talking between the software client you might use for SSH, and the SSH server.
  • Host-to-host/Transport layer
    • Dealing with the handling of packet sequencing, and data integrity. TCP is a reliable network protocol.
  • Internet/Network layer
    • Dealing with the logical transmission of packets.
    • Does the IP addressing. (ex: 192.168.0.1)
  • Link layer
    • Dealing with the physical stream of bytes, or transmission of data.
    • Does hardware addressing. (ex: MAC address)
HTTP and the 3-way handshake

HTTP (Hypertext Transfer Protocol) is a network protocol based on TCP. More specifically, HTTP uses the Transport layer (above).

It is the protocol that allows us to view and interact with webpages on our browsers.

HTTP transactions work like the following:

  • Client sends a request to a Server
    • C: "Hi Server, I want to connect with you"
  • Server sees the request and gives back an acknowledgement response
    • S: "Hey C, I got your request. I want to let you know that I acknowledged it!"
  • Client gets back the acknowledgement response and sends back another response to confirm.
    • C: "Thanks for the acknowledgement S, I just want to let you know that I got your message!"

This friendly scenario between the Client and Server is called the 3-way handshake, and it is a definitive characteristic of TCP. Scenarios like these occur very, very frequently when we browse random webpages.

For an example, if I go to some webpage about ducks, there might be a lot of 3-way handshakes going on. One of the handshakes could be between your browser and the server where the website is located. But the website server could also be making handshakes to other strange servers to get some cool stuff, like styling for the webpage, or code libraries to make their webpages more seamless and modern.

Latency

Latency is measured by RTT, or Round-Trip Time. This is the time it takes for a packet to be sent from one end of a connection to the other, and back. In the above scenario, there were 2 round trips.

alt Terms

  • RTT = Round-Trip Time
  • SYN = A packet that indicates a new connection to be established.
  • FIN = A packet that signifies that this is the last package from the sender
  • DAT = A data packet
  • ACK = An acknowledgement packet

TODO:

  • More detailed information about latency and packet handshakes

Article Tags:
networkinghttptcpiptcp/ip