You are on page 1of 92

IP and Networking Basics

Scalable Infrastructure Workshop AfNOG 2010

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

.erf an, Kahn6s internet$orkin" principles:

(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

,efine to,a#6s Internet architecture

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

2ate 19906s C 20006s:

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"

no$: 10 &0 Gbps

The (capital I) Internet


<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

sale?purchase of ser%ice contracts Fpeerin"G a"ree(ents

No central control or (ana"e(ent

A small internetwork or (small i) internet

The principle of Internetworking


We ha%e lots of little net$orks 5an# ,ifferent o$ners?operators 5an# ,ifferent t#pes

8thernet9 ,e,icate, lease, lines9 ,ialup9 optical9 broa,ban,9 $ireless9 DDD

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

hat is the Internet! n"ts and #olts $iew

(illions of connecte, co(putin" ,e%ices: hosts9 en, s#ste(s


ro&ter ser'er local I$%

workstation !o#ile

+.6s $orkstations9 ser%ers +7A6s phones9 toasters runnin" net$ork apps fiber9 copper9 ra,io9 satellite

co((unication links

regional I$%

routers: for$ar, packets /chunks0 of ,ata throu"h net$ork co!pany network

hat is the Internet! n"ts and #olts $iew

protocols: control sen,in"9 recei%in" of (essa"es

ro&ter ser'er local I$%

workstation !o#ile

eD"D9 <.+9 I+9 3<<+9 @<+9 +++

Internet: Fnet$ork of net$orksG


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

hat is the Internet! a ser$ice $iew

co((unication infrastructure enables ,istribute, applications:

ro&ter ser'er local I$%

workstation !o#ile

WWW9 e(ail9 "a(es9 e co((erce9 ,atabase9 e %otin"9 (oreH

regional I$%

co((unication ser%ices pro%i,e,:


connectionless connection oriente,

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

<.+ (iti"ates these for connection oriente, applications

error correction is b# retrans(ission

&'I 'tack ( T%P)IP Architect"re

Principles of the Internet

8,"e %sD core /en, s#ste(s %sD routers0


7u(b net$ork Intelli"ence at the en, s#ste(s .onnection oriente, %sD connection less +acket %sD circuit s$itchin"

7ifferent co((unication para,i"(s


2a#ere, S#ste( Net$ork of collaboratin" net$orks

The network edge

en, s#ste(s /hosts0:


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:

peer peer (o,el:

Network edge! connection* oriented ser$ice


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:

<.+ <rans(ission .ontrol +rotocol

con"estion control:

Internet6s connection oriente, ser%ice

Network edge! connectionless ser$ice

Goal: ,ata transfer bet$een en, s#ste(s

J7+ Jser 7ata"ra( +rotocol A*@. )6>B: Internet6s connectionless ser%ice


unreliable ,ata transfer no flo$ control no con"estion control

Protocol +ayers

Net$orks are co(ple;K (an# FpiecesG:


hosts routers links of %arious (e,ia applications protocols har,$are9 soft$are

Luestion: Is there an# hope of or"ani=in" structure of net$orkH Or at least in our ,iscussion of net$orksH

The "nifying effect of the network layer


7efine a protocol that $orks in the sa(e $a# $ith an# un,erl#in" net$ork .all it the net$ork la#er /eD"D I+0 I+ routers operate at the net$ork la#er I+ o%er an#thin" An#thin" o%er I+

hy layering,
7ealin" $ith co(ple; s#ste(s: e;plicit structure allo$s i,entification9 relationship of co(ple; s#ste(6s pieces

la#ere, reference (o,el for ,iscussion

5o,ularisation eases (aintenance9 up,atin" of s#ste(

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(

The IP Ho"rglass -odel


Application la#er
S5<+ 3<<+ @<+ <.+
<elnet

7NS *<+

Au,io

Mi,eo

J7+ I+

<ransport la#er Net$ork la#er

8thernet

+++

A<5

Optics A7S2

Satellite

4G

+h#sical an, 7ata link la#er

The &'I -odel


7 6 5 4 3 2 1 Application +resentation Session <ransport Net$ork 7ata 2ink +h#sical
2o$er 2a#ers Net$ork oriente, F3op b# hopG la#ers Jpper 2a#ers Application oriente, F8n, to 8n,G 2a#ers

&'I -odel and the Internet


Internet protocols are not ,irectl# base, on the OSI (o,el 3o$e%er9 $e ,o often use the OSI nu(berin" s#ste(D Nou shoul, at least re(e(ber these:

2a#er 2a#er 2a#er 2a#er 2a#er

): &: 4: 2: 1:

Application <ransport /eD"D <.+9 J7+0 Net$ork /I+0 7ata link +h#sical

+ayer Interaction! T%P)IP -odel


8n, to en, 3op b# hop
Application
<.+ or J7+

Application
<.+ or J7+

I+ 2ink +h#sical

I+ 2ink 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

+ayer Interaction! T%P)IP -odel


Application Application

<.+ or J7+

<.+ or J7+

I+ 2ink +h#sical

I+ 2ink 2ink +h#sical

I+ 2ink 2ink

I+ 2ink +h#sical

3ost

*outer

*outer

3ost

+ayer Interaction! The Application +ayer


Application

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

happens at the I+ I+ lo$er la#ers9 I+ pro%i,e, the I+

3ost

*outer

*outer

3ost

+ayer Interaction! The Transport +ayer


<he transport la#er instances at the t$o en,s act as if the# are talkin" to each other9 but in realit# the# are each talkin" to the I+ la#er belo$ itD <he transport la#er ,oesnOt care about $hat the Application Application application la#er is ,oin" abo%e itD
<.+ or J7+ <.+ or J7+

<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

+ayer Interaction! The Network +ayer (IP)


<he I+ la#er has to kno$ a lot about the topolo"# of the net$ork /$hich host is connecte, to $hich router9 $hich routers are connecte, to each Application Application other09 but it ,oesnOt care about $hat happens at <.+ or J7+ <.+ or J7+ the upper la#ersD
I+ +h#sical I+ +h#sical I+ I+ +h#sical

<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

+ayer Interaction! +ink and Physical +ayers


<he link la#er ,oesnOt care $hat happens abo%e it9 but it is %er# closel# tie, to the ph#sical la#er Application Application belo$ itD All links are in,epen,ent of each other9 an, ha%e I+ I+ I+ each otherD I+ no $a# of co((unicatin" $ith
2ink +h#sical 2ink 2ink 2ink 2ink 2ink +h#sical +h#sical

<.+ or J7+

<.+ or J7+

3ost

*outer

*outer

3ost

+ayering! physical comm"nication


data application transport net$ork link ph#sical application transport net$ork link ph#sical net$ork link ph#sical data application transport net$ork link ph#sical

application transport net$ork link ph#sical

/rame0 1atagram0 'egment0 Packet

7ifferent na(es for packets at ,ifferent la#ers


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

<er(inolo"# is not strictl# follo$e,

.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

Application Transport Network Network Data Link Data Link 3ea,er

3ea,er 3ea,er

2ink 2a#er 7ata 7ata

3ea,er 3ea,er 3ea,er

+ayer 2 * .thernet frame


+rea(ble 7est 6 b#tes Source 6 b#tes <#pe 2 b#tes 7ata &6 to 1100 b#tes .*. & b#tes

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

+ayer 3 * IP$4 datagram


Mersion I32 7iff Ser%ices I,entification +rotocol <otal 2en"th @la"s @ra"(ent Offset 3ea,er .hecksu( <i(e to 2i%e

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

+ayer 4 * T%P segment


Source +ort 7estination +ort Se!uence Nu(ber Ackno$le,"e(ent Nu(ber 7ata Offset *eser%e, J A 8 * S @ * . OS N I GK 2 < NN .hecksu( Options 7ata /contains application ,ata0

Win,o$

Jr"ent +ointer +a,,in"

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

Jni!ue I,entification of:

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

So the net$orks kno$ $here to sen, the ,ata

Net$ork In,epen,ent @or(at

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

Basic 'tr"ct"re of an IP$4 Address


42 bit nu(ber /& octet nu(ber0: /eD"D 144D2)D162D1210 7eci(al *epresentation: 133 27 162 125

'inar# *epresentation: 10000101 00011011 10100010 01111101

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

<he proble( $e ha%e


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

We use a structure, nu(berin" s#ste(

Network part and Host part


*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

3ierarchical 7i%ision in I+ A,,ress:

Net$ork +art /or +refi;0 C hi"h or,er bits /left0

,escribes $hich ph#sical net$ork ,escribes $hich host on that net$ork

3ost +art C lo$ or,er bits /ri"ht0

Net$ork +art

3ost +art

'oun,ar# can be an#$here


choose the boun,ar# accor,in" to nu(ber of hosts %er# often NO< a (ultiple of > bits

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

count the 1Os in the binar# representation

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

All 06s in host part: *epresents Net$ork


eD"D 194D0D0D0?2& eD"D 14>D4)D6&D0?1> eD"D 196D200D224D96?2>

All 16s in host part:


'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

12)D0D0D0?>: 2oopback a,,ress /12)D0D0D10 0D0D0D0: Marious special purposes

.5ercise

Merif# that the pre%ious e;a(ples are all broa,cast a,,resses:


194D0D0D211 /prefi; 194D0D0D0?2&0 14>D4)D12)D211 /prefi; 14>D4)D6&D0?1>0 196D200D224D111 /prefi; 196D200D224D96?2>0

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

-a5im"m n"m#er of hosts per network


<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

2> (inus 2 P 21& possible hosts

Si(ilarl# a subnet (ask of 211D211D211D22& or ? 2) (eans 2) net$ork bits9 1 host bits /2)E1P420

21 (inus 2 P 40 possible hosts

-ore Address .5ercises

If there $ere 9 routers on the classroo( backbone net$ork:

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

-ore le$els of address hierarchy

8;ten, the concept of Fnet$ork partG an, Fhost partG:


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

Mer# lar"e blocks allocate, to *I*s /eD"D ?>0

7i%i,e, into s(aller blocks for businesses /eD"D ?220


7i%i,e, into s(aller blocks for local net$orks /eD"D ?260 8ach host "ets a host a,,ress

What if a,,resses o%erlapHH

Ancient History! %lassf"l Addressing

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"

Ol, s#ste(s use, restricti%e rules /obsolete0


No$a,a#s /since 199&09 no restriction

Ancient History! 'i6es of classf"l networks

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

.lass ' net$orks /(e,iu(0:

.lass . net$orks /s(all0:

Ancient History! is my address,

hat class

Qust look at the a,,ress to tell $hat class it isD


.lass A: 0D0D0D0 to 12)D211D211D211
binar# 0nnnnnnnhhhhhhhhhhhhhhhhhhhhhhhh binar# 10nnnnnnnnnnnnnnhhhhhhhhhhhhhhhh binar# 110nnnnnnnnnnnnnnnnnnnnnhhhhhhhh

.lass ': 12>D0D0D0 to 191D211D211D211

.lass .: 192D0D0D0 to 224D211D211D211

.lass 7: /(ulticast0 22&D0D0D0 to 249D211D211D211

binar# 1110;;;;;;;;;;;;;;;;;;;;;;;;;;;;

.lass 8: /reser%e,0 2&0D0D0D0 to 211D211D211D211

Ancient History! Implied netmasks

A classful net$ork ha, a FnaturalG or Fi(plie,G prefi; len"th or net(ask:


.lass A: prefi; len"th ?> /net(ask 211D0D0D00 .lass ': prefi; len"th ?16 /net(ask 211D211D0D00 .lass .: prefi; len"th ?2& /net(ask 211D211D211D00

5o,ern /classless0 routin" s#ste(s ha%e e;plicit prefi; len"ths or net(asks

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

M2S5 P Mariable 2en"th Subnet 5asks

%lassless addressing e5ample

An IS+ "ets a lar"e block of a,,resses

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

Assi"n s(aller blocks to custo(ers

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

%lassless addressing e5ercise


.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

In prefi; len"th notation Net(asks in ,eci(al I+ a,,ress ran"es

What blocks are still a%ailable /not #et allocate,0H 3o$ bi" is the lar"est a%ailable blockH

%onfig"ring interfaces 7 ifconfig

ifconfi" interface Aa,,ressRfa(il#B a,,ress Apara(sB


interface: net$ork interface9 eD"D9 eth0 options: up9 ,o$n9 net(ask (ask a,,ress: I+ a,,ress

8;a(ples:

ifconfi" ifconfi" ifconfi" ifconfi"

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

I+%6 ,esi"ne, as successor to I+%&

8;pan,e, a,,ress space

A,,ress len"th !ua,ruple, to 16 b#tes /12> bits0 @i;e, len"th9 optional hea,ers are ,ais# chaine,

3ea,er @or(at Si(plification

No checksu( at the I+ net$ork la#er No hop b# hop fra"(entation

+ath 5<J ,isco%er#

6& bits ali"ne, fiel,s in the hea,er Authentication an, +ri%ac# .apabilities

I+sec is (an,ate,

No (ore broa,cast

IP$4 and IP$8 Header %omparison


IPv4 Header
Mersion I32

IPv6 Header
Mersion

<#pe of Ser%ice

<otal 2en"th @la"s @ra"(ent Offset

<raffic .lass

@lo$ 2abel Ne;t 3ea,er

I,entification <i(e to 2i%e +rotocol

+a#loa, 2en"th

3op 2i(it

3ea,er .hecksu(

Source A,,ress 7estination A,,ress Options +a,,in"

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

+arger Address 'pace


IPv4 = 3 !its

IPv6 = " # !its

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

IP$8 Address 9epresentation

16 bit fiel,s in case insensiti%e colon he;a,eci(al representation

2041:0000:140@:0000:0000:09.0:>)6A:140' 2041:0:140@:0:0:9.0:>)6A:140'

2ea,in" =eros in a fiel, are optional:

Successi%e fiel,s of 0 represente, as ::9 but onl# once in an a,,ress:


2041:0:140@::9.0:>)6A:140' 2041::140@::9.0:>)6A:140'

is ok is NO< ok /t$o F::G0

0:0:0:0:0:0:0:1 ::1 0:0:0:0:0:0:0:0 ::

/loopback a,,ress0 /unspecifie, a,,ress0

IP$8 Address 9epresentation

In a J*29 it is enclose, in brackets /*@.49>60


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

::?12> ::1?12> 2000::?4 @8>0::?10 @.00::?) @@00::?>

IP$8 :lo#al ;nicast Addresses


Provider 4# !its
%lo!al &o'ting Prefi(
++"

)ite "6 !its


)'!net*id

Host 64 !its
Interface I$

I+%6 Global Jnicast a,,resses are:


A,,resses for "eneric use of I+%6 3ierarchical structure inten,e, to si(plif# a""re"ation

IP$8 Address Allocation


?12 2000 *e"istr# IS+ prefi; Site prefi; 2AN prefi; 0,b> ?42 ?&> ?6& Interface I7

<he allocation process is:


<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

IP$8 Addressing 'cope

6& bits reser%e, for the interface I7


+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

16 bits reser%e, for the en, site


IP$8 Addressing 'cope

16 bits reser%e, for the ser%ice pro%i,er


+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

29 bits reser%e, for ser%ice pro%i,ers


Althou"h so(e ser%ice pro%i,ers alrea,# are -ustif#in" (ore than a ?42

8!ui%alent to an ei"hth of the entire I+%& a,,ress space

'"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

Other I+%6 features ,iscusse, later

+arge Network Iss"es ( 9o"ters

The need for Packet /orwarding


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

IP ro"ter * action for each packet


+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

/orwarding $s< 9o"ting

@or$ar,in": the process of (o%in" packets fro( input to output


<he for$ar,in" table Infor(ation in the packet

*outin": process b# $hich the for$ar,in" table is built an, (aintaine,


One or (ore routin" protocols +roce,ures /al"orith(s0 to con%ert routin" info to for$ar,in" tableD

/5uch (ore later S0

/orwarding is hop #y hop


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

If all is $ell9 ,ecisions $ill be consistent

*outers talk routin" protocols to each other9 to help up,ate routin" an, for$ar,in" tables

Hop #y Hop /orwarding

9o"ter /"nctions

7eter(ine opti(u( routin" paths throu"h a net$ork


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

5o%e packets throu"h the net$ork


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

a protocol for route up,ates is re!uire,

/orwarding ta#le str"ct"re


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

Application Transport Network Network Data Link Data Link 3ea,er

3ea,er 3ea,er

2ink 2a#er 7ata 7ata

3ea,er 3ea,er 3ea,er

.thernet .ssentials

8thernet is a broa,cast (e,iu( Structure of 8thernet fra(e:


7est Source 2en"th <#pe 7ata .*.

+rea(ble

8ntire I+ packet (akes ,ata part of 8thernet fra(e 7eli%er# (echanis( /.S5A?.70

back off an, tr# a"ain $hen collision is ,etecte,

.thernet)IP Address 9esol"tion

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

Address 9esol"tion Protocol

A*+ is onl# use, in I+%&

N7 replaces A*+ in I+%6

.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

&D A*+ *epl# is sent unicast 4D A*+ 8ntr# is a,,e,

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

Types of A9P -essages

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

IP and Networking Basics


A little bit of histor# <he <.+?I+ Stack I+ A,,ressin" I+%6 A,,ressin" 2ar"e Net$ork Issues U *outers A*+

You might also like