Introduction blablabla…
TCP provides session management.
A new TCP session is initialized by the famous Three-Way-Handshake
TCP-flags
SYN– Ask for a new connection
ACK– Acknowledge the receipt of a packet
RST– Cancel a connection attempt (is usually send when a host tries to
connect to a closed port)
FIN– Cleanly close an established connection (must be acknowledged by
counterpart)
URG– Mark a packet as urgent
PSH– Bid the receiver to handle packet with higher priority
An Example Network
An Ethernet/TCP/IP network is what you nowadays think of if you hear the term
network,because it is by far the most common one. Its constructed of five layers
instead of the theoretical seven layers of the ISO/OSI model. For short refreshing:
Ethernet is on layer 2, IP(Internet Protocol) on layer 3, TCP(Transport Control
Protocol) or UDP on layer 4-6 and services like HTTP,SMTP,FTP on layer 7.
How a HTTP packet passes all those layers one after another.
We want to get the index page of www.google.com .
(1) Our computer parses the URL www.google.com into the following components:
HTTP as application protocol to be used.
the hostname www
the domain google
the Top-Level-Domain com
/
(2) Armed with these information our computer constructs the following HTTP-Header(Layer 7):
GET / HTTP 1.1
Host: www.google.com
(3) Next we head on to TCP (layer 4-6). It establishes a connection by the use of the
Three-Way-Handshake addressing the destination port 80(HTTP) and a random source
port to connect the browser with the network.
(4) IP (layer 3) recognize that it cannot use www.google.com for addressing since it can only
use IP addresses such as 12.34.56.78 so it makes a DNS query to resolve the IP for the
hostname.
Now IP checks if the destination host is in the same network as our computer.
This is not the case therefore a lookup into the routing table is necessary to retrieve
the address of the next hop.