Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Tuesday, December 30, 2008

Application Layer:

The top layer at which human interacts with several applications.

Some Application layer Protocols are
DNS: resolves the website name into server ip, TCP/UDP Port 53
http: transfer webpage files, TCP Port 80
SMTP: sends mail from application to MUA like outlook express, TCP Port 25
POP: receives mail to outlook express, UDP Port 110
These protocols works on two processes
MTA: sends mail to another server
MDA: sends mail to host
Telnet: connect to remote device, TCP Port 23
FTP: shares file, TCP port 20, 21 (21 connects to remote device, 20 sends data)
DHCP: dynamically get ip from a pool from an ISP.
SMB: file sharing protocol, for linux it’s samba
P2P: works on gnutella protocol to share files

Presentation Layer:
It codes, compresses, and encrypt the application layer data

Session Layer:
Initiate, maintain and terminates session between two hosts.

Transport Layer:

It takes application layer data and. It enables more than one application to communicate simultaneously through the network and the data doesn’t get mixed. It segments data into segments so that if data lost then only that segment needs to be retransmitted. It controls data speed, if data is lost frequently then it slows down the communication. It assigns each application a port number and it is attached the segment so that the transport layer at the other end can determine which application will get the data.

The used port numbers are
Well known processes: like http, ftp etc that runs on server, 0-1023
Registered Ports: The applications that each host uses, 1024-49151
Dynamic or Private: The port number when using for initial connection, 49152-65535

When the destination device receives data at transport layer, it sees the sequence number and reassembles several segments, sees the port number and gives the data to the appropriate application layer apps.

The two common protocols are
TCP: uses sequence number, acknowledgments, flow control etc. so has large overhead usually used in application where data lost has severe effect like web pages, file transfers
UDP: connectionless, no acknowledgement, just stand and deliver. It has very low overhead so it’s best effort connection. Usually used in VOIP, or video chat.

Three way handshake:
It uses three way handshake when initializing a new connection.
Firstly, the sender sends a segment with SYN flag=1 with initial seq. number (ISN). Secondly, when the receiver gets it, it sends the transmitter a segment with ACK no= ISN+1; SYN flag=1, ACK flag=1.
Thirdly, the transmitter acknowledges a segment with SEQ=ack+1; ACK flag=1, SYN=0.