SadafAldar SE6-03 CNND Assignment02

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Name- Aldadoda

Class 8- SC-6
Rolllo- 03
Subfect -CNND
Assianment No - 0 2

uestTons 3
Q1 Exploain the_difPerent dasses_0F TP addressesand
need dsubnetinq wth he help a exanmple
2 Explaîn IPV4 header Also disuss the need for
agmentahion _of TP Packet
Q3 i t e a shot noteon RPC.
xplain TCP Header fommat
05. Use the RLEmethod o tompyes5 the folla.wing
Sequence of 6smbols
AAAACC BBADDDDD EPFE

Solutfon 8--
Q1explain the diferent classes of TP addesses and
need oF Subnetinq wth he hetp o example

Ans nthe classtul addressim dchitecture theTP


addressSpace has been divided intofive classas
A,B,CDand E
2)The number of classrAaddresses is he highest
Le 50a_and those o classes D andEss
the lowest i.e. 6.26
Class No of addresses
A 2 50 %
230
25%
C 229
12.5
D 228 6.26/
E 228 6.26

fORMAT OF NARIOUS CLASSES--

Class A Fomat
he network eldis 16it loq andhe host
feld is o 24 bft lenqth-8o the netuaok feld
Lan have numbeus between 1 to 126.
But the host numbers wïll ranae om
000:0 o 21 255 266 26S Thos în class_A,
thene can be 126 tupes O netuwcks Ond 11
millfon hosts
The o" fn the hst feid Pdenites thdt fs o
class A network addre6s
1bfts 24 bits

O Netwok Hos

(class B

fomat s-

Thest two elds +dentrÄ the nekwayk, and


the number i n the s t feld must be în
Yange 28-191
10 Networs Host
14bits 16 bits

class B netuworks oTe laqe. Host numbeys 0:0 and


Class
256: 265 are yeseyved S.0
256:265 thee can be upto
65 63 (216- 2) hosBs în a class B network.
Mos O the 16, 382 class. B addressSPS bave
been allocated.
he s t blocs oveMS Cddmess
rom 28.0.0 to 128.256.26:265 and the
las block oveusfom 191 2550.0 b 191265
255.265
Example 128.39: 0: 26 r hosk 0:26 on nele
128:89

B) clasS Cfomat -

TheThe Piys blocs fn class C (ovens addessom


1920:00 to 192. 0:0:256 and the lasE block
LOveusaddress om 222. 256.255.0 to
223 256. 255.256
11O Nefuoovk Host
2121 bfts 3hits

class D fmat
The cla55fomat allowsoupo 2 million
networks wth upho 254 hosts each and class
D fomat allows the multfcast in which_a
dataqoam 1s drected fo mulffple hosts
11O Multicast adod
(5)class E famat -
The address_bedîns with LLO which shouus_
that t is yesved orutue use
The 32-bf 4 bute) netumk addressaeusuall
uwten In _dated_decimal_notutfon nhis
notationeach op the -byles fs w+tkn
n decimai om 0 n 256
lhe lowesk TP addvess fa 0.0.0.althe 32 bís are
ZeD_and the hiahes IPVU is 056Q55:55-2
6UBNETTING -

The pfncple o 6plitinq a blocls o addresses


into smaller blocks oaddesses
2 2 To the proce5s o 8ubnetinq we divide a bfa
network nho Smalley subnetw.rcs 0r 5ubnets
Each Subnek has Its Own Subne addem
2) Subnek Mask - The nehworlk mask o
masls fs used when the aiven network detaulE
to_be divided nto smalley s not
when8ubnetinq s not fo beSubnehooYks
done.
i:e
But uwhen the aiven nehwork
nto 6maller Is o be dfvfded
subnets 1e: when subneing s
tobe done, we need to
maskfov Pach Subnet (meake a Subhet
A romat of a Subnet mask
has ?ts own net
and hosk fd. Sf we want to id
nto 8 Subnets then divfde a netuwork
the
coesponding Subnet
masls will have thee extra 1's betause 2-*,
aG LompaHed_fo the cletauut
maslc
Detault Mask
(32-n) %
00000000
n24

class C netupok

SubnetNO Mask 3-exra 1s-


CHANAE
111111 111 1 00 000
DsuD n+3:21

2 Explain TPNG Heade. AlS0 discussthe need fo


agmentat+on o TP Packet
1 15 16
VER HLEN 6ervice type Total length 16 bits
4bits4 bits 8 bits
FYaqmentat+ondffset-
TdenhiPfcation 16 bits Ftaq
3bis- 13-bis
Time to 1ive Pretocet- Heade CheccSum-
hits 8 bits 16 bis
Soce I P addrens
Destination IP addves
Optrons + Paddng (0-40 bytes)
IPV4 tleadeH-amat 3

VER CVeusion)
This s a 4bft ffeid_which is used todefïne
the vesYon o TP pwtocol TheUent Veusion
o TP is 4 i-e.Tpy but n futume t may be
Ompletely eplated by h e latest NeHsfön af
TPie.TPNG.
This feid wf fndfcahe the TP s0tware unn+na
on he pYDessînq machine that th dataqam
belongs to Tpy4 veHsion 4
the mrocessinq
machine susinq Some othe eusfon d TP
then the datagram will be dfacarded.
2) HLEN (Header Jengtn)
This 4bit lonq Reid Psused f detfninq the
lenqth O he datagram header fn 4-bute
uoTds
The value of this 4feld *s multipl+ed bs y o
get the length o the TP1/4 header.which vaHias
between 20 and oo hstes.
lhen thee ame no 0phionsthe Value_of this
ield is 5 and the headen ength is 5xu 20b
When the Nalue of opfifon feidis maximum
the yalue o HLEN eld is 15 arnd he
Uome. s2ondfng header length s max+mum_
e 5XU= bo bytes
) Serfre type -6eHvice type or dilerentiaked
Services (not used now)

)Total length - Totallength Cheader plus daBa) 6 he

dataqram fn butes,minimum length is o bytea and


maximum is 65, 536 bytes

5) Flaqs Used to onbol ox identif fragments

dentpcation 3- JE _used to diperentiate Fragmented


packets fom difexent datagwams
1) Fraqmented oset-aed for ogmeotatïon and
Yeassembly thepachage s too laxqe to put in
he fame.

3) me to Ifve 9- lfmits_adataqram lifetime. IP the


packet doesn't geB to destinahon before ITL expfîes
fsdistaxded

a)Protocol 3-denes the rotocol used îns daBa poHon


o the TP diaqam fom example, TCP veprèsentrd
by numben 6and UDP by_I7

10)Heade Checksum- sed for emor checkinq of


0utur and the
headen 1F packet ax*Ves at
a a

Dutecalculates a difeent checksum then he


one specied n this Heid, the packet will be
distaxded
o the-
1) SouHce Tp addness s- The TP address
hosk fhat senE he pa.cheb
the
12) Destination TP addreas 3-The IP address Of
hosk hat shouuld eceive the packet

13)Options - Used tom netw.ok testing,debuaging


Secunihy and more. This e d is Usuallu
empt
FRAG MENTATLON -_

1)When a hos sends an TP PackeFonto he


Detuwork:
2) 9E anaatbe laqer han he nmaximum 6ize
Suppmtcd bs tha local netwomk.
aThs size detormined bs tne netuaylca _data
nk and TP maximum ransnmission Oniis
(MIU)
Th these_ase, 1p the packek s sîze exceeds he
lowe DMTU ,fhe _ddta în he padsek musl-be
mqmented
h s means1 s broken hto pferes_canied
within neu packeks fhat ae equal o _om
Smallen han he lower MTU
6) Then he agmens is dhen tspfcalls_assembled
when dhey each the destination
3 shite a 6hort note on RPC

AOS
AnS uhen
l hen aa pYOcess_on machïne-1 talls o proredure on
machine-2 then the Callinq process on 1 fs 6uspended
and h e execuion oP the talled procedume takes plae
on machine-2
No Messaqe passing is vis+ble o fhe po qramme
nfs technfqve fs_cailed as RPC (Remote Mocedure
Call). hoditionalyhe collïnq ocedunme is known
as client and hecalled procedure Ts knOwn as the
SeYvelhese names are USed for RPC too.
LThe_pinciple behind RPC s to make a emote
prOcedure call lbols like a local all
should
To Ldll a Yemole pYOcedue, the clfenE poqam
be bound wh a small librom Ocedure Called
aS clfent stub whfch eresenks the Sewem
procedune Tn the clfents addhress 8fmilaHly_e
Seyvers bound wih a Mceclure (alled
ag the
6erveYns t u b

Exploaïn TCP Headeromat


32.bts ByFeS

SoUrce Pot Destination fovt


Ans
Sequence Numbe
Acknouwledgement NUmbe TCPHeadev
TCP eserved Plags fndouw
Heade
ength L
Uvgent pofnten
checksum optfoncl
options (O or moe 32-bi|Paddng PoTon
Data Coptfona)
Thefixed headen may be ollowed by header
options Aterr the optons ?any, upto 65535-2
20- 65495 daBa bytks may ollow
The TCP Seqmenl-_without daka ae Used_o
sendinq the acknouwledqmenk and Lonhol
mess ages
1Sounce Port i- A 16-b?t humber idenhhmq the
applfcation the TCP seament ovfen rd om withio
he Sendinq host Thepore numbeys_aHE dhveled
oto thYee yanges, well-Known prts,eqTskered
pOYks and privae ports:
2) Destination Pot-A l6- bit num ber dentifuina
the applicaton the TP Segment is deshinedon
on eceiving hosk SE uSes the 6ame numban
p t number assTanmenks as those Set osfde rm
S0uHCeporks

3)8equence numbem i A 32-bit_number ldenhifna


the_cUment position of thest data bylt n
the seqmen within the entive byte sheam
or the TCP Lonnechon
4 Acknowledaement number 3- A 3a- b>t _numben
fdentipyinq the next data byBe the Senden_expecs
romthe ecefven. Theuefme, he numben wil be
one qreakm than the mostly eceied datoa byte
This ield is only wsed when the Ack Lonbol
bit fs umed 0n.
Header
5 Headerlength or ofset 2- A 4-bft freld that Specifs

the total TCP Headen length in 32-bft words


IlithouE_OptYons, a TCP Hleader f's always 20 byles
fo length: he argest a TCP heade may be 6o
buts
Reserved s- A 6-bit feid rently
u nuaed and
meserved for otume -Use
1)lndouwi A l6-bit înteger Used bu TCP forlow
LO.nointhe tom of a data ansmissYon
windouw 6ize
Checksum 3- A TCP senden omputes a value
basedOn the ontenks of the TCP header Qnd
data ields his16-bft ualue wfLbe lompared
fth the value the meceirey generales Us+ng he
Same omputatfon

q Uraent Poïntar- In_Cectain_Lfrcumstances i mau


be nece ss.ary f a TCP senderto noty
the yece>vem 0 Umqent date hek Should be
processed by the ceiving application as 600n
O.S possible

1o)Ophions- Jn Order to pYovfdo additfonalfuncho


-nalïts_ 6everal optional payame ters may he
USed betuween a TCP Sendey and vece+ver
1)Paddinq - Because options_may Yany_insftp
t_may be necessay to "pad" the TcP Heg
withzeros_So that the sèqment ends on a
32-hit uwOd bounday as defned by the
Standad.
12) Data 3- thoughnot USed in some creumstpn
mstone
this vaHiable ength ad cafes the applfca
daka om TCP Send eh o ece+ven.
g6 Use the RLE method to ompress the follouin
SequenLe O 64mbolsL
AAAACCBBDDDDDDEFE
SoP- kle_can uOmpyessthe qiven_Sequene O
Sumbols Using_ RLE aS Pollows 8

ORIGINAL- AAAA CC BBB DDDDDG FF_


CoN PRESS ED ; -

4A2c 3B 5D E 2F

a this way a shHnqo


Lompessed mto_a sbinq oi 8umbols has been
12 6ymbols
lale 'can use oa modried
I the given dato vessfon oothismethad-
this metha-
6Uch as 0 and 4 onsïsks O only two Symbas
dn Such o Case only
6umbols whfch ocwrS the uOunt O One a h
o the Ofthe 8umbol between each occwyence-
is used

You might also like