Ipbasics
Ipbasics
Internet History
1961-1972: Early packet-switching principles
1961: Kleinrock !ueuein" theor# sho$s effecti%eness of packet s$itchin" 196&: 'aran packet s$itchin" in (ilitar# nets 196): A*+Anet concei%e, b# A,%ance, *esearch +ro-ects A"enc# 1969: first A*+Anet no,e operational
19)2:
A*+Anet ,e(onstrate, publicl# N.+ /Net$ork .ontrol +rotocol0 first host host protocol first e (ail pro"ra( A*+Anet has 11 no,es
Internet History
1972-1980: Internetworking, new and proprietary nets
19)0: A2O3Anet satellite net$ork in 3a$aii 19)4: 5etcalfe6s +h7 thesis proposes 8thernet 19)&: .erf an, Kahn architecture for interconnectin" net$orks 2ate )06s: proprietar# architectures: 78.net9 SNA9 :NA late )06s: s$itchin" fi;e, len"th packets /A<5 precursor0 19)9: A*+Anet has 200 no,es
(ini(alis(9 autono(# no internal chan"es re!uire, to interconnect net$orks best effort ser%ice (o,el stateless routers ,ecentrali=e, control
Internet History
1980-1990: new protocols, a proliferation of networks
19>4: ,eplo#(ent of <.+?I+ 19>2: S5<+ e (ail protocol ,efine, 19>4: 7NS ,efine, for na(e to I+ a,,ress translation 19>1: @<+ protocol ,efine, 19>>: <.+ con"estion control
Ne$ national net$orks: .snet9 'I<net9 NS@net9 5initel 1009000 hosts connecte, to confe,eration of net$orks
Internet History
1990, 2000 s: co!!ercialisation, the "e#, new apps
8arl# 19906s: A*+Anet ,eco((issione, 1991: NS@ lifts restrictions on co((ercial use of NS@net /,eco((issione,9 19910 earl# 1990s: Web
h#perte;t A'ush 19&19 Nelson 19606sB 3<529 3<<+: 'erners 2ee 199&: 5osaic9 later Netscape late 19906s: co((erciali=ation of the Web
(ore killer apps: instant (essa"in"9 peer2peer file sharin" /eD"D9 Naptser0 net$ork securit# to forefront estD 10 (illion host9 100 (illionE users backbone links runnin" at Gbps #outube9 social net$orkin"
<he $orl, $i,e net$ork of <.+?I+ net$orks 7ifferent people or or"anisations o$n ,ifferent parts 7ifferent parts use ,ifferent technolo"ies Interconnections bet$een the parts Interconnections re!uire a"ree(ents
We ha%e lots of little net$orks 5an# ,ifferent o$ners?operators 5an# ,ifferent t#pes
8ach t#pe has its o$n i,ea of lo$ le%el a,,ressin" an, protocols We $ant to connect the( all to"ether an, pro%i,e a unifie, %ie$ of the $hole lot /treat the collection of net$orks as a sin"le lar"e internet$ork0
workstation !o#ile
+.6s $orkstations9 ser%ers +7A6s phones9 toasters runnin" net$ork apps fiber9 copper9 ra,io9 satellite
co((unication links
regional I$%
workstation !o#ile
loosel# hierarchical public Internet %ersus pri%ate intranet *@.: *e!uest for co((ents I8<@: Internet 8n"ineerin" <ask @orce
Internet stan,ar,s
regional I$%
co!pany network
workstation !o#ile
regional I$%
co!pany network
%onnectionless Paradigm
<here is no FconnectionG in I+
+ackets can be ,eli%ere, out of or,er 8ach packet can take a ,ifferent path to the ,estination No error ,etection or correction in pa#loa, No con"estion control /be#on, F,ropG0
7u(b net$ork Intelli"ence at the en, s#ste(s .onnection oriente, %sD connection less +acket %sD circuit s$itchin"
run application pro"ra(s eD"D9 WWW9 e(ail at Fe,"e of net$orkG client host re!uests9 recei%es ser%ice fro( ser%er eD"D9 WWW client /bro$ser0?ser%erI e(ail client?ser%er host interaction s#((etric eD"D: teleconferencin"
client?ser%er (o,el:
Goal: ,ata transfer bet$een en, s#sD han,shakin": setup /prepare for0 ,ata transfer ahea, of ti(e
<.+ ser%ice A*@. )94B reliable9 in or,er b#te strea( ,ata transfer
loss: ackno$le,"e(ents an, retrans(issions sen,er $on6t o%er$hel( recei%er sen,ers Fslo$ ,o$n sen,in" rateG $hen net$ork con"este,
3ello9 hello back hu(an protocol set up FstateG in t$o co((unicatin" hosts
flo$ control:
con"estion control:
Protocol +ayers
Luestion: Is there an# hope of or"ani=in" structure of net$orkH Or at least in our ,iscussion of net$orksH
hy layering,
7ealin" $ith co(ple; s#ste(s: e;plicit structure allo$s i,entification9 relationship of co(ple; s#ste(6s pieces
chan"e of i(ple(entation of la#er6s ser%ice transparent to rest of s#ste( eD"D9 chan"e in "ate proce,ure ,oes not affect rest of s#ste(
7NS *<+
Au,io
Mi,eo
J7+ I+
8thernet
+++
A<5
Optics A7S2
Satellite
4G
): &: 4: 2: 1:
Application <ransport /eD"D <.+9 J7+0 Net$ork /I+0 7ata link +h#sical
Application
<.+ or J7+
I+ 2ink +h#sical
I+ 2ink 2ink
I+ 2ink +h#sical
3ost
*outer
*outer
3ost
.nd*to*end layers
Jpper la#ers are Fen, to en,G Applications at the t$o en,s beha%e as if the# can talk ,irectl# to each other <he# ,o not concern the(sel%es $ith the ,etails of $hat happens in bet$een
Hop*#y*hop layers
At the lo$er la#ers9 ,e%ices share access to the sa(e ph#sical (e,iu( 7e%ices co((unicate ,irectl# $ith each other <he net$ork la#er /I+0 has so(e kno$le,"e of ho$ (an# s(all net$orks are interconnecte, to (ake a lar"e internet Infor(ation (o%es one hop at a ti(e9 "ettin" closer to the ,estination at each hop
<.+ or J7+
<.+ or J7+
I+ 2ink +h#sical
I+ 2ink 2ink
I+ 2ink +h#sical
3ost
*outer
*outer
3ost
Applications beha%e as if the# can talk to each other9 but in realit# the application at each si,e talks to the <.+ or J7+ ser%ice belo$ itD
Application
<.+ or J7+ <.+ or J7+ <he application la#er ,oesnOt care about $hat
transport la#er carries the applicationOs ,ata 2ink 2ink 2ink 2ink 2ink 2ink safel# fro( en, to en,D
+h#sical +h#sical +h#sical
3ost
*outer
*outer
3ost
<heI+ transport la#er I+ ,oesnOt care I+ $hat happens I+ in the I+ la#er or belo$9 as lon" as the I+ la#er can 2ink ,ata"ra(s 2ink 2ink 2ink 2ink 2ink (o%e fro( one si,e to the otherD
+h#sical +h#sical +h#sical
3ost
*outer
*outer
3ost
<he I+ la#er $orks for$ar,s (essa"es hop b# hop 2ink 2ink 2ink 2ink 2ink 2ink fro( one si,e to the other si,eD
3ost
*outer
*outer
3ost
<.+ or J7+
<.+ or J7+
3ost
*outer
*outer
3ost
8thernet /link la#er0 fra(e I+ /net$ork la#er0 ,ata"ra( <.+ /transport la#er0 se"(ent $e often -ust use the ter( FpacketG at an# la#er
.ncaps"lation ( 1ecaps"lation
2o$er la#ers a,, hea,ers /an, so(eti(es trailers0 to ,ata fro( hi"her la#ers
7ata 3ea,er <ransport 2a#er 7ata 3ea,er Net$ork 2a#er 7ata 7ata <railer <railer
3ea,er 3ea,er
7estination an, source are &> bit 5A. a,,resses /eD"D9 00:26:&a:1>:f6:aa0 <#pe 0;0>00 (eans that the F,ataG portion of the 8thernet fra(e contains an I+%& ,ata"ra(D <#pe 0;0>06 for A*+D <#pe 0;>677 for I+%6D F7ataG part of la#er 2 fra(e contains a la#er 4 ,ata"ra(D
Source A,,ress /42 bit I+%& a,,ress0 7estination A,,ress /42 bit I+%& a,,ress0 Options 7ata /contains la#er & se"(ent0
+a,,in"
Mersion P & If no options9 I32 P 1 Source an, 7estination are 42 bit I+%& a,,resses
+rotocol P 6 (eans ,ata portion contains a <.+ se"(entD +rotocol P 1) (eans J7+D
Win,o$
Source an, 7estination are 16 bit <.+ port nu(bers /I+ a,,resses are i(plie, b# the I+ hea,er0 If no options9 7ata Offset P 1 /$hich (eans 20 octets0
IP Addressing
P"rpose of an IP address
Source
So the recipient kno$s $here the (essa"e is fro( So(eti(es use, for securit# or polic# base, filterin" of ,ata
7estination
I+ o%er an#thin"
P"rpose of an IP Address
I,entifies a (achine6s connection to a net$ork +h#sicall# (o%in" a (achine fro( one net$ork to another re!uires chan"in" the I+ a,,ress Jni!ueI assi"ne, in a hierarchical fashion
IANA /Internet Assi"ne, Nu(ber Authorit#0 IANA to *I*s /AfriNI.9 A*IN9 *I+89 A+NI.9 2A.NI.0 *I* to IS+s an, lar"e or"anisations IS+ or co(pan# I< ,epart(ent to en, users
I+%& uses uni!ue 42 bit a,,resses I+%6 uses uni!ue 12> bit a,,resses
42 bit nu(ber /& octet nu(ber0: /eD"D 144D2)D162D1210 7eci(al *epresentation: 133 27 162 125
3e;a,eci(al *epresentation: 85 1B A2 7D
Address .5ercise
SWITCH
A B C D E F G
PC
Router
Router
PC
N M L K J I H
PC
Router
Router
PC
PC
Router
Router
PC
PC
Router
Router
PC
PC
Router
Router
PC
PC
Router
Router
PC
PC
Router
Router
PC
Address .5ercise
.onstruct an I+ a,,ress for #our router6s connection to the backbone net$orkD 196D200D220D; ; P 1 for ro$ A9 2 for ro$ '9 etcD Write it in ,eci(al for( as $ell as binar# for(D
Addressing in Internetworks
5ore than one ph#sical net$ork 7ifferent 2ocations 2ar"er nu(ber of hosts Nee, a $a# of nu(berin" the( all 3osts that are connecte, to the sa(e ph#sical net$ork ha%e Fsi(ilarG I+ a,,resses Often (ore then one le%el of structureI eD"D ph#sical net$orks in the sa(e or"anisation use Fsi(ilarG I+ a,,resses
*e(e(ber I+%& a,,ress is 42 bits 7i%i,e it into a Fnet$ork partG an, Fhost partG
Fnet$ork partG of the a,,ress i,entifies $hich net$ork in the internet$ork /eD"D the Internet0 Fhost partG i,entifies host on that net$ork 3osts or routers connecte, to the sa(e link la#er net$ork $ill ha%e I+ a,,resses $ith the sa(e net$ork part9 but ,ifferent host partD 3ost part contains enou"h bits to a,,ress all hosts on the subnetI eD"D > bits allo$s 216 a,,resses
1i$iding an address
Net$ork +art
3ost +art
Network -asks
FNet$ork 5asksG help ,efine $hich bits are use, to ,escribe the Net$ork +art an, $hich for the 3ost +art 7ifferent *epresentations:
,eci(al ,ot notation: 211D211D22&D0 binar#: 11111111 11111111 11100000 00000000 he;a,eci(al: 0;@@@@8000 nu(ber of net$ork bits: ?19
Abo%e e;a(ples all (ean the sa(e: 19 bits for the Net$ork +art an, 14 bits for the 3ost +art
.5ample Prefi5es
14)D11>D12>D0?1)
/net(ask 211D21&D0D00
1111 1111 1111 1111 1 000 0000 0000 0000 1000 1001 1001 1110 1 000 0000 0000 0000
19>D14&D0D0?16
/net(ask 211D211D0D00
1111 1111 1111 1111 0000 0000 0000 0000 1100 0110 1000 0110 0000 0000 0000 0000
201D4)D194D12>?26
/net(ask 211D211D211D1920
1111 1111 1111 1111 1111 1111 11 00 0000 1100 1101 0010 0101 1100 0001 10 00 0000
'pecial Addresses
'roa,cast
eD"D 194D0D0D211 /prefi; 194D0D0D0?2&0 eD"D 14>D4)D12)D211 /prefi; 14>D4)D6&D0?1>0 eD"D 196D200D224D111 /prefi; 196D200D224D96?2>0
.5ercise
7o this b# fin,in" the boun,ar# bet$een net$ork part an, host part9 an, checkin" that the host part /if $ritten in binar#0 contains all 1OsD
<he nu(ber of bits in the host part ,eter(ines the (a;i(u( nu(ber of hosts <he all =eros an, all ones a,,resses are reser%e,9 canOt be use, for actual hosts 8D"D a subnet (ask of 211D211D211D0 or ?2& (eans 2& net$ork bits9 > host bits /2&E>P420
Si(ilarl# a subnet (ask of 211D211D211D22& or ? 2) (eans 2) net$ork bits9 1 host bits /2)E1P420
What is the (ini(u( nu(ber of host bits nee,e, to a,,ress each router $ith a uni!ue I+ a,,ressH With that (an# host bits9 ho$ (an# net$ork bitsH What is the correspon,in" prefi; len"th in FslashG notationH What is the correspon,in" net(ask /in ,eci(al0H With that net(ask9 $hat is the (a;i(u( nu(ber of hostsH
arbitrar# nu(ber of le%els of hierarch# blocks ,on6t all nee, to be the sa(e si=e but each block si=e (ust be a po$er of 2 7i%i,e, into s(aller blocks for IS+s /eD"D ?1)0
No$a,a#s9 $e al$a#s e;plicitl# sa# $here the boun,ar# bet$een net$ork an, host part is
usin" slash notation or net(ask notation .alle, F.lass AG9 F.lass 'G9 F.lass .G net$orks 'oun,ar# bet$een net$ork part an, host part $as i(plie, b# the class .alle, FclasslessG a,,ressin"9 FclasslessG routin"
7ifferent classes $ere use, to represent ,ifferent si=es of net$ork /s(all9 (e,iu(9 lar"e0 .lass A net$orks /lar"e0:
> bits net$ork part9 2& bits host part 16 bits net$ork part9 16 bits host part 2& bits net$ork part9 > bits host part
hat class
binar# 1110;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.lass A: prefi; len"th ?> /net(ask 211D0D0D00 .lass ': prefi; len"th ?16 /net(ask 211D211D0D00 .lass .: prefi; len"th ?2& /net(ask 211D211D211D00
Nou canOt -ust look at an I+ a,,ress to tell $hat the prefi; len"th or net(ask shoul, beD +rotocols an, confi"urations nee, e;plicit net(ask or prefi; len"thD
%lassless addressing
.lass A9 .lass '9 .lass . ter(inolo"# an, restrictions are no$ of historical interest onl#
Obsolete in 199&
Internet routin" an, a,,ress (ana"e(ent to,a# is classless .I7* P .lassless Inter 7o(ain *outin"
*outin" ,oes not assu(e that for(er class A9 '9 . a,,resses i(pl# prefi; len"ths of ?>9 ?169 ?2& *outin" ,oes not assu(e that all subnets are the sa(e si=e
eD"D9 a ?16 prefi;9 or 61146 separate a,,resses eD"D9 a ?22 prefi; /102& a,,resses0 to one custo(er9 an, a ?2> prefi; /16 a,,resses0 to another custo(er /an, so(e space left o%er for other custo(ers0
An or"anisation that "ets a ?22 prefi; fro( their IS+ ,i%i,es it into s(aller blocks
eD"D a ?26 prefi; /6& a,,resses0 for one ,epart(ent9 an, a ?2) prefi; /42 a,,resses0 for another ,epart(ent /an, so(e space left o%er for other internal net$orks0
.onsi,er the a,,ress block 144D2)D162D0?24 Allocate 1 separate ?29 blocks9 one ?2) block9 an, one ?21 block What are the I+ a,,resses of each block allocate, abo%eH
What blocks are still a%ailable /not #et allocate,0H 3o$ bi" is the lar"est a%ailable blockH
interface: net$ork interface9 eD"D9 eth0 options: up9 ,o$n9 net(ask (ask a,,ress: I+ a,,ress
8;a(ples:
eth0 192D16>D2D2I ifconfi" eth1 192D16>D4D1 eth0 eth0 192D16>D2D2 net(ask 211D211D211D0 eth0 inet6 2001:,b>:b,b,::124 prefi;len &> alias
IP$8 Addressing
IP $ersion 8
A,,ress len"th !ua,ruple, to 16 b#tes /12> bits0 @i;e, len"th9 optional hea,ers are ,ais# chaine,
6& bits ali"ne, fiel,s in the hea,er Authentication an, +ri%ac# .apabilities
I+sec is (an,ate,
No (ore broa,cast
IPv6 Header
Mersion
<#pe of Ser%ice
<raffic .lass
+a#loa, 2en"th
3op 2i(it
3ea,er .hecksu(
Source A,,ress
Legend
Fields name kept from IPv4 to IPv6 Fields not kept in IPv6 Name and position changed in IPv6 New field in IPv6
7estination A,,ress
I+%&
42 bits P &929&996)9296 possible a,,ressable ,e%ices 12> bits: & ti(es the si=e in bits P 4D& ; 104> possible a,,ressable ,e%ices P 4&092>294669920994>9&649&6494)&960)9&419)6>92119&16 1 ; 102> a,,resses per person on the planet
I+%6
2041:0000:140@:0000:0000:09.0:>)6A:140' 2041:0:140@:0:0:9.0:>)6A:140'
2041:0:140@::9.0:>)6A:140' 2041::140@::9.0:>)6A:140'
http:??A2001:,b>:&f4a::206:ae1&B:>0>0?in,e;Dht(l .u(berso(e for users 5ostl# for ,ia"nostic purposes Jse full# !ualifie, ,o(ain na(es /@L7N0 instea, of this *epresentation of prefi; is sa(e as for I+%& .I7*
+refi; *epresentation
A,,ress an, then prefi; len"th9 $ith slash separator 19>D10D0D0?16 2001:,b>:12::?&0
I+%& a,,ress:
I+%6 a,,ress:
IP$8 Addressing
Type Binary Hex
Jnspecifie, 2oopback Global Jnicast A,,ress 2ink 2ocal Jnicast A,,ress Jni!ue 2ocal Jnicast A,,ress 5ulticast A,,ress
0000S0000 0000S0001 0010 DDD 1111 1110 10DDD 1111 1100 DDD 1111 1101 DDD 1111 1111 DDD
Host 64 !its
Interface I$
A,,resses for "eneric use of I+%6 3ierarchical structure inten,e, to si(plif# a""re"ation
<he IANA is allocatin" out of 2000::?4 for initial I+%6 unicast use 8ach re"istr# "ets a ?12 prefi; fro( the IANA *e"istr# allocates a ?42 prefi; /or lar"er0 to an I+%6 IS+ IS+s usuall# allocate a ?&> prefi; to each en, custo(er
+ossibilit# of 26& hosts on one net$ork 2AN Arran"e(ent to acco((o,ate 5A. a,,resses $ithin the I+%6 a,,ress +ossibilit# of 216 net$orks at each en, site 61146 subnets e!ui%alent to a ?12 in I+%& /assu(in" 16 hosts per I+%& subnet0
+ossibilit# of 216 en, sites per ser%ice pro%i,er 61146 possible custo(ers: e!ui%alent to each ser%ice pro%i,er recei%in" a ?> in I+%& /assu(in" a ?2& a,,ress block per custo(er0 +ossibilit# of 229 ser%ice pro%i,ers iDeD 100 (illion ,iscrete ser%ice pro%i,er net$orks
Althou"h so(e ser%ice pro%i,ers alrea,# are -ustif#in" (ore than a ?42
'"mmary
Mast a,,ress space 3e;a,eci(al a,,ressin" 7istinct a,,ressin" hierarch# bet$een IS+s9 en, sites9 an, 2ANs
IS+s ha%e ?42s 8n, sites ha%e ?&>s 2ANs ha%e ?6&s
5an# s(all net$orks can be interconnecte, to (ake a lar"er internet$ork A ,e%ice on one net$ork cannot sen, a packet ,irectl# to a ,e%ice on another net$ork <he packet has to be for$ar,e, fro( one net$ork to another9 throu"h inter(e,iate no,es9 until it reaches its ,estination <he inter(e,iate no,es are calle, FroutersG
An IP 9o"ter
A ,e%ice $ith (ore than one link la#er interface 7ifferent I+ a,,resses /fro( ,ifferent subnets0 on ,ifferent interfaces *ecei%es packets on one interface9 an, for$ar,s the( /usuall# out of another interface0 to "et the( one hop closer to their ,estination 5aintains for$ar,in" tables
+acket is recei%e, on one interface .hecks $hether the ,estination a,,ress is the router itself C if so9 pass it to hi"her la#ers 7ecre(ent <<2 /ti(e to li%e09 an, ,iscar, packet if it reaches =ero 2ook up the ,estination I+ a,,ress in the for$ar,in" table 7estination coul, be on a ,irectl# attache, link9 or throu"h another router
One or (ore routin" protocols +roce,ures /al"orith(s0 to con%ert routin" info to for$ar,in" tableD
8ach router tries to "et the packet one hop closer to the ,estination 8ach router (akes an in,epen,ent ,ecision9 base, on its o$n for$ar,in" table 7ifferent routers ha%e ,ifferent for$ar,in" tables an, (ake ,ifferent ,ecisions
*outers talk routin" protocols to each other9 to help up,ate routin" an, for$ar,in" tables
9o"ter /"nctions
2o$est ,ela# 3i"hest reliabilit# 8;a(ines ,estination a,,ress in packet 5akes a ,ecision on $hich port to for$ar, the packet throu"h 7ecision is base, on the *outin" <able
Interconnecte, *outers e;chan"e routin" tables in or,er to (aintain a clear picture of the net$ork In a lar"e net$ork9 the routin" table up,ates can consu(e a lot of ban,$i,th
We ,onOt list e%er# I+ nu(ber on the Internet the table $oul, be hu"e Instea,9 the for$ar,in" table contains prefi;es /net$ork nu(bers0
TIf the first ?n bits (atches this entr#9 sen, the ,ata"ra( thata$a#T
If (ore than one prefi; (atches9 the lon"est prefi; $ins /(ore specific route0 0D0D0D0?0 is T,efault routeT (atches an#thin"9 but onl# if no other prefi; (atches
A9P
.ncaps"lation 9eminder
2o$er la#ers a,, hea,ers /an, so(eti(es trailers0 to ,ata fro( hi"her la#ers
7ata 3ea,er <ransport 2a#er 7ata 3ea,er Net$ork 2a#er 7ata 7ata <railer <railer
3ea,er 3ea,er
.thernet .ssentials
+rea(ble
8ntire I+ packet (akes ,ata part of 8thernet fra(e 7eli%er# (echanis( /.S5A?.70
Internet A,,ress
Jni!ue $orl,$i,e /e;ceptin" pri%ate nets0 In,epen,ent of +h#sical Net$ork technolo"# Jni!ue $orl,$i,e /e;ceptin" errors0 8thernet Onl#
8thernet A,,ress
Nee, to (ap fro( hi"her la#er to lo$er /iDeD I+ to 8thernet9 usin" A*+0
.heck A*+ cache for (atchin" I+ a,,ress If not foun,9 broa,cast packet $ith I+ a,,ress to e%er# host on 8thernet FO$nerG of the I+ a,,ress respon,s *esponse cache, in A*+ table for future use Ol, cache entries re(o%e, b# ti(eout
A9P Proced"re
1D A*+ .ache is checke, 1D A*+ 8ntr# is a,,e, 2D A*+ *e!uest is Sent usin" broa,cast
A9P Ta#le
IP Address 192D16>D0D2 192D16>D0D61 192D16>D0D4& Hardware Address 0> 00 20 0> )0 1& 01 02 20 0> >> 44 0) 01 20 0> )4 22 Age (Sec) 4 120 &4
A*+ re!uest
Who is I+ a,,r :D:D:D: tell I+ a,,r NDNDNDN I+ a,,r :D:D:D: is 8thernet A,,ress hh:hh:hh:hh:hh:hh
A*+ repl#
'"mmary