5th sem unix
5th sem unix
+ When the Internet started. an 1Pv4 addn:ss was designed with a fixed-length prefix. but to
nccommodate both small and large networks. thn,e fixed-length prefixes were designed
= = =
instead of one (n 8. n 16. and n 24). The whole address space was divided into five
class es (class A, B. C. D. and E). This scheme is referred 10 a• d rvl addressing.
+ In c'lass A. the net work leng,h is 8 bits. but since the fim bit. which is 0. defines the class.
we can have only seven bit.. as r.b.Hdwai.. ulen1ificr. This means there arc only 27 = 128
nc1wurks in the world.lhar&a blve a claa r 2e
+ In dass 8, •iwtNhrillk luilta ii 16 bits. • liace .;--,lina1~ il!,. which arc ( 10):.
Llcfi1~ , we CID bave oaJy 14 biu as die Ddwlr khfi~ • means there urc
only 214 ~ work, la die world lhal CID baw I I Pit re,s.
+ All .uddrc.~,cs thul s 1 ~dl ( I 10): belong to clau ~lu.~s C. the nc1work length is 24
hi1s. hul sinl'C 1hrcc hi~ ti a I wc.. cnn ha,·c onlv 21 hits a, the nc1work
idcn1iricr. Thb means th& ~ • 2 • rs,,,(c1wurk., in ihc world thal cun have u
du.ss C uddrcs,.
-l
___. .__,__,!I ~0
t, !Vt f, :!-\'I
~ hot,
I ,
C"buA II l'ld \. A ":: Mhb 0 tn I !7
C"b,, li 10 II • • lhhh 12~ lo 1~1
CbuC 1111 (" 1tc!Jhh 19! tu ~l
C"b-, 0 1111 0
"" •rrl'- •hie 21-l to :!lQ
Cb,,t:. 111 I: ~•11(1)11-.aNt ~.SO kl!._\\
Class Dis not divided into prefi1t 1ica,,1 addresses. All atldresses that
start with I 111 in binary belong 1 _ _ __ • Cla;,, E i, not divided into prefix and
suffix and i.s LL~cd as reserve. [
11aw was offering 100 few addresses (256 per network). making it impmc1ical for many
companie,. Class E was rarely u~ed. leading to fu.nber wa,,1e.
S11h11tUing and Suptrntlling
Two strategies were proposed lo address depletion: subMlting and supemetlin&, Subne11ing
di vides lnrge blocks (Class A or B) into smaller subnets 11,i lh longer prefixes. but ii railed
because larg,e organization.~ didn'c want 10 share unused addresses. Supemcning combined
multiple Cla.ss C blocks 10 crea1e larger blocks for organi 1.111ions needing more than 256
ucldrcsscs. hui ihis made puckci rouiing more ,-omple~ nnd al<o !)1'0Vro ineffociivc.
Metric: ------
OSPF caku lu1cs COit el Fl I :Iii. \ 1h :• wiw 6am a 1111111:e~ CQns1dering link weights,
which can V111':!l-Jll!!!ldml die type al .vice. Tim i, ibowD la Fl,-. belo)';:w-cre
th.: l ulUI cu,1
to 1hc des1inu1ion is c· lc,,I~ wmmina the C05IS ol indi~Jhtb.
NI IU
Ill
.... J
7 5'
l llUJ , 1.llf I j
t
Forwarding Tab/ts :
OSPI' rou ter., use Dijks1ra·s ulgo ing uiblcs by building the shoncsl-puth
tree tu ucs1irm1iun,. TI1c diffcren P forw:u-cli ng 1ablc., i., mai nly in 1hc
cost va Iucs. If OS PF uses hop c ing table, would be idc111ical 10
lhuse o f RIP. Both protocols de1e,......,.. c.,1-path trees.
l'orw:ud10(! 1:abk ior RI R:n,c,r<inf 1:i!lr lar R.\
~ CJ n..t1(1f\ N CJJ Ct.ni
na•~L ILl...10 ncnuwl h ~ lt:1
SI J 'i i 12
~ ~
": k
),\ b
1:
Sl
'
:,;.i 7
"" J
Are\s\~Oo~,...
OSP~ 1s e$i~ ed 1or
. . -- --..----~
boitl -,~•~~ au,oaomoJl
h nTloJmg ~yi,1Jl.. (AS}efn !ill&li:...•1\Ss.
link-slat pJekC(s--f{!6P~ c · ~htiw.i.-\~~Jo ·n,&Jcs
urea-; to locali ze LSP flooding. The AS is divided into , m.l114'r .sec1ions called area,. with one
backbo ne area (Area 0) responsible for inter-area communicalion.
Autmomom Sy,1cm I AS )
• Addltlonal Information: DHC P can also provide essential details li ke the network
pre fix. defuu It router address.. and name server oddress.
t l
21
3l
-II I
Introduction to network layer
The network layer in the TCP/ l ~too.:Ol saie b ~ru.i ble for the host-to-host deli,•ery of
datag rams. II provides s ~IO ibe llwpod layer lliiiil"lllC~es services from the data-link
layer. ----- ----._
<_r - - - ~ = ~ - - - - - - : - ' . - - - - - - - - - ---...::-,
,.__.....
...... _..,
.. ............
.....,~.....
..... ,,,,__
,_..,...,
,._,....
t'ltt-.i
TI1c followi ng u~
r c;-i; _ii-~-~--•. .•_6},~~~-;--------'
th;;;e:-;sc;.:;:rv;;i~c;;c,;--pp;;rl ri_
~_iii_i
I. Packelizing
Th e first duty of 1hc ri~~:§i!!u~Mmitely packetizing: encapsulat ing the
payload(data received from upper layer) in a network -layer packet at Lhe source and
c .: latin t~ k>nd from 1he nctwoA yer packet at the dcstina1ion. ft
e efJtor layerfJ. ra.~ Trar,rout,ng die 1kte1
trom u~ r¢ -~ de,~ n.
~ 1er will ht.--nibrnt,11~ ~rnnHfl°Hfiil!tt'ro t~ mirim,fN 11~ : : '1'r:tcr
is rc,punslblc fur finding the bc,t one among these pc1,.,lhlc route,.
J . Forwardi11R
Forww·Ji11g .:an be defineJ a,. the a.:lion applieJ by ea..:h router when a packet arnve• at
one of iL~ interfaces. The decision-making table II router normall y uses for applying this
uction is sometimes called the forwarding rab/1! and sometimes the ro111ing tub/I!.
Forwmlmg l:lble
F""'•cing
,,.1... 0u.,.11
fntcrlac<- ,.....
B and C GUI be lhc
,amc or mfTenenl.
Stunt.lard and Non11andard l'rolocols
For s mooth Internet operation. the prolocols in lhe first four layc:n o fdtc TCP/II' su11e need 10 be
slondordiz~"tl ond documented. These s lllodard protocols 11re typically part of operating s ystems
like Windo ws o r U1''!X. However, the application-layer prolocols can be both standard nnd
nonslundurd for added Ocxib ,lo ty,
To use the Internet. two application pr0llJ1IDl5 must c:otnmunicate: one on a compute r somewhere
in the world nnd the other on a dilTcrcmt computa. These, progmnL< exchange mcssoge:s over the
ln1cmc1. but their rcintionship can v11ry, The~ arc IWO UllliD p;:tmdigm•:
I. C llent-Srrvcr Paradigm: O,nc proi;ram (client) requcs11 services. while the other (server)
provides services,
2. Pccr-lo-Prcr (1'2P) Paradl1m: Both programs can request and provide services.
4) In client-server 0r,;hitec1u~. Ihm i~ llll tilway1-oo hos!. ~ lied 01e Krver. which
provides services when II receives rcquc.<ts fn>m mnny other hosts. cnlkd clien t-I.
4D E1rnmple: In Web npplicotion Web liCf'Vcr services rcquC$1b from bro~crs runn ing 0 11
c li-,nt holits. When a Web ~Cl'\'CI' n:ccivc:s a rcqua.t for an obJcct rrom a client ho:.1. It
res pond& by sending tht requested object to the client hosL
G) In cl ient-server nrchitccturc, clients do not directly communicate with cnch other.
G) ·n1c se rver hos a fixed. well -known address. called nn IP add rtlls. Because the server
has a fixed, well-known nddn-ss, and is always on, a client can always contact the server
by sending a packet to Lhe server 's LP address.
ti Some of the better-known applications 'lloi lh clic:nt•sc:rvcr an:hitecture include tbc Web,
FTP, Telnet. and e-mail.
lk t••nincnl of Al & ML 2
e The most popular Internet services-such as search engines (e.g.. Google and Bing),
lnternei commerce (e.g., Amazon and c-Boy). Web-based emai l (e.g.• Gma il and Yahoo
Moil), social networking (e.g .• Faccbook nnd Twiner)- employ one or more dntn
centers.
New Paradigm: Peu-10-Peu
I) In P2P architecture, there is minimal dependence on ded icated servers in data cente rs.
I) The upplicatio n employs diTect communicntion between pairs o f intcm,ittcntly
connected hosts. called pem .
I) The peers are not owned by the service providtr. but are instead desktops and laptops
controlled by users, with most of the peers residing in homes. universities, and offices.
CD Many of today's most popular and lffffic-intmsive applications are based on P2P
architectures. These applications include file sharing (e .g.. BitTorrcnt). Inte rnet
Telephony (e.g .. Skype). and IPTV (e.g.. K:ankan and PP,trcnm).
I -
• 1
-
Difference between Persistent and Non-Persistent Connections
The client sends requests as soon as it encounters a Browsers often open parallel TCP
referenced object. connections to fetch referenced objects.
Non-Persistent Connection
Non-Persistent Connections are those connections in which for each object we have to create a new
connection for sending that object from source to destination. Here. we can send a ma•imum of one
object from one TCP connection.
1. Non -Persistent-W ithout parallel connection: Each objection takes two RTTs (assuming no
window limit) one for TCP connection and the other for HTTP image/te•t file.
2. Non-Persistent -With parallel connection: Non-Persistent with a parallel connection requires
e,tra overhead in transferring data.
Non-Persistent
&
Parallel Connections
■ ◄
Advant ages of Non- Persistent Connection
1. Wastage of Resources is very less because the connection o pen s only w hen there is some data
to be sent.
2. Non-Persistent Connection is more secure because after sending the data, the connection gets
terminated and nothing can be shared thereafter.
1. In Non - Persistent Connection. it requires a greater CPU overhead for the transmission of data
=
-
-
-
-
-
-
-- AIIOl,jecta
' '
Penl~lenl W•lhout ,,_n.l1tent With
Plpttllnlnf, P!pellnlnv
• Lower CPU and memory usage because there is less number of connections.
• Allows HTTP pipelin ing of requests and responses.
• Reduced network congestion (fewer TCP connections) .
• Reduced latency in subsequent requests (no handshaking).
• Errors can be reported without the penalty of closing the TCP connection.
• Resources m ay be kept occupied even when not needed and may not be available to others.
• Most modern browsers like Chrome. Firefox . and Internet Explorer use p ersistent connections.
10:21 AM ~
DOC-20241215-WA00 ... ••
•
- ------- - ---- --- ------ -- - - --- - -- , --- ~ - - ---r---, - - - - - ---
persistent.
ctions
,nnection, one TCP connection is made for each request/resF
• ......,; in this strategy:
.~ ~ \. CP connection and sends a request.
r sends the response and closes the connection.
1t reads the data until it encounters an end-of-file marker; it then cl,
n.
:gy, if a file contains links to N different pictures in different files (all Joe~
), the connection must be opened and closed N + 1 times. The nonpersiste
h overhead on the server because the server needs N + 1 different buffers e
s opened.
I: - - - - -
D ········L-
Q
•=sc iw-llambhal!
Second bmdlb:IU
!.L 1l111d bucbhalc
.t
Tun:
lp time (RTT) is the time it takes for a small packet to travel from client t
back to the client.
includes packet-propagation delays, packet queuing delays in intermediat<
ches, and packet-processing delays.
rtment of AI & ML
Department of Al & ML
17/47 ••
••
••
Computer r
· ········L-
. - ------
File
'
lime nmc
~ssage Formats
e HTTP protocol defines the format of the request and response messages.
:.. ( sp: Spil" er: <:amage klllnl If: Line Fred )
l lfealu - 1 ■ ~8~~
Blank
line
I
Body
Difference Between Cl.ient-Server and Peer-to-Peer Network
In Cllent•Setver Network. Centralized server is While ,n Pccr·to-Peer Network. Each peer ho s its
used to store the dot.>. own data.
Clie nt-Server Network are costlier than Peer-to· While Peer-to-Peer Network are less cost lier
Peer Network. than CLient-Server Network.
Client-Server Network are mOfe stable than While Peer-to-Peer Network are less st.able i1
Peer-to-Peer Networic. number of peer i!i increase.
•
-
a, a
Loc11I toiglng: WJ,cn a user logs into t~ir local system. lceyMrokcs an: processed by the
terminu l driver and passed to t~ operating system. which i.ntcrprcts them and invokes the
approprialc application.
Remolt logging: When accessing a program on a mnote machine. TELNET is used. The user's
keystrokes are sent to the terminal driver, but instead of being interpreted locally, they are passed
Depnrtmcnl of Al & M L 34
to the TELNET client. which converts them into Network Virtual Terminal (NVT) characters.
These NVT characlcrs arc sent through lbe network to the remote machine.
On lhc remote machine. the NVT characters ar,c received by lbe TCP/lP stack and passed to the
TELNET server. The server transla1cs the NVT characters 10 ones the remote system can
understand. Since the remote operating system cnn't directly process TELNET characters. a
pseudottrminal driver is used to simulate a tc:nninal inpuL allowing the characters to be passed
to the correct application.
DOMAIN NAME SYSTEM (DNS)
The Domain Name System (DNS) was developed to simplify access to Internet resources by
mapping human-friendly names to lP addresses, which are occdcd for network identification.
Similar to how a telephone directory helps map names to numbers, DNS serves as a directory
for the Internet. allowing users to remember domain names rather than num.e ric IP addresses. A
central directory for the entire lnt.crnet would be impractical due to its vast scale and
vulnerabi lity to failures. Instead, DNS infmmatinn is distnbuted across multiple servers
worldwide. When a host requires~ ~ & it con.tacts the nearest DNS server with
U1e necessary information. This distnliuted alnlclUrc enhances reliabil.ity and efficiency.
Figure shows !how TCP/IP uses a DNS client and a DNS server to map a name to an address. A
user wants to use a file transfer client to access the coll"esponding fi le transfer server running on
a remote host. The user knows only the file transfer server name. such as afi/esource.com. The
TCP/IP suite needs the lP address of the fi le transfer server to make the connection.
U!iier
Applalltlb
la,a
IP-
38/47 ••
••
••
The behavior of a aanspon-layer pTO(ocoL bolh when it provides a connectionless and when it
provides a connecti~riented protocol can be better shown as a finite stak machine (FSM).
Using this tool. eacb transpon layer (sender or receiver) is taught as a machine with a finite
number of states.
Every FSM must have an initial state. tvhicb is where the machine st:trts when it turns o n. In
diagrams. rounded rectangles are 5to~ e s . colored text indicates events. and black
text shows actions. A b o ~lme or a slalll ~ vent from the action. and arrows
depict the transiti ~~- ..._ _:_ ·----
DcpOJ1111<nlofCSE.CEC 10
lf a bidirecliooal CODDtttioo is needed. it wails in this slale until the ocher end also
sends a connection requesL Upon receiving iL the machine sends an ack:nowledgmem and
moves to the establisbed stair.
In both connectionless and connection~riented transport layers, the established stale represents
the stage where data and acknowledgments can be exchanged between the 1wo ends. The
established stale encompasses a set of · es.
When tearing down a co
layer. whkh~ ads1o L•-
· f◄◄•M a dose request to the transpon
r • er .-:trt tolhe odai:rmd lllliilltaw,pons 10 close-wai1-I.
Every FSM must have an initial state. wbich is where the machine starts when it rums on. In
diagrams. rounded rectangles are ~ ,ep. ·11 • te.s. colored 1ex1 indicates events. and blnck
text shows act.ions. A ho~ Ulllr' or a slash veal from tb.e action. and arrows
depict !he transiti ID1lieDelU . -.
£bc- .:-oh:nd
MNlifo l ~ I th-
1it.U'llfll .._....
Ac £1~ ~1 req · ,
~lo~~l.':U:~ l#sM~~Wre~ bm-tbere
s ~i~JioCOI\AeGliondt
slrie~~n
rl ~e,i&s ftnJa
Sl ~' j ulil
ifr e c m ~ ~ ~ ~ .
• The machine sends an open request packet 10 the ..,,1,vle transpon layer and transitions
10 open-wait-I.
• When the acknowledgrnem is recei\'ed. ii moves to open-wait-11. Al 1.his point. a
umdirecliooal connection is established.
• If a bkllrtttional coo.ntttloo is needed. i1 wai1s in I.his s:1a1e until !he other end also
sends a connection request Upon receiving i1, the machine sends an acknowEedgment and
moves 10 !he established state.
In bo1h connectionless and connection-oriented uanspon layers, the es1ablisbed sta te represents
the stage where dal3 and acknowledgments can be exchanged between the two ends. The
established state encompasses a set of d.wl nawt\:..r wtes.
Whe1.1 tearing down a con~ lbe applialioa Jayer~a close request to the transport
layer. which! 1e : : : ~ lme request packet to the~ ead iiiiiluan.itio ns to close-wait-I.
Once an acknowle g M!l<~ived. lbe machine moves "!.;kl .: mi?.waia.s for a close
request from the otl1er side. \\'h~ t anives. the.4chl;;e sends an acknowEedgment and
<________.;,,
moves back to tlle c losed state.
ll1ere are various versions of the connection-oriented FSJ\1. where stmes can be condensed.
expanded. or renamed depending on the protocol being used.
UDP Servicfi =-
Process-to-Pro,·ess Commn~11
UDP proviucs prcx:css-lO-prucc,.<1 communic11lio111 using socket addresses. a combination of IP
addresses and port numbers.
Co1111ectio11less Ser►•ices
UDP provides a co1111ectio11/ess sen·ice. This means that each user datagram sent by UDP is an
independen t dnrngram. There is no relationship between the differem user datagrams even if they
are coming from the sumc . ! ~~~ess and goin...-tii'tha',.mc destination program. The uM:r
tl11111grums urc 110! numhcr qa~ c.,toblishmcnt and no connection
wm1inution. This means that e· 9llll,(lr~4191,~ n a iliffercm path.
Flow Co11trol
UDP is a very simple protocol. ,/. and hence no window mechanism. The
receiver nwy ovcrllow with inco,. I""= IIJl,@'l~of llow control means that the process
usi ng UDP should provide for thist.llllilh1iaa.
Error Control
There is no error co111rol ruech:o·l- n1 • chec:k..~!,1111. 1'!1-is means Ihm the
sender does not know if a mess• d. \Vhen the receiver detects an
e rror through the checksum. the u.-rfJll'IIJrnm is silent i- ed.
Checksum ~
UDP chccksum cukulmion indu9111--41DMIII oheuucr. the UDP hcado:r. und the
dutu coming from the upplicatio """"' ~ r b the part of the header of the IP
puckct in which the user <latagrn"1"!bill ·ilh some lields lilied with Os .
• I
• llil
, • . , .. , : ,l.1,..,1) ' II tdo. I ,._•
Co11gestion Control
S ince UDP is a connectionleia> po«ocol. it does not proVJde..~stion control. UDP assumes
that the packe ts , nl are lllllllll aad spondic aad cannoc aeare c riooJn the network.
Queuing
In UDP. queues arc a.~soc iatcd with pon s. At the client site. when a process starts. it requests a
port number from the ope · ' m. Some implj:,&1-,it· · create both an incoming and an
o utgoing c1ueue associated ~ Ill\: ~ ~ 1rocess. O t lillllflentations create only an incoming
q ueue associuted with each prl)\lllll!,I
ScnJct
Appl1cilllo n
=
Figure shows .m example of Packc1 () b senl and acknowledg.:d.
P11ckc1 I is lost and resent af1er :1cke 1 I is acknowledged and 1he timer
slops. Puckcl O is se nt and ucknc r-,.. .owlcdgmcnl i, lm,1. The sender h,L~ no
idea ir the p:1ckc1 or 1hc acknowle er 1he time-out. it rc"cnds pack.cl 0. which
is 11cknowlcclj!cd .
-· ·oGJo·i:1i: ii
'
l'lx:k<10
dbl.:.atcht
S1Dp ► (a wplialr)