TCP/IP by noODle
Whenever you connect your box to the internet you use set of standards for computer communication known as: The Transmission Control Protocol/Internet Protocol stack. The stack has other protocols built in serving several purposes. It was created to be a secure and reliable protocol to use in WAN enviroments. The TCP part uses a three way handshake to be connection oriented. IP uses packetized data to transmit information. TCP/IP has been implemented in many different platforms like MacOS, Linux and Windows.
First there was UDP (Universal Datagram Protocol). UDP and TCP both use IP to transmit data. In contrary to TCP UDP doesn't garantee the delivery of all of the packets. A UDP header contains the following information
Source port. 16 bits.
Destination port. 16 bits
Length. 16 bits
UDP checksum. 16 bits.
The source port and the destination port are virtual (software) ports used for computer to computer communication. They astablish the connection. The length specifies the packet size the network can handle. And the checksum generates a checksum.
The three way handshake.
TCP works at the 4th level of the OSI model and keeps track of what has been transmitted. Lost transmissions (this happens cuz packets can die, i'll explain later) are retransmitted. When TCP recieves data it is cut into packets with a size the connection can handle and marked with a TCP header. The header acknowledges if all data is transmitted and thus provides guaranteed delivery.
A TCP header contains the following:
Destination port. Both are 16 bits.
Acknowledge number. Both are 32 bits.
Data offset. 4 bits
Reserved. 12 bits. Things like URG, ACK, SYN, FIN.
Window. 16 bits.
Checksum. 16 bits.
Urgent Pointer. 16 bits
The extra data that TCP uses over UDP are all error related as you can see. The 12 bits marked 'Reserved' are connection related. This data does things like synchronizing or finishing the connection. This is also where the 3way handshake takes place.The sending computer sends a request to see if the other end is alive. This computer sends back an acknowledge if it's alive and waits for a synchronization event. After this the actual data is transmitted. The computer on the recieveing end reassembles the packets (this is done with the info from the headers) it gets to recreate the original data.
The Window octets prevent a fast computer from overflowing a slow one by specifieing the amount of data the recieving computer can handle.
IP recieves TCP or UDP packets and marks them with an IP header. Once this is done the data goes to the hardware ready for transmission. (actually there is one more step before it reaches the hardware, read OSI for info) It works on OSI level 3. The packets travel through the network individually, each one takes the best route preventing network traffic jams,
The IP header contains lots of info. :)
Version. 4 bits on the IP version (for compatibility options)
IHL (internet header length). 4 bits on the length of the header in 32 bits.
TOS (type of service). 8 bits determing the TOS.
Total Length. 8 bits telling the length of the complete diagram (packet).
Flags. 4 bits
Fragment offset. 12 bits. These three solve packet fragmentation problems.
TTL (Time To Live).4 bits counter telling how many routers the packet may pass before it dies.
(This is to prevent data from ending up in never-ending loops,
each router decreases it's value by one,
when it's zero the packet is discarded.)
Protocol. 4 bits determing the higher protocol (TCP, UDP) used.
Checksum. 16 bit error correction.
Destination adress. Both 32(!) bits containing......
The checksum verifies the header was transmitted correctly.
IPv6 is being developed (we currently use v4). This version will allow 128 bit IP addressing.
The current addressing is 32 bits which actually uses four octets. The data in the headers are all octets for that. These 8 bit rows can be transformed to decimals ranging from 0 to 255, seperated with dots. In the early days of the internet you had to specify this address in your browser to connect to sites. Nowadays on most networks you can use FQDN or friendly shortcuts to connect to other computers. You can use subnets to divide a large network into a manageble one.
On top of the TCP/IP suite there are other protocols specified. When you use IRC, FTP, e-mail or browse the web you are using these protocols.
/* Protocols are standards accepted by manufacturers. Implementations can vary per producer.
These protocols are all defined in documents known as 'request for comments'.
The RFC 1310 describes how these standards are created and documented.
Because the internet evolved from the ARPAnet in the early seventies in today's web it has undergone some change and will have changes in the future. The primer remains the same.
TCP/IP provides the functionality for the protocols laying on top by using the virtual ports to establish connections. When you surf the web your browser uses port 80 to communicate with the server. There is a more secure implemantation of HTTP, HTTPS. It uses port 443. The protocols on top of TCP/IP provide TCP with their own header to provide TCP enough info to establish a connection.