0% found this document useful (0 votes)
4 views

5th sem unix

The document discusses classful addressing in IPv4, detailing the structure and limitations of address classes A, B, C, D, and E, including the number of networks available in each class. It also covers subnetting and supernetting strategies to address address depletion, along with the advantages of classful addressing. Furthermore, it introduces Open Shortest Path First (OSPF) as a routing protocol and briefly explains the Dynamic Host Configuration Protocol (DHCP) for automating IP address assignments.

Uploaded by

Nayana H.N
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

5th sem unix

The document discusses classful addressing in IPv4, detailing the structure and limitations of address classes A, B, C, D, and E, including the number of networks available in each class. It also covers subnetting and supernetting strategies to address address depletion, along with the advantages of classful addressing. Furthermore, it introduces Open Shortest Path First (OSPF) as a routing protocol and briefly explains the Dynamic Host Configuration Protocol (DHCP) for automating IP address assignments.

Uploaded by

Nayana H.N
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Classtul Adclressln1

+ 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. [

Ad~ ·s Di]f' mion


1i! ~letio iL"'l'b~ f
:~:a:s::t!i,!!.~ ~m7r!~
Cl· s n betliiiie s e lb ~
A! w1ul oouJ<kmly
wasted space. Class B. for midsize organizatioa...~ a n y unused addresses. C lass c·s
e~~1i~
n1 intiu o~ of

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.

lld1•c111tage of C/auful AddrD,ing


Although d a."ful aJdressing hnd .ever.ti problem~ and became uh~oku: 11 hat.I one acJ"an1:,g..-:
G ive n a n atlcfress, we ,·an easil y find the class u i t he addrc~s and. , irn:c the preti.x length fur each
class is lixetl, we can find the pre fix lenglh immediately.
Open Shortest Path Flnt (OSPF)
Open Shones1 Pa1h Firs1 (OSP F) is an irumdocrutln routing pro1ocol like RIP but is based on lhe
li nk-s1u1e muling pro1ocol. his w, open prolocol, meaning lhc specification is publicly nvailnblc.
Unlike RIP. OSPF oJlo ws each link 10 be ~igncd a weigh! '-ed on fac1ors such ~ throughput,
round-trip time, or reliubility. !hough lldministr.uors can use hop counl as a cost. Different Types
of Service (TOS) crui have differenl weights for cos1 calculation.

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 )

LAN LAN LAN LAN LAN


- - -
'L...f '--'
Arca herder ~ ..•.
\\' \" ·• ..-~ '
Ar<a I roulc:r Art";a 2

Aro bada AS bmrubr) I


~ ························~--
~ er
,... WAN 8-ribcwe
--- n.) UICI
lioothcr
AS,
I .,,, ~ muta LAN '>
A rci n rb.1.:ltk,.., 1 I
-·u ~= ·-c::::;~,:::=;~,,.u•uuu~~r.:r~uv l.!LJ u
Dynamic H ost Configuration Protocol (DHCP ) LJ
DHCP is an application-layer protocol that au1om:u,es [P adclres.s assignmem. using a client-
server model. Widely used on the Inte rnet. it is often referred 10 as a "plug-and-play" protocol.
• Address Assignment: DHCP can assign permanent or 1.e mpor.iry [P addresses. For
example, ISPs can use DHCP to provide tempomry addresses 10 users, allowing limited
IP resources 10 serve more customers.

Dcp11rtmcnt of CSE. CEC 15

Computer Nriworlu tDCS502)

• Addltlonal Information: DHC P can also provide essential details li ke the network
pre fix. defuu It router address.. and name server oddress.

DIICP M1ssag1 Format


I} Ill l~ 31
( HLcn

8001 tilt wmc I< fil< IWD< bollm; «tnl 111focmllh0'1


,A l.~>;■t . .lJ Ub du:tl ~domlrd 1nl(.\I

The 64-byte option fi eld in D H ing additional or "endor-specilic


information. A speci al val ue. call .83.99). helps the client recognize
options in th e message. The next cured in three fie lds: n I -byte tag .
I-byte length, and variable-Ieng ) can indicate one of the 8 DHCP
message types used by the protoc

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!.

Ocpartmenl of CSE. CEC 1

Computer Networks (BCS502)

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,

Slnntlard Appllcnrlan-lny~r PmtDCGO-Starulard a:pplicatio n-lnycr protocols nrc wclldocumcntcd


and stundurdized by lnicrnct oulhorities. They arc widdy used in daily ln1erne1 in1cmctions.

Nnn.,tnntlard Applicatian-lu)'U Praracol.r-Progrnnuuc"' cnn also crcn1c nonstandard (or


proprietary) opplic111io11 -l11ycr prognun,, by devdop111g N u program., thnt provide services through
1hc lronspo rl luyer.
AppUcalion-Latyer Paradigms

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.

Trttdlt/011a/ Pnradig111: Cl/ent-St!rw!r

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

Compuicr Networks (BCS502 )

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

Persistent HTTP Non-Persistent HTTP

The server leaves the connection open after sending a


Requires 2 RTTs per object.
response.

Subsequent HTTP messages between the same


OS overhead for each TCP connection
client/server are sent over an open connection.

The client sends requests as soon as it encounters a Browsers often open parallel TCP
referenced object. connections to fetch referenced objects.

Here. at most one object can be sent over


As little as one RTT for all the referenced objects.
one TCP Connection.

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.

There are two types:

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.

Disadvantages of Non- Persistent Connection

1. In Non - Persistent Connection. it requires a greater CPU overhead for the transmission of data

Persist ent Connection


1. Non- Pipelined Persistent Connection: In a Non - pipeline connection. we first establish a
connection that takes two RTTs then we send all the object's images/text files whi ch take 1 RTT
each (TCP for each object is not required).

2. Pipelined Persistent Connection: In Pipelined connection, 2RTT is for connection establishment


and then lRTT(assuming no w indow limit) for alUthe objects i.e. images/text.

=
-
-
-
-
-
-
-- AIIOl,jecta

' '
Penl~lenl W•lhout ,,_n.l1tent With
Plpttllnlnf, P!pellnlnv

Advantages of Persistent Connections

• 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.

Disadvantages of Persistent Connections

• 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

ly one connection establishment and connection termination is used, but the r


age is sent separately

~ssage Formats
e HTTP protocol defines the format of the request and response messages.
:.. ( sp: Spil" er: <:amage klllnl If: Line Fred )

Rfl~~· IEJ~E]liJE]~@l 18~~~El~ rill I


Header
... IHraJen ane I■ [iJ I I~ []
Value
line<

l lfealu - 1 ■ ~8~~
Blank
line
I
Body
Difference Between Cl.ient-Server and Peer-to-Peer Network

Client-Server Network Peer-to- Peer Network

In Client-Server Network. Clients and server are


In Peer-to-Peer Network. Clients a nd server are
differentiated. S~cific server and clients are
not d iffere ntiated.
present.

Client.-.Server Network focuse!; on informauon While ~er-to -Peer Network focuses. on


sharing connectivity.

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.

While in Pcer•to-Peer Network, Each and every


In Client-Server Network. Server respond the
node can do both request and respond for the
services which is request by Client.
services.

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.

While Peer-to-Peer Network is generally suited


Client-Server Netw0<k is used for both small and
for small networks with fewer than 10
large networks.
computers.
Dalo Co nnection
The dn111 connection uses the well-lwuwu part 20 It llbe NCVer site. However. the creation of u
d111a connection is different from the control eC111tection~c follow ing shows the steps:
I. The cl ient. not the server. issues n passive open us ing an ephemeral pon. This must be done
by the client because it is the client thnt issues the commands for transferring lilcs.
2. Using the PORT command the client sends this pon number to the server.
J. The server receives the port number and issues an active open using the well-known pon 20
and the received ephemeral port number.

Communlt:atlon 01't!r Data Connection


The purpose and implementation of the data connection a.re 10 transfer files through the data
eonnection. The client must define the type of file 10 be tronsfcrrcd, the structure o f the data,
and the transmission mode.
Before sending the fi le through the data connection. we prepare for transmission through the
control connection. The heteroganeity problem is resolved by defining three attributes of
communic111ion: tile type. data structure, and transmission mode.
File Type
FTP con transfer one of1he followmg file rypc:. a.cross the data conncc1ion: ASC II file, EBCDIC
file, or image file.
D11ta Stru,·ture
FTP cun transfer u file across the data connection us ing one of the following intcrpre1a1ions o f
!he structure o flhc dnla:fi/e s1n1cll1f'I!, f'l!cord stn1Ctuf'I!, or pC1ge structure. Tran.n nlnlon !,fade
FTP con trnnsfcr o file across the dut11 connection usi ng one o r lhc following three transmission
modos: stream modi!, block mode. or compressl!'d mode. The stNam mode is the dcf.nult mode;
data arc delivered from FTP 10 TC P as II continuous stmun of bytes. In the bloclc mode. dalll
can be delivered from FTP to TCP in blocks.
File Trn11sfer
File lmnsfcr occul"!I over the dala connect ion un.dcr the conlrol of the com mand.,i sen t over the
control connect ion. However, we should remember lhal file transfer in FTP means o:ne of three
things: retrfeving a file (server 10 client). storing a file (client lo server). and directory llst/11g
(server lo cl icnt).
Local vtnus Rtmott Loggintt


-
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

Compulcr Networks (BCSS02)

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 ~~- ..._ _:_ ·----

In a connectionless transport hi one: ,m,e: the c,rnbh<hed state. TI1c


machines on both rhe client and lillll es1:1blrshcd stare. always read)' 10 send
und receive ~ n.,port-laycr r kct,.

A c~ijlin-<irichi~ "FSM ~ v~~ ~ IUlltin~


• C 1led Saa~: The 'FsM< .... hatatbc 1$ DO COIUICCOOlt :~ih O ~ t ,•il
rec~~ e.
• The machine sends an open ~u~ I packet to the
lo op4!n•Wllit- 1.
When the acknowledgment rs received. 11 moves lo open -wa it- LI. i\1 this point. u
unidirttlional coonecliou is cstabh:.hcd.

DcpOJ1111<nlofCSE.CEC 10

Computer Networks (BCS502)

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.

Once an a c k n ~ , ~ the machine IIIIWa ID • ~waits for a close


reque,t from the other side. Wh~ the tlte.Jg,c~-::i
arnvcs. =~wledgment and
moves back to Lhe closed state. <__
_______;;>_
The_re are various \'ersions of the connection-oriented FSM. where stales can be condensed.
expanded. or renamed depending o n the protocol being u.<ed.
The behavior o f a transport-layer protocol, both when it provides a connectionless and when ii
provides a connection-oriented protocol, can be bener shown as a finite state machine (FSM).
Using this tool, each transport layer (sender or receiver) is taught as a machine with a finite
number of stales.

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 .._....

In a connectionless transport la . the eswblishcd s1a1e. The


rnm.:hines on both the client and , e c:;1ablished Slate. always ready 10 send
and receive 1ranspor1-layer ecke1s.

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 .

_l;!-f,11 \llltll'l•I ' I' o1 ddn-H -{

• I
• llil
, • . , .. , : ,l.1,..,1) ' II tdo. I ,._•

-~· 0,. 3,.u., pnc,~ ~hi i.. tU• t,,I • ~·ll!:tb


;

UDP local lca,fl


It> hi•
Ir lhe checks um does not include lhe pseudoheader. a user datagram may arrive safe and sound.
However. if the IP header is corrupted. it may be delivered lo lhe wrong host. The protoco l field
is added to ensure lhat the packet belongs to lJDP. and not to TCP. The value of the protocol
field for UDP is 17. If this value is changed during transmission. lhe checksum calculation at the
receiver will detect il and lJDP drops lhe packet. It is not delivered to lhe wrong prococol.

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.

E11copsulotio11 and Z"l'IPJl'""EfM


To semi a message from one prqcess IO iinolber, the UDP tocol encapsulates and decapsulates
messugcs.

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

Multiplexing· and Drmu/Jipll'x in


In a host running a TC P/l P prot ..,.,_,,, one UDP but possibly several processes
that may wa.nt to use the scrvi , l!!f·(!)' ~ lhis situation. UDP mu ltiplexes and
demultiplexes.
Typic"I Applicatio11s
The followil'f~s some typical applicatiom lhal can benefit more ~ r v i c es of UDP
1hun from lhosc ofTCP.
• UDP is su i1uble for u proces~ 1ha1 requires simple 11:4u.:-s1-response communication with
li1L1e concern for tlow aJl!i• cx CODllul. It i s - ~ually used for a process such as FrP
that needs 10 send bu 1k d al?r,, -
• UDP is sui1ab le for a process with internal now- and error-control mechanisms. For
exump lc. 1he Trivial File Transfer Prot ocol (TFTP) process includes tlow and error
con1 rol. II cun ca~il)
• UDP is a su1tnble 1raru ppli&(Joc, i.111:f"q.-._,r,-,,, ulticasting capabiliry is embedded
in the UDP sof1ware b -..,-,
• UDP is used for manager
• U DP is used for some ro ~ such as Rouling Informat ion Protocol
(RIP).
• UDP is normal ly used fo licati ons that cannot tol cnuc uneven
delay be1ween sections of
Stop-and-\.\lait Protocol ~
-+ S1op-and-Wai1 is a con~ !ll' eiet,M -fMi~ . which uses both Oow and error
con trol.
-+ Both the sender and the receiver use a sliding window oCsiz,e l. The sender sends one
packel al a time nnd 11 ncknowledg hll!i-e sending the next one.
-+ To detect corrup1ed need 10 a · um to each data pnckel. \Vben a
packet arrives m the re,- ,.., , checksum is incorrec1. the packe1 is
corrup1cd and s ilcn1 ly di-llV,
-+ The silence of the receive Jll<;iarpilcr thUI II packel was ei1her cormp1cd or
l0s1. Every time 1he sendc 1imcr.
-+ If an acknowledgmeru .ir ires. the 1imer i, Slopped and the
se nder .se nds 1hc next pud,
-+ Ir the ti mer expires. the ,c kcl. a.\,uming 1h:11 1hc packel wa.~
ei ther lost or corrup1cd. c'<ls to J..ccp a copy of the packc1
until ils acknowlc<lgmcnl tnl.,._
.
· w

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)

You might also like