Computer Networks
Computer Networks
DefineNetwork?
Ans:Anetworkisas etofdevicesthatareconnectedwitha physical
medialink.Inanetwork,t woormorenodesareconnectedbya
physicallinkortwoormorenetworksareconnectedbyoneormore
nodes.Anetworkisacollectionofdevicesc onnectedtoeachotherto
allowthesharingofdata.
Anodecanbeac omputer,printer,oranyotherdevicecapableofsending
orreceivingthedata.Thelinksconnectingthenodesareknownas
communicationchannels.
TypesofNetwork?
-Networkscanbedividedonthebasisofareaofdistribution.
● LAN(LocalAreaNetwork):Itisusedforasmallgeographical
locationlikeoffice,hospital,school,etc.
● P
AN(PersonalAreaNetwork):Itsrangelimitisupto10meters.
Itiscreatedforpersonaluse.Generally,personaldevicesare
connectedtothisnetwork.Forexamplecomputers,telephones,fax,
printers,etc.
● MAN(MetropolitanAreaNetwork):Itisusedtoconnectthe
deviceswhichspantolargecitieslikemetropolitancitiesoverawide
geographicalarea.
● W
AN(WideAreaNetwork):Itisusedoverawidegeographical
locationthatmayrangetoconnectcitiesandcountries.
Topology:
Topologydefinesthes
tructureofthenetworkofhowa
llthecomponents
areinterconnectedtoeachother.
MeshT
opology:
StarT
opology:
BusT
opology
RingT
opology:
HybridTopology:
OSIM
odel(opens
ysteminterconnection):
Itisan
etworkarchitecturemodelbasedontheISOstandards.Itiscalledt he
OSImodelasitdealswithc
onnectingthesystemsthatareopenfor
communicationwithothersystems.
OpenSystemInterconnectionisareferencemodelthatdescribeshow
informationfromas oftwareapplicationinonec
omputermovesthrougha
physicalmediumtothesoftwareapplicationinanothercomputer.
TheO SImodelhassevenlayers.
PhysicalLayer:
●ItisthelowestlayeroftheOSIreferencemodel.
●Itisusedforthet ransmissionofanunstructuredrawbitstreamovera
physicalmedium.
●Physicallayertransmitsthed ataeitherintheformofelectrical/optical
ormechanicalform.
●Thephysicallayerismainlyusedforthep hysicalconnectionbetween
thedevices,andsuchphysicalconnectioncanbemadebyusing
twisted-paircable,fibre-opticorwirelesstransmissionmedia.
networkhubs,cabling,repeaters,networkadaptersormodems.
FunctionsofaPhysicallayer:
● LineConfiguration:Itdefinesthewayhowt woo
rm
ored
evicescanbe
connectedp
hysically.
● DataTransmission:Itdefinesthet ransmissionm
odewhetheritiss
implex,
half-duplexo
rf ull-duplexmodebetweenthetwodevicesonthenetwork.
● Topology:Itdefinesthew
ayh
own
etworkd
evicesa
rea
rranged.
● Signals:Itdeterminesth et ypeo ft hes ignalu sedf ort ransmittingt he
information.
DataLinkLayer:
● LastS econdLayer,itisbetweent henetworkandphysical
layer.
● Itisusedfort ransferringthedatafromo nenodetoanother
node.
● Itreceivesthed atafromthenetworklayerandc onvertsthe
dataintodataframesandthena ttachesthephysical
addresstotheseframeswhichares enttothephysical
layer.
● Itenablestheerror-freetransferofdatafromonenodeto
anothernode.
Functionso
fD
ata-linklayer:
●Frames
ynchronization:D
ata-linklayerc onvertsthedataintoframes,
anditensuresthatthedestinationmustr ecognizethestartingandending
ofeachframe.
●Flowcontrol:D ata-linklayerc ontrolsthedataflowwithinthenetwork.
●Errorcontrol:Itd
etectsandcorrectstheerroroccurredduringthe
transmissionfromsourcetodestination.
●Addressing:D ata-linklayersattacht hephysicaladdresswiththedata
framessothattheindividualmachinescanbeeasilyidentified.
●Linkmanagement:Data-linklayermanagestheinitiation,
maintenanceandterminationofthelinkbetweenthes ourceand
destinationfortheeffectiveexchangeofdata.
NetworkLayer:
TheNetworkLayeristhet hirdlayeroftheOSImodel.Ithandlesthes
ervice
requestsfromthetransportlayerandfurtherf orwardstheservicerequesttothe
datalinklayer.Thenetworklayert ranslatesthelogicaladdressesintophysical
addresses
Itdeterminest heroutefromthesourcetothedestinationandalsom
anagesthe
trafficproblemssuchasswitching,routingandcontrolsthecongestionofdata
packets.Themainroleofthenetworklayerist omovethepacketsfromthe
sendinghosttothereceivinghost.
FunctionsofNetworkLayer:
i)InternetNetworking: A ninternetworkingisthem
ain
responsibilityofthenetworklayer.Itprovidesalogicalconnection
betweendifferent devices.
ii)Addressing:ANetworklayera ddsthesourceanddestination
addresstotheheaderoftheframe.Addressingisusedtoidentifythe
deviceontheinternet.
iii)Routing:R outingisthemajorcomponentofthenetworklayer,and
itdeterminesthebestoptimalpathoutofthemultiplepathsfromsource
tothedestination.
iv)Packetizing:Theprocessofe ncapsulatingthedatareceived
fromupperlayersofthenetwork(alsocalledaspayload)inanetwork
layerpacketatthesourceandd
ecapsulatingthepayloadfromthe
networklayerpacketatthedestinationisknownaspacketizing.
Problemswithclassfuladdressing:
i)WastageofIPaddresses
ii)Maintenanceistimeconsuming
iii)Morepronetoerrors
iv)Flexibilityissue
ClasslessAddressing:
Q)What isBandwidth?
Ans:E verysignalhasalimitofupperrangefrequencyandlower
rangefrequency.T herangeofthelimitofanetworkbetweenits
upperandlowerfrequencyiscalledbandwidth.
Q)WhatisNodeandLink?
Ans:Anetworkisac onnectionsetupoftwoormorecomputersdirectly
connectedbysomephysicalmediumslikeopticalfiberorcoaxialcable.
Thisp hysicalmediumofconnectionisknownasalink,andt hecomputers
thatitisconnectedtoareknownasnodes.
Q)Gatewaya
ndD
ifferenceb
etweeng
atewaya
ndR
outers?
Ans:A node that is connected to two or more networks is commonly
known as a gateway. It is also known as a router. It is used to forward
messages from one network to another. Both the gateway and router
regulate the traffic inthenetwork.Arouterisanetworkingdevicethatforwards
the packet based on the information available in the packet header and forwarding
table.
Differencesb
etweeng
atewaya
ndr outer:
A ro
uter sends the data between two similar networks while gateway
sendsthedatabetweentwodissimilarnetworks.
Q)WhatisR
outing?(physical,datalink,networklayer)
● Theroutingalgorithmsareusedforr outingthepackets.Therouting
algorithmisnothingbutasoftwareresponsiblefordecidingtheoptimal
paththroughwhichapacketcanbetransmitted.
● Theroutingalgorithminitializesandmaintainstheroutingtableforthe
processofpathdetermination.
Thingsforoptimalpaths:HopCount,Delay,Bandwidth,Load,Reliability.
Typeso
fR
outing:
i)Static Routing:It is a technique in which the administrator manually
addstheroutesinaroutingtable.
ii)Default Routing: Default Routing is a technique in which a router is
configuredtosendallthepacketstothesamehopdevice,anditdoesn'tmatter
whetheritbelongstoaparticularnetworkornot.APacketistransmittedtothe
deviceforwhichitisconfiguredindefaultrouting.
iii)DynamicRouting:Dynamicprotocolsareusedtodiscoverthenewroutesto
reacht hed
estination.
Q)WhatDoesPingCommandDo?
Ans: The "ping" is a utility program that allows you to check the connectivity
between the network devices. You can ping devices using its IP address or
name.
Q)WhatisaNIC(Networkinterfacecard)?
● NICstandsforN
etworkInterfaceCard.Itisap
eripheralcard
attachedtothePCtoconnecttoanetwork.EveryNIChasitsown
MACaddressthatidentifiesthePConthenetwork.
● Itprovidesaw
irelessconnectiontoalocalareanetwork.
● NICsweremainlyusedind
esktopcomputers.
Q)WhatisanIP?
Ans:IPstandsforinternetprotocol.Itisap rotocoldefinedintheTCP/IP
modelusedforsendingthepacketsfromsourcetodestination.Themaintask
ofIPistodeliverthep
acketsfromsourcetothedestinationbasedontheIP
addressesavailableinthepacketheaders.IPdefinest hepacketstructurethat
hidesthedatawhichistobedeliveredaswellastheaddressingmethodthat
labelsthedatagramwithasourceanddestinationinformation.
AnIPprotocolprovidest heconnectionlessservice,whichisaccompaniedby
twotransportprotocols,i.e.,T
CP/IPandUDP/IP,sotheinternetprotocolisalso
knownasT
CP/IPorU
DP/IP.
Aninternetp
rotocold
efinest wot hings:
● Formato
fI Pp
acket
● IPA
ddressings
ystem
Q)WhatisIPAddressing?
TypesofIPAddressing:
1)PublicA
ddress:Thepublicaddressisalsoknowna sanexternal
addressastheyaregroupedundertheWANaddresses.Wecanalsodefinethe
publicaddressasawaytocommunicateoutsidethenetwork.Thisaddressis
usedtoa
ccesstheinternet.T
hepublicaddressavailableonourcomputer
providesremoteaccesstoourcomputer.Withthehelpofap
ublicaddress,we
cansetupthehomeservertoaccesstheinternet.Thisaddressisgenerally
assignedbytheISP(InternetServiceProvider).
Keyp
ointsr elatedt op
ublica
ddressa
re:
● Thescopeofthep
ublica
ddressisg
lobal,whichmeanst hatw
ec
an
communicateo
utsidet hen
etwork.
● Itisn
ota
vailablea
tf reeo
fc
ost.
Keyp
ointsr elatedt op
rivatea
ddressesa
re:
● Itsscopeislocal,aswec
anc
ommunicatew
ithint hen
etworko
nly.
● Itisgenerallyusedforc
reatinga
locala
rean
etwork.
● Itisavailableatf reeo
fc
ost.
● Wecangettoknowthep
rivateI Pa
ddressb
ys
implyt ypingt he" ipconfig"onthe
commandprompt.
Q)WhatisaMACAddress?
● MACaddressist hephysicaladdress,whichu
niquelyidentifies
eachdeviceonagivennetwork.Tomakec
ommunicationbetween
twonetworkeddevices,weneedtwoaddresses:I Paddressand
MACaddress.ItisassignedtotheNIC(NetworkInterfacecard)of
eachdevicethatcanbeconnectedtotheinternet.
● Itisg
loballyunique;itmeanstwodevicescannothavethesame
MACaddress.Itisrepresentedinah
exadecimalformatoneach
device,suchas0
0:0a:95:9d:67:16.
● Itisprovidedb
ythedevice'svendoratthetimeofmanufacturing
ande
mbeddedinitsNIC,whichideallycannotbechanged.
TypesofMACAddress:
1)UnicastMacaddress:IftheLSB(leastsignificantbit)ofthefi
rsto
cteto
fa
n
addressiss
ett oz
ero,theframeismeanttoreacho
nlyo
ned IC.
estinationN
2)MulticastMacaddress:L SB(leastsignificantbit)orfi
rst3
b
yteso
ft hefi
rsto
ctet
ofa
na
ddressissettoonea
ndr eservedf ort hem ddresses.
ulticasta
ThemaindifferencebetweenMACandIPaddress: MACAddress
is used to ensure the physical address of a computer. It uniquely
identifies the devices on a network. While IPaddressesareusedto
uniquelyidentifytheconnectionofanetworkwiththatdevicetaking
partinanetwork.
Differenceb
etweenI Pv4v
sI Pv6?
Q)Whatisasubnet?
Ans:Dividingthebignetworkintothes mallnetwork.Asubnetisa
networkinsideanetworkachievedbythep rocessc
alledsubnetting
whichhelpsdividean etworkintosubnets.
Itisusedforgettingahigherroutingefficiencya nde
nhancest he
securityofthenetwork.
Itr educesthetimetoextractthehostaddressfromtheroutingtable.
Q)WhatisSupernet?
Ans:Supernettingistheo ppositeofS ubnetting.Insubnetting,
asinglebignetworkisdividedintomultiplesmaller
subnetworks.InSupernetting,multiplenetworksarecombined
intoabiggernetworktermedasaSupernetworkorSupernet.
Therearesomepointswhichshouldbekeptinmindwhilesupernetting:
● AlltheNetworksshouldbecontiguous.
● Theblocksizeofe
verynetworkshouldbeequalandm
ustbeinthe
formof2^ n.
● FirstNetworkidshouldbeexactlydivisiblebythewholesizeofthe
supernet.
Advantageso
fSupernetting–C
ontrolandreducenetwork
traffic,M
inimizetheroutingtable
Q)Whatisafirewall?
Ans:T hefirewallisa networksecuritysystemthatisused
tom onitortheincomingandoutgoingtrafficandb locksthe
samebasedonthefirewallsecuritypolicies.
Itactsasaw allbetweentheinternet(publicnetwork)and
then etworkingdevices(aprivatenetwork).
Itiseitherahardwaredevice,softwareprogram,ora
combinationofboth.
Ita ddsalayerofsecuritytothenetwork.itsactsasa
boundary
Q)Packetfi lteringfi rewall?(layer-4)
Ans:c heckIPheader,TCPheader,
worksonthenetworkandtransportlayer.
canblockIpaddress,fullnetworks.
Canblockaservice(http,ftp)
Q)Whatist heA
pplicationG
ateway(Proxy
firewall)?(layer-5)
Ans:U
sera uthentication
Q)W
hatisa
p
roxys
erver?
Ans:
TransportLayer:
Thetransportlayerisa4
th
layerfromthetop.T
hemainroleofthetransport
layeristop
rovidethecommunicationservicesdirectlytotheapplication
processesrunningondifferenthost.A
computernetworkprovidesmore
thanoneprotocoltothenetworkapplications.Forexample,TCPandUDP
aretwotransportlayerprotocolst hatprovideadifferentsetofservicesto
thenetworklayer.Alltransportlayerprotocolsprovide
multiplexing/demultiplexingservice.Italsoprovidesotherservicessuchas
reliabledatatransfer,bandwidthguarantees,anddelayguarantees.
Multiplexing:T hetransportlayerusesthem
ultiplexing
toimprovetransmissionefficiency.
i)UpwardMultiplexing:up wardmultiplexingmeansm
ultiple
transportlayerconnectionsusethesamenetworkconnection.
ii)DownwardMultiplexing:Downwardmultiplexingmeanso ne
transportlayerconnectionusesmultiplenetworkconnections.
TransportLayerprotocol:TCPandUDP
UDP(Userdatagramprotocol):UDPstandsforU ser
DatagramProtocol.UDPisas impleprotocolanditprovidesnonsequenced
transportfunctionality.UDPisaco
nnectionlessprotocol.Thistypeof
protocolisusedw
henreliabilityandsecurityarelessimportantthan
speedandsize.
Disadvantage:UDPcandiscovert hatanerrorhasoccurred,butit
doesnotspecifywhichpackethasbeenlostasitdoesnotcontainanID
orsequencingnumberofaparticulardatasegment.
TCP(Transmissioncontrolprotocol)
SessionLayer:
Itisalayer3int heOSImodel.TheSessionlayerisusedtoe
stablish,
maintainands ynchronizetheinteractionbetweencommunicating
devices.
Functions:
1)Authentication
2)Authorization
3)Dialogcontrol:S
essionlayeractsasad
ialogcontrollerthatcreatesa
dialogbetweentwoprocessesorwecansaythatitallowsthe
communicationbetweentwoprocesseswhichcanbeeitherhalf-duplexor
full-duplex.
4)Synchronization:Sessionlayera ddssomecheckpointswhen
transmittingthedatainasequence.Ifsomeerroroccursinthemiddleof
thetransmissionofdata,thenthetransmissionwillta
keplaceagainfrom
thecheckpoint.ThisprocessisknownasS
ynchronizationandrecovery.
PresentationL
ayer:
APresentationlayerismainlyc oncernedwiththesyntaxa
nd
semanticsoft heinformationexchangedbetweenthetwosystems.
Itactsasad
atatranslatorforanetwork.
Thislayerisapartoftheoperatingsystemthatc
onvertst hedata
fromonep resentationformattoanotherformat.ThePresentation
layerisalsoknownasthes yntaxlayer.
FunctionsofPresentationlayer:
i)Translation:D ifferentcomputersusedifferentencodingmethods.It
convertsthedatafroms
ender-dependentformatintoacommonformat
andchangesthec ommonformatintoreceiver-dependentformatatthe
receivingend.
ii)Encryption:E ncryptionisneededtom
aintainprivacy.Encryption
isaprocessofc
onvertingthesender-transmittedinformationintoanother
formands endingtheresultingmessageoverthenetwork.
iii)Compression:D atacompressionisaprocessofc ompressing
thedata,i.e.,itreducesthenumberofbitstobetransmitted.Data
compressionisveryimportantinmultimediasuchastext,audio,and
video.
ApplicationLayer:
Thea pplicationlayerintheOSImodelisthec
losestlayertotheenduser
whichmeansthatt heapplicationlayerandendusercaninteractdirectly
withthesoftwareapplication.Theapplicationlayerisp resentatthetop
oftheOSImodel.Itisthelayerthroughwhichusersinteract.
Functions:
i)IdentifyingCommunicationpartners.
ii)determineresourceavailability.
iii)SynchronizingCommunication.
Applicationarchitectureisoftwotypes:
i)Client-ServerA
rchitecture:A
napplicationprogramrunningon
thelocalmachinesendsarequesttoanotherapplicationprogramis
knownasaclient,andaprogramthats ervesarequestisknownasa
server.InClient-serverarchitecture,c lientsdonotdirectlycommunicate
witheachother.
ii)P2P(Peert op
eer)A
rchitecture:T hepeersc ommunicatewith
eachotherwithoutpassingtheinformationthroughadedicatedserver,
thisarchitectureisknownaspeer-to-peerarchitecture.Theapplications
basedonP2Parchitectureincludesfilesharingandinternettelephony.
ApplicationL
ayerP
rotocol:
1)TELNET:T ELecommunicationsNETwork.Aprogramthatallowsa
usertologontoaremotecomputer.Apopularclient-serverprogramTelnetis
usedtomeetsuchdemands.
2)FTP:F ileTransferprotocolisastandardinternetp rotocolp rovidedb y
TCP/IPusedfort ransmittingt hefi lesf romo neh
ostt oa nother.Itismainlyusedfor
transferringthew
ebp agefi lesf romt heirc reatort ot hec
omputert hata ctsa sa
s erver
foro
therc
omputerso nt heinternet.Itisalsousedford ownloadingt hefi lestothe
computerfromotherservers.
3)SMTP(Simplem
ailt ransferp
rotocol):
SMTPisasetofc
ommunicationguidelinesthatallowsoftwaretotransmitan
electronicmailo vertheinternet.Itisaprogramusedfors
endingmessagesto
othercomputerusersbasedone-mailaddresses.
4)SNMP:I ts tandsforS impleNetworkManagementProtocol.SNMPisa
frameworku sedformanagingdevicesontheinternet.Itprovidesasetof
operationsform
onitoringandmanagingtheinternet.
5)HTTP:H TTPstandsforHyperTextTransferProtocol.Itisaprotocolused
toa
ccessthedataontheWorldWideWeb(www).TheHTTPprotocolcanbe
usedtot ransferthedataintheformofplaintext,hypertext,audio,video,andso
on.
Featureso
fH
TTP:
i)ConnectionlessProtocol
ii)Mediaindependent
iii)Stateless
● DNSisaninternetwhichmapsthedomainnamestotheirassociated
IPaddresses.
● WithoutDNS,usersmustknowt heIPaddressofthewebpagethat
youwantedtoaccess.WorksonUDPProtocol.
Q)WhydoesDNSuseUDPandnotTCP?
Ans:
1)U DPismuchfaster.TCPisslowasitrequiresa3-wayhandshake.The
loadonDNSserversisalsoanimportantfactor.D NSservers(sincetheyuse
UDP)don’thavetokeepconnections.
2)DNSrequestsarege
nerallyverysmallandfitwellwithinUDPsegments.
Q)AddressResolutioninDNS?
Ans:IterativeandRecursive
Q)Differenceb
/wh
ttp:&
h
ttps:?
Ans:
● InHTTP,theU
RLbeginswith“http://”whereastheURLstartswith
“https://”.
● HTTPusesportnumber80forcommunicationandH
TTPSuses443
● HTTPisconsideredtobeinsecureandHTTPSissecure
● HTTPWorksatA
pplicationLayera
ndH
TTPSworksatTransportLayer
● inH
TTP,EncryptionisabsentandE
ncryptionispresentinHTTPS.
● HTTPdoesnotr equireanycertificatesandHTTPSneedsS
SL
Certificates
Q)W
hath
appensw
heny
oue
nter“ Google.com”?
Ans:
Steps:
●Checkthebrowsercachefirstifthecontentisfreshand
presentinthecachedisplaythesame.
●Ifnot,thebrowserchecksiftheIPoftheURLispresent
inthecache(browserandOS)ifnotthenrequeststheOS
todoaDNSlookupusingUDPtogetthecorrespondingIP
addressoftheURLfromtheDNSservertoestablishanew
TCPconnection.
●AnewTCPconnectionissetbetweenthebrowserand
theserverusingthree-wayhandshaking.
●AnHTTPrequestissenttotheserverusingtheTCP
connection.
●ThewebserversrunningontheServershandlethe
incomingHTTPrequestandsendtheHTTPresponse.
●ThebrowserprocessestheHTTPresponsesentbythe
serverandmayclosetheTCPconnectionorreusethe
sameforfuturerequests.
●Iftheresponsedataiscacheablethenbrowserscache
thesame.
●Browserdecodestheresponseandrendersthecontent.
Q)HubvsSwitch?
Ans:
Hub:H ubisan etworkingdevicewhichisusedtotransmitthesignalto
eachport(exceptoneport)torespondfromwhichthesignalwas
received.HubisoperatedonaPhysicallayer.Inthispacketfilteringisnot
available.
ctiveHub,PassiveHub.
Itisoftwotypes:A
Q)DifferentTypesofdelay?
Ans:Th edelays,here,meansthet imeforwhichtheprocessing
ofap
articularpackettakesplace.
1.TransmissionDelay:
Thetimetakentotransmitap
acketfromthehosttothe
transmissionmediumiscalledTransmissiondelay.
LetBbpsisthebandwidthandLbitisthesizeofthedatathentransmission
t
delayis, T =
L/B
2.Propagationdelay:
Afterthep acketistransmittedtothetransmissionmedium,ithastogo
throughthem ediumtoreachthedestination.Hencethet imetakenbythe
lastbitofthepackettoreachthedestinationiscalledpropagationdelay.
Tp
=
Distance
/
Velocity
3.
Queueingdelay:
Ifthepacketisr eceivedbythedestination,thep acketwillnotbeprocessed
bythedestinationimmediately.Ithast owaitinaqueueinsomethingc alled
abuffer.Sothea mountoftimeitwaitsinqueuebeforebeingprocessedis
calledqueueingdelay.
4.Processingdelay:
Nowthep acketwillbetakenforprocessingwhichisc
alledprocessing
delay.T
imetakentoprocessthedatapacketbyprocessoristimerequiredby
intermediaterouterstodecidewheretoforwardthepacket,updateTTL,perform
headerchecksumcalculations.
Total=
T
t+
T
p+
T
q+T
pro
Total=
T
t+Tp(whentakingT
qandT
proe
qualst )
o0