Académique Documents
Professionnel Documents
Culture Documents
Chapter :1
Basics of internet
I.I
WHAT IS INTERNET?
L2
1.1
WHAT IS INTERNET?
Internet is being used in many aspects of our daily life. It has affected and influenced whole
world in terms of business, communication/entertainment, education searches etc. Internet is a
well structured and organized system. The roots of today's internet are in the ARPANET
(Advanced Research Projects Agencies Network) which was started by America's Department of
Defense in 1960's. In 1969, the four nodes i.e. (1) University of California, Los Angeles (2)
University of California Santa Barbra, (3) Sanford Research Institute and (4) University of Utah
were connected together to from a network and the software was provided for communication
called as NCP (Network Communication Protocol). It was the starting of internet.
A network is a group of connected computers and / or other devices such as printers for
communication and an Internet is a group of networks communicating with each other. The
protocols used for communication over the internet are TCP and IP. These are combined together
to form TCP/IP protocol suite, where TCP stands for TCP stands for Transmission Control
Protocol and IP - Internet Protocol.
The following is the list of some important events.
1960: Four node ARPANET was established.
1970: NCP was implemented on ARPA.
1973: TCP/IP development begins.
1977: Internet was tested using TCP/IP protocol suite.
1978: UNIX distributed to academic / research sites
1981: CSNET (A network supported by national science foundation) established.
1983: TCP/IP becomes official protocol for ARPANET.
1983: MILNET was born
1986: NSFNET established
' 1990: ARPANET replaced by NSFNET
1995: NSFNET goes back to being a research network
1995: Companies known as ISP (Internet service providers) started.
Basics of Internet
Syntax:
It defines the structure or format or data. Semantic refers to meaning of each section of bits
defined in the syntax, how the pattern is interpreted and what action is to be taken. Timing refers
to things (1) When data is to be sent (2) How fast the data is sent.
Standards:
Provide guidelines for manufacturers, vendors, government agencies and other service
providers. They are essential for creating and maintaining an open and competitive market for
manufacturers. They quadrate the international interoperability of data. They fall into two
categories.
(1) De facto: Standards that have not been approved by an organized body but have been
adopted as standards through widespread use.
(2) De jure (by law): Standards that have been legislated by an officially recognized body.
Following are some organizations/committees who took part in developing the standards.
(1) ISO: International Standards Organization
(2) ITU-T: International Telecommunication Union-Telecommunication Standards Sector.
(3) ANSI: American National Standards Institute.
(4) IEEE: Institute of Electrical and Electronics Engineer.
(5) EIA: Electronic Indtistri.es Association
1.3
INTERNET ADDRESSING:
"The host or routers connected over the internet are uniquely and universally identified by a
32 bit binary address called as IP address."
IP Address:
These are 32 bit addresses and one address defines only one, connection to the internet. The
IP addresses are unique and universal. If a device is connected to internet via two networks it
has two IP addresses.
If a protocol uses N bits its address space is 2 N i.e. it can have 2N addresses / connections
available with it.
IP protocol has two versions IPV4 and IPV6 currently being used is IPV4 which uses 32 bits.
Therefore its address space is
232 = 4,294,96/^96
If the address is written in binary notation, the first few bits of address can tell the
J
class of address.
.
In dotted decimal notation also we can identity the class of particular address.
1.4
1.5
CONNECTING DEVICES:
(1) Repeater: It is a device which operates on physical layer of OSI model. Its function is to
receive the signal and retransmit it.
Since the signal has to travel long distances it may become weak after traveled some
distance, due to this the receiver may receive weak signal. Repeaters are the devices which
retransmits the signal with original strength. Repeater extends the physical length, of
network. Repeater doesn't have any filtering capacity. It can connect two segments of a
LAN.
Fig. 1.1
(2) Bridges: Bridge operates at physical and data link layer. It connects two segments LANS.
As a physical layer device it regenerates the signal and as a data link layer device it
checks the physical address.
A Bridge itself has no physical address. It acts only as a filter. A bridge has a table which
is used in filtering decisions.
Fig. 1.2
(3) HUBS: It is also called as multiport Repeater. It is normally used to create connected
between stations in physical star topology.
(4) Router: It is a three layer device which operates on physical, data link and network layers. As
a physical layer device it regenerates the signal. As a data link layer device it checks the
physical addresses. As a network layer device it checks the network layer addresses. A
router connects independent LAN's or WANs to create an internet work.
Fig. 1.4
Switches:
We can have two layer or three layer switch
Two Layer Switch:
It is a bridge with having many interfaces and a design that allows faster performance.
Three Layer Switch:
It is a router with an improved design to allow better performance. A three layer switch can
receive, process and dispatch a packet much faster than a traditional router even though the
functionality is same.
1.6
It is a layered framework for the design of network systems for communication between all
types of computer systems. It consist of seven layers. The model was introduced in 1970's. It
consist of set of protocols used in communication over the internet. Following are the different
layers.
Physical Layer:
At the physical layer the data is represented as bit stream. It contains the physical mediums
and devices used in communication and deals with electrical and mechanical specifications of
the interface. Physical layer deals with following,
(1) Physical characteristics of transmission media. \
(2) Representation of bits as a stream of bits.
(3) The transmission rate i.e. The number of bits sent per second.
-------------,
(4) (4) Error control - Data link layer gives the reliability to physical layer by adding
The N/W layer is responsible for source to destination delivery of packets traveling
through multiple links.
(6)
The network layer adds the header to the packets coming from upper layer, includes the
logical .address of sender and receiver. Network layer ensures that each packet gets from its
origin to its final destination.
(7)
(8) As Routers operate on N/W layer they route the packet to the final destination. One of
the important function of network layers is the Routing.
Transport Layer:
(9)
(10) Is responsible for end to end delivery of the entire message? The network layer does not
recognize any relationship between the packets those reached at destination. It treats each packet
independently whether or not they belong to same message. Transport layer ensures that whole
message arrives intact and in proper order, overseeing error control and flow control. The
transport layer also does the segmentation i.e. the message is divided into segments having
sequence number.
(11) Like data link layer transport layer is responsible for error control and flow control. One
more function of transport layer is connection control. It can give both connection oriented as
well as connectionless service. ,
(12)
Session Layer:
(13) It is a dialog controller layer, it establishes, maintains and synchronizes the interaction
between source and destinations. For the dialog control session layer allows the communication
between two processes in half duplex and full duplex mode.
(14)
Presentation Layer.
(15)
exchanged
and destination.
(16) The responsibilities of presentation layer includes translation (encoding), Encryption and
decryption, and compression of data.
(17)
Application Layer:
(18) The application layer is responsible for the interaction of user (human or software) with
internet. It provides uses interfaces and services like gmail, file transfers and sharing of
information,'and directory services.
(19) 1.7
(20)
(21) Fig.
(22)
(23)
(24)
Chapter 2
Internet Protocol
(IP)
2.1 IP INTRODUCTION
2.2 IP DATAGRAM
2.3 FRAGMENTATION IN IP
2.4 CHECKSUM CALCULATION
2.5 OPTIONS USED IN IP
2.6 IP PACKAGE
2.7 INTERNET PROTOCOL VERSION 6 (IPV 6)
2.8 PROBLEMS
2.9
2.1
IP INTRODUCTION:
2.10 IP is called as connection less unreliable protocol. It is one of the protocol of TCP/IP
suite. It is combined with TCP to achieve more reliability while transmitting data. The data at IP
is represented in the form of datagram. As IP is a connectionless protocol datagram can follow
different routes to reach the destination. Therefore the problems of out of order arrival or
corrupted datagram may pour during transmission. To avoid these problems IP relies heavily on
higher level protocols like TCP:
2.112.2
IP DATAGRAM:
2.12
(1) VER: It is 4 bit field identifies version of IP protocol, i.e. IPV4 or IPV6. The current used
version is IPV4.
(2) HLEN: This field gives total length of header in a 4 byte words. When there are no options,
header length is 20 bytes and when the option field is at its maximum size the value of this
field is 60 bytes. Hence minimum length of Header is 20bytes.
(1) DS (Differentiated Services):
IETF (Internal Engineering Task Force) changed the interpretation and name of
services field. Previously it was called as service Type and now it is called as Differentiated
Services.
2.13
2.15
can be either 0 or 1. One and only one of the bit can have the value of 1 in ea diagram
with only 1 bit set at a time, we can have five different types of services.
2.23
2.24
2.1
2.25
2.26
In this interpretation, the first 6 bits make up the code point subfield, and the
last 2 bits are not used. The code point subfield can be used in two different ways.
2.27
(i) When the 3 right most
bits
are
Os,
the
3
leftmost
bits
are
interpreted
the
same
as the precedence bits in the service type interpretation. In other words, it is
compatible with the old interpretation.
2.28
(ii) When the 3 rightmost bits are not all Os, the 6 bits define 64 services based
on the priority assignment by the Internet or local authorities. The first category contains 32
service types; the second and the third each contain 16. The first category (numbers, 2, 4, ...,
62) is. assigned by the Internet authorities (IETF). The second category (3, 7, 11, 15, ..., 63)
can be used by local authorities (organizations). The third category (1, 5, 9, ..., 61) is
temporary and can be used for experimental purposes. Note that the members are not
contiguous. If they were, the first category would range from 0 to 31, the second from 32 to
47, and the third from 48 to 63. This would be incompatible with the TOS interpretation
because XXX000 (which includes 0, 8,16, 24, 32, 40, 48 and 56) would fall into all three
categories. Instead, in this assignment method all these services belong to category 1. Note
that the assignments have not yet been finalized.
2.29
2.30 (4) Total Length: It is a 16 bit field that defines total length of IP datagram in bytes.
(5) Identification, flags, Fragmentation offset are the fields used for fragmentation will be
discussed later.
,
(6) Time to live: A datagram has a limited lifetime In its travel through internet. The TTL field
limits lifetime for the datagram when a router processes a request. It decrements the TTL
field by 1 and if the value is 0 (zero) it will drop the packet.
(7) Protocol: This 8 bit field defines the higher level protocol that uses the services of IP layer.
This field specifies the final destination protocol to which IP datagram should be delivered.
IP datagram can encapsulate data from several higher level protocols such as ICMP, IGMP,"
UDP and TCP.
(8)
(8) Header Checksum: The checksum concept is used for error control, will be discussed later.
(9) Option: Only 6 options are currently being used, they are included in the variable part at the
IP datagram. They are not required for every datagram. They are used for Network testing
and debugging.
(9) Format for Option:
(10)
(11)
2.3
FRAGMENTATION IN IP:
(12) A datagram can travel through different networks. Each router decapsulates the IP
datagram from the frame it receives processes it and then encapsulate it in another frame. The
format and size of received frame and sent frame depend on physical network through which the
frame has just travelled or the frame is going to travel respectively. Sometimes it is required to
divide the datagram to make it possible to pass through different networks. This process is called
as fragmentation. Sometimes a fragmented datagram may also be fragmented if it reaches to the
network of even smaller MTU.
(13)
(14) When datagram is encapsulated in a frame the total size of datagram must be less than
the maximum size which is defined by restriction imposed by underlying software and hardware
used by Network.
(15)
(16)
(1) Identification: This is 16 bit field identifies a datagram originating from source. The
combination of identification and source IP address must uniquely define a datagram when
it leaves the source. To guarantee the uniqueness IP protocol uses a counter. Counter is
initialized to positive number. When IP protocol sends a datagram it copies Current Value of
counter to all the fragments of datagram and increments the counter by one hence all the
fragments have same identification number.
(2) Flags: This is a 3 bit field, the first bit is reserved, 2nd bit is do not fragment and third bit is
for more fragments.
(18)
(19)
D - Do not
fragment M - More
fragments
(20)
(21)__
(22) (3) Fragmentation Offset: This is a 13-bit field showing the relative position of the
fragment with respect to whole datagram. It is the offset of the data in the original datagram
measured in units of 8 bytes.
(23) Consider a datagram with a data size of 4t)00 bytes which is fragmented into 4 fragments.
(24)_____________________
17
(26) The bytes in original datagram will be numbered from 0 to 3999. The offset of these
offset =0/8 = 0.
(29) The second fragment contains bytes numbered from 1000 to 1999.
(30) hence the
(33)
(34)
2.4
CHECKSUM CALCULATION:
(35) It is the error detection method used by IP. Checksum is additional information added to
a packet which is used protection of the packet from corruption. Checksum is calculated at the
sender side and the value obtained is sent with that packet. The receiver does same calculation
on the whole packet. If the result is satisfactory the packet is accepted otherwise it is rejected.
(36)
(37) Steps:
(1) The packet is divided into k number of sections each having n number of bits.
(2) All the sections are added using one's complement arithmetic,
(3) The final result is complemented to make the checksum.
(38)
,T -
(39)
18
Internet Technologies
(B.Sc. IT)
(40)
(1) Receiver also divides the packet into k number of sections each having n bits.
(2) It then adds all sections.
(3) Complement of result is taken.
(4) If the final result is zero then packet is accepted otherwise not. For
example: Consider following IP packet
(41)
4,8,0
(44) 64
->
00000000
(45)
- 00000000
5,17 -
(48)
(49)
01000000
00000001
00000000
00000000
00000101
00010001
00000000
00000000
00001010
00000001
(50) 5,1 -
00000101
00000001 ;.
12,4 ->
00001100
00000100
00000111
00001001
01101111
01100001
(53)
Sum
(56)
00000000
10,1 -
(51)
(54)
-> 01001000
10011110
4,8,0 ->
(59)
64 ->
(60)
1 -
(61)
0,0. ->
00000000
00000000
Checksum ->
(64)
10,1 ->
(65)
5,1 -4
(66)
12,4 ->
(67)
7,9 ->
(68)
Sum
(69)
(70)
00000000
01000000
00000001
00000000
(62)
(63)
01001000 00000000
10010000
10011110
00001010 00000001
00000101
00000001
00001100 00000100
00000111
00001001
11111111 11111111
00000000 00000000
(71)
2.5
(72) IP header is divided into two parts fixed (20 bytes) and variable (40 bytes). The
(73)
variable part contains the options and their maximum size is 40
(75)
(76)
Explanat
(77)
ion: Code:
(78) Field is divided into three parts
(1) Copy: To indicate whether options are to be copied into all fragments or only in the first
fragment.
(2) Class: Indicate the general purpose of the option.
(3) Number: Defines the type of option currently only six types are used.
Length:
(80) Defines the total length of options including code field and length field. This field is not
presented in all option types.
(79)
(81)
Data:
(82) The data field contains data that specific options require. This field is not present in all
(84)
byte option used for padding at the end of option. This can be vided only once in the option to
indicate the end.
2.4
2.6
2.5
(88)
(89)
Record Route:
(90) It is used to record the routers that handle the datagram over internet. It can list
upto nine IP addresses of router. Since maximum size of IP header is 60 bytes including 20
bytes for base header. Remaining 40 bytes left for option part which can be used to store
(92) Strict source route and loose source route options are defined in options of IP datagram. If a
datagram is specified with strict source route option, it must visit all the routers defined in option.
The datagram can not visit any router whose address is not specified in the list, if it does so
datagram is discarded and an error message is issued. Also if a datagram reaches destination without
visiting some of the routers specified in the list, it will be discarded and an error message is issued.
Strict source routing is not used by non-privileged users who are not aware of the physical topology
of the internet.
(93)
(94)
2.6
(95)
IP PACKAGE:
2.7
(96) IP supports several options and processing of options, but the important
components
(97) of IP package are:
(99) It is responsible for adding header to the IP datagram while encapsulating the data, when
it receives data from an upper layer protocol along with the destination IP address.
(100)
(101)
(102)
It is called as heart of an
IP
package.
It
receives
datagram
from
an
interface
or
from
an header-adding module. It processes and routes the datagram regardless of its
sources.
(104)
If the Node to which datagram is being processed is router, it will decrement the
TTL field by one, if the value is less than or equal to zero, the packet will be discarded and I
CMP message is sent to sender (source). If the value of TTL (after decrementing) is greater or
equal to 1, processing module sends the packet to routing module.
(105)
Processing Module:
(106)
(107) (b)
address)
(108)
(109)
(ii) Return.
(110) (c)
If (machine is router)
(111)
(112)
(113)
(iii) Return.
(114) (d)
If (Titlist< = 0)
(115)
(116)
(117)
(iii) Return.
(119) It receives an IP datagram from routing modules. The datagram contains address of
either next station or final destination and interface number through which the datagram is sent
out. The fragmentation module then checks the MTU table to find MTU for specific interface.
Depending on the MTU Fragmentation module fragments, the datagram if required, adds the
header to it and sends them to ARP package for address resolution.
(120)
Fragmentation Module:
(123)
2.1
If (D bit is set C = 1)
2.2
Else
(125)
(126)
(127)
Else.
(128)
(4)
Stop.
(129)
(130) It receives datagram fragments from processing module, which have arrived at their
final destination. The module considers un-fragmented datagram as a single fragment.
(131) Since IP is a connectionless, unreliable protocol, it does not guarantee that fragments
will arrive in order at the destination. Hence it uses reassembly table to handle intermixed
fragments. For proper ordering of fragments. During the reassembly of fragments of a datagram
if established time-out has expired or any fragment is missing then the fragments are discarded.
(132)
Reassembly Module:
(133)
(134)
(1)
(136)
(137)
(138)
(4)
(a)
arrived)
(i) Reassemble the fragments
(139)
(b)
(141)
Else.
(i) Check the time-out.
(142)
26
Internet Technologies
(B.Sc. IT)
(143)
(5) Stop
(5)
(144)
Routing Module:
(6)
Routing Table:
(147)It is used by the routing module to determine next hop address of the packet.
(148)
(7)
MTU Table:
(8)
Queues:
(151)The package uses two types of queues: input queues and output queues.
(152)
store
datagrams
protocols.
(153)
coming
from
data
link
layer
or
the
Input
upper
'
queue
layer
Output queue store datagrams going to data link layer or the upper layer
protocols.
(154)
and,
(155)
(156)
2.7
Fragmentation and reassembly module adds the datagrams into output queues.
Translation (NAT).
.'
(159)
of
internet
and
new
services
may require 1PV6 rather than IPV4.
such
as
mobile
(160)
IPV4:
(161)(T) It has large address space i.e. 128 bits long. (IPV4 = 32 bits therefore 2 32 - 1
IPV6 Addresses:
(164)
(165)To make it readable it uses hexadecimal colon notation, in which 128 bits are divided
into eight sections of 2 bytes in length. Hence, the address consists of 32 hexadecimal digits,
every four hexadecimal digits are separated by a colon. For e>..
(166)
(167)
If the address contains more zero digits, we can abbreviate it to make it more
readable.
(168)
For e.g.,
(169)
(170)
(171)
(172) IPV6 defines three types of addresses - uncast, any cast and multicast.
(173)A packet sent to uncast address is delivered to specific computer.
(174) Any cast address defines a group of computers with addresses having some prefix (i.e.
all computers connected to same physical network). Packet sent to any cast address will be
delivered to exactly one of the member of this group, (generally the closest or most easily
accessible).
(175)
group.
(176)The designers of IPV6 divided the address space into two parts: (1) Type prefix
(178)
(179)
IPV6 Datagram:
(180)
(181)
'1) Version: This is a 4 bit field defining the version number of IP. Its value is 6 for
IPV6.
2) Priority: The 4-bit field defines the priority of packet with respect to traffic
congestion.
(182)
3) Flow Label: It is a 3 byte field provided for special handling for a particular
flow of data.
(183)
(184)
(185)
(186)
6) Hop Limit: This 8-bit field defines number of hops the datagram can travel
before
reaching the destination (same as TTL in IPV4).
(187)
(188)
"I Source Address: Source address is a 16 byte internet address that identifies the
destination internet address. Some Reference Tables related with Datagram: (1) Next
Header Codes:
2.10
(189)
(190)
(191)
(192)
Flow Labels:
(193)
When a sequence of packets sent from a particular, source to particular destination
that needs special handling by routers is called as flow of packets. The combination of source
address and value of flow label uniquely defines a flow of packets. There are
(194)
. ihree rules defined to allow,
effective vise of flow labels.
-.;
(1): Flow label is assigned to a packet by the source host. Label is random number
between 224 - 1. Any source must not reuse flow label for new flow when existing
(195)
(197)
(3)
All packets belonging to same flow have the same source, destination,
priority anc
(198)
options.
(199)
(200)
Header:
(201)
(202)
2.8
PROBLEMS:
Example 1:
An IP packet
(203)
has arrived with the first 8 bits' as shown 01.000010, the receiver discard
racket. Why?
Solution:
(204)
Example 2:'
(208) An IP packet has arrived with first few hexadecimal digits as shown below,
(209)45000028000100000102 is the packet discarded. How many hubs can this packet travel
r-c-ore being dropped? The data being to what upper layer protocol?
(207)
(210) elution:
(211) The even packet is distributed as
(212)
The first digit indicates the version IPV4 similarly. The time to live field is 01 in
(213)
hexadecimal i.e. 0000 0001 in binary, i.e. Value of TTL is 1. Therefore it can travel
through only one router. Therefore packet is discarded when it travels through 1st hub
and the protocol field is 02 i.e. the upper layer protocol used is IGMP.
Example 3:
(215)
An IP packet the value of header length is 1000 in binary. How many bytes of
(214)
(217)
(218)
(219) Example 4:
(220)
In an IP packet, value of header length is (10)i6 and the value of total length field
Solution:
Header length = (10)w =
(222)
(223)
bytes
(0238)16
0000
0010
0011
1000
512 + 32 + 16 + 8 = 568
(224)
(225)
An IP datagram has arrived with the following information in the header (in
(227)
hexadecimal)
(228)
4500005400030000200600007C4E0302B40EOf0
2
(229)
'
(e) How many more routers can the packet travel to?
(f) Is the packet fragmented?
(g) What is the identification, number? (h)
What is the type of service?
Solution:
(e)
(f)
(g)
(b) Haleness.
(j) 5 x 4 = 20 bytes.
(k) Length of header is 20 bytes.
(l) Since header length is of minimum length/size.
(m) (c) Total length field is 0054 in Hex = 0000 0000 0101 0100 in binary.
through 32 routers.
2.13 (g) Fragmentation is decided by flags and flags are
000.
(q)
2.14
(u)
Example 6:
(w) In a datagram, the M bit is 0, the value of HLEN is 5, value of total length is 200 and
offset value is 200. What is the first byte number and last byte number of datagram?
(v)
(x)
fragment? "
Solution:
(y)
(z) Since M bit is 0, it means there are no more fragments used. Hence this is the last
fragment.
(aa) Since HLEN - 5, Header length = 5 x 4 = 20 bytes, Total length = 200.
'
(ae) Since there are 180 bytes of data more 179 bytes are required for 180 bytes of
number. Example 7:
(ag) A packet is arrived with M value 1 and offset 0. Is this the first, last or middle fragment?
Solution:
(ai) Since M bit is 1, it means that it is not last fragment and may be fragmented and since
offset is 0, its starting byte number is 0, hence it is the first byte, ,
(ah)
(aj)
Example 8: The value of Header length is 7 and total length is 64 bytes how much size of options and
data is carried by the datagram?. Solution: HLEN is 7.
(ak) .;. 7 x 4 = 28 bytes is the header length.
(al)
Minimum length of Header = 20 bytes and remaining are the options. Hence, 28
- 20 = 8 bytes are for options. Also total length = 64 bytes. Size of data = total length HLEN = 64-28 = 36 bytes.
(am)
QUESTIONS