Sunday, April 5, 2009

Link Layer of TCP/IP Protocol

  • Link Layer
Link layer mainly concerned with the sending and receiving the IP packets of IP module,ARP request an reply for ARP module,RARP request and reply for RARP module.Link layer varies depends on the type of network we are using for eg: Ethernet,TokenRing,FDDI,Serial etc.

Ethernet Frame
Description :
It is an encapsulation of Ethernet header to various packets such as IP packet,ARP,RARP,DATA etc.
Destination Address : 6 bytes MAC Address.
Source Address : 6 bytes Source MAC Address.
Length field follows address if it is 802 packet else it contains type follows data.
for Ethernet 802 packet minimum data size is 38 and for 803 it is 46.

SLIP (Serial Line Internet Protocol)

It is a Encapsulation of IP packet,data etc. SLIP is mainly used to connect with internet through RS232 serial port cable almost present in all types of PCS.
SLIP is terminated with special SLIP_END character that is 0xC0. If 0xC0 character is present in actual data it is replaced with 0xdb, 0xdc. If db is present in actual data it is replaced with 0xdb, 0xdd.

Deficiencies of SLIP
-> Each end must know others IP Address.
->SLIP packet can be transmitted in any protocol because we are not using any type field.
->There is no Checksum.

PPP (Point to Point Protocol)

The format of PPP looks like

The frame begins and end with a flag whose value is 0x7e, address whose value is always 0xFF and a control byte with a value of 0x03. protocol field tells the type of data it can store.

if protocol equals to 0x0021 means information field of an IP datagram.
if protocol equals to 0xc021 than it is link control data.
if protocol equals to 0x8021 than it is Network control data.

Maximum Transfer Unit:

There is a limit on the size of frame for both Ethernet encapsulation(1500) and 802.3 (1492) encapsulation.

FDDI- 4352.
Ethernet- 1500 .
IEEE 802.3/802.2 - 1492.

path MTU : It is the maximum transfer unit between two hosts at short interval. It always change depends on the different network.
if one is Ethernet and other is 802.3.

Thursday, April 2, 2009

TCP/IP Tutorial and Technical Overview

  • Introduction
This tutorial is helpful for understanding TCP/IP stack,Writing Network programs,Network System administration, Writing TCP/IP applications. TCP/IP is a collection of layers.Each layer contains some list of protocols which perform specific function. Generally TCP/IP contains 4 layers.

  1. Application Layer : mail,telnet
  2. Transport Layer : UDP,TCP
  3. Network Layer : IP,ICMP,IGMP
  4. Link Layer : Drivers
Link layer sometimes called as data link layer or network interface layer.They handles all types of hardware details.

Network layer(internet layer) is used for routing of packets between various networks.

Transport layer provides data transmission between hosts.In transport layer two protocols are used
transmission control protocol and User Datagram protocol.

  1. TCP : Reliable transmission of data between two hosts,Exchange of acknowledge takes place for reliable transmission. We can easily set the timeout for the transmission.Application should not have to put any effort to check data reliability.
  2. UDP : Unreliable flow of data.Some mechanism in application layer has to be implemented to check reliability.
Application layer is mainly at user level and other three layers are at kernel layer.

when one or more computers connected together it forms LAN. When two or more networks are connected together it is called as Inter Network or Internet. The hardware which is used to connect two networks is called as Router. Example of network are Ethernet, Token ring, FDDI ( Fiber distributed data Interface). Router connects Network at Network layer but Bridge connect different networks at datalink layer.Bridges makes appearance of multiple network to upper layer as same Network.
  • Internet Address
Internet address contains 4 bytes. Internet address is divided into 5 classes.
Easy way to remember is shift one bit from the left to right by adding 1's.

Class A : Range : to

Class B: Range : to

Class C: Range : to

Class D: Range : to
(Multicast Group Id)

Class E:Range : to ( Reserved for future use)

The Internet Network interface Center is responsible for assigning the IP Address to Various Networks.

IP Address is divided into three parts:
1) Unicast : Only for single host in a Network.
2) Multicast : set of hosts in a Multicast Group.
3) Broadcast: All the hosts in a given Network.

DNS: Domain Name System is a Distributed database that provides the mapping between IpAddress and hostname. For remembering of Hostname Easily.

Adding headers to the data is called Encapsulation and removing headers is c
Application to transport layer : Plain Data.
Transport to IP layer : TCP Segment.
IP layer to Network layer : IP segment
Network layer to link layer: frames.

Network always contains one Client and one Server.
Client send request and server process the request in 2 ways either iterative or concurrent way.

Iterative one request at a time.Concurrent Many request at a time.

Port Numbers are mainly used to identify the type application we are working. The well known port numbers are from 0 to 1023. for eg : ftp on port 21, telnet 23,tftp on 69 etc.The well known port numbers of TCP/IP are managed by Internet Assigned numbers Authority.

Epemeral ports: These are port numbers which can be used by Applications in their hosts. Every Application port must be unique.Most TCP/IP applications use epemeral ports in the range from 1024 to 5000.
Some examples of reserved ports are:
echo = 7 ( server sends whatever client sends).
discard = 9 ( Server discards whatever client sends).
daytime = 13 (server sends date and time to client in human readable form).

Internet = collection of hosts around the world that communicate using TCP/IP
internet = multiple networks connected together using common protocol suite.