1 IP Addressing and IP Addressing and Introduction to IP Introduction to IP routing routing Avgust Jauk <[email protected]> ARNES Bratislava, August 98
Jan 20, 2015
1
IP Addressing and IP Addressing and Introduction to IP routingIntroduction to IP routing
Avgust Jauk <[email protected]>
ARNES
Bratislava, August 98
2
AgendaAgenda
Internet topology Introduction to addressing Idea of routing Special address conventions Classfull addressing Classless addressing Routing protocols: IGPs and EGPs
3
Internet topology Internet topology
Internet - Network of Networks Networks
– Based on different technology– Large or small– Fast or slow– Variety of connected nodes
Routers (Gateways) Protocols
6
Internet protocol stackInternet protocol stack
OSI Reference ModelTCP/IP
Conceptual Layers
7 Application
6 Presentation Application ftp, telnet, smtp,
5 Session snmp, tftp, etc.
4 Transport Transport TCP, UDP
3 Network InternetIP, ICMP, ARP,RARP
2 Data Link Network Ethernet,
1 Physical Interface FDDI, etc.
7
Internet protocol Internet protocol dependenciesdependencies
Hardware
Users
Application ProgramsNFS
FTP SNMP CMOT XDR
SMTP rlogin& rsh
TELNET DNS ASN.1 TFTP BOOTP RPC
TCP UDPIP (plus ICMP)
ARP RARPHARDWARE LINK LEVEL AND ACCESS PROTOCOLS
10
0 4 8 16 19 24 31
VERS HLEN SERVICE TYPE TOTAL LENGTH
IDENTIFICATION FLAGS FRAGMENT OFFSET
TIME TO LIVE PROTOCOL HEADER CHECKSUM
SOURCE IP ADDRESS
DESTINATION IP ADDRESS
IP OPTIONS (IF ANY) PADDING
DATA
. . .
Internet datagram formatInternet datagram format
11
ICMP datagram formatICMP datagram format
0 4 8 16 19 24 31
VERS HLEN SERVICE TYPE TOTAL LENGTH
IDENTIFICATION FLAGS FRAGMENT OFFSET
TIME TO LIVE PROTOCOL=1 HEADER CHECKSUM
SOURCE IP ADDRESS
DESTINATION IP ADDRESS
IP OPTIONS (IF ANY) PADDING
ICMP type ICMP code ICMP checksum
ICMP message-specific data
ICMP message-specific data
12
ICMP Message typesICMP Message types
Type Field ICMP Message Type
0 Echo Reply 3 Destination Unreachable 4 Source Quench 5 Redirect (change a route) 8 Echo Request 11 Time Exceeded for Datagram 12 Parametere Problem on a Datagram 13 Timestamp Request 14 Timestamp Reply 15 Information Request (obsolete) 16 Information Reply (obsolete) 17 Address Mask Request 18 Address Mask Reply
13
Introduction to addressingIntroduction to addressing
Do I need an address? What types of addresses are there?
– Postal address– Telephone number– In Computer Networks:
Physical Addresses (Ethernet, FDDI, ...) Textual Addresses - Names Network level addresses (IP, X.25,...)
14
Addressing in the InternetAddressing in the Internet
Address specifies host’s interface 32 bit addresses Network part & Host part
Dotted decimal notation: 192.164.2.4
Network part Host part
0 31
15
Idea of routingIdea of routing
Routers forward datagrams between connected networks
They need to know via which interface to send a datagram
Routing decisions are based on the information stored in the routing table
16
Routing tableRouting table
Tells where to send datagram for a particular network
Network Next-Hop Port Metric
194.181.200.0 194.181.208.1 Eth0 1193.2.1.0 194.181.208.320 Eth1 14153.5.0.0 194.181.214.25 Fddi0 80.0.0.0 194.181.210.1 S0 5
Next-Hop routers must be directly reachable
17
Routing table (cont.)Routing table (cont.)
Default Route - a special entry in the routing table:– “Pass all datagrams for unknown networks to
this router”– Represented by the entry for network 0.0.0.0
Routing uses network part of the address!
18
Routing AlgorithmRouting Algorithm
Extract destination IP address from datagram Extract network address from the IP address If destination network equals my network
– Send directly to destination using physical network Else If destination address matches a host-
specific route in the routing table:– Send to the router specified in the routing table
19
Routing Algorithm (cont.)Routing Algorithm (cont.)
Else if destionation network matches a network in the routing table– Send to the router specified in the routing entry
Else If there is a default route in the routing table:– Send to the router specified in the default route entry
Else:– Send a “No route to host” message to the source
20
Populating the Routing TablePopulating the Routing Table
Manually by network administrator: Static Routes– No dynamic changes to these routes will accur
Dynamically by routing protocol– Routing info is exchanged between routers– The routing “metric” is used to find the best
path
21
Static RoutesStatic Routes
Manually configured by network administrator
A
B
22
Static RoutesStatic Routes
Router cannot automatically reroute if path fails
A
B
23
Routing protocolsRouting protocols
Routers use a common protocol to exchange routing information
Best path between networks or subnets is determined by “Routing Metric”
Automatic adaption to topology changes
24
Routing protocolsRouting protocols
64 kbps
64 kbps2 Mbps
2 Mbps
25
Special address conventionsSpecial address conventions
Broadcast Addresses– Directed broadcast: host part all 1’s -
194.181.200.255– Limited broadcast: all 1’s - 255.255.255.255
0 means “This”– host part = 0 - this host– network part = 0 - this network– miss used as a broadcast address
26
Special address conventions Special address conventions (cont.)(cont.)
Loopback Address : 127.0.0.1 – for testing and inter-process communication on
the local machine– should never appear on any network
27
Summary of special address Summary of special address conventionsconventions
all 0s
all 0s host
all 1snet
127 anything (often 1)
all 1s
This host
Limited broadcast (local net)
Host on this net
Directed broadcast for net
Loopback
28
Classess and address formatsClassess and address formats
0 1 2 3 4 8 16 24 31
netid
netid
hostid
hostid
multicast address
reserved for future use
Class A
Class C
Class D
Class E 0
0
0
0
netid hostidClass B 01
1 1
1 1 1
1 1 1 1
29
Classes: How to recognize Classes: How to recognize themthem
Class A: first byte in range 1-126 Class B: first byte in range 128-191 Class C: first byte in range 192-223 Class D: first byte in range 224-239 Class E: first byte in range 240-255
30
Classes: Size and NumberClasses: Size and Number
Class A: 16.777.214 hosts, 128 networks Class B: 65.534 hosts, 16.324 networks Class C: 254 hosts, 2.097.152 networks
31
Problems with ClassesProblems with Classes
Class A usually to big Class C often to small Not enough Class Bs Inefficient utilisation of address space Solution: extending the network part of the
address: Subnetting
32
SubnettingSubnetting
Class B 01
Class B 01
Class B Address: Before Subnetting
Class B Address: After Subnetting
Network
Network Host
Host
Subnet
33
Subnet maskSubnet mask
Subnet mask defines the network part– binary 1 in network bits– binary 0 in hosts bits
Subnet mask must be contiguous!
Network part Host part0 31
1 ..... 1 0 ...... 0
34
Subnetting (cont.)Subnetting (cont.)
Not limited to byte border Subnets “0” and “-1” used to be reserved
– Subnet “0” : this subnet– Subnet “-1”: broadcast
Network administrator decides on the subnet size
Network and subnet numbers used for routing decisions
35
Subnetting and routing Subnetting and routing
one subnet mask per particular class routing considerations
– all subnets of the same class must be contiguous
– or static routes must be used– or routing protocol must carry also subnet
masks
36
Subnetting and routingSubnetting and routing
all subnets of the same class must be contiguous!
C11C12
B
C14C13
C1C1
37
Subnet mask bitsSubnet mask bits128 64 32 16 8 4 2 1
1 0 0 0 0 0 0 0 = 128
1 1 0 0 0 0 0 0 = 192
1 1 1 0 0 0 0 0 = 224
1 1 1 1 0 0 0 0 = 240
1 1 1 1 1 0 0 0 = 248
1 1 1 1 1 1 0 0 = 252
1 1 1 1 1 1 1 0 = 254
1 1 1 1 1 1 1 1 = 255
38
Binary NumbersBinary Numbers
= 128 + 64 + 32 + 2
128 64 32 16 8 4 2 1
Represent 226 decimal in binary:
=
27 62 25 24 23 22 12
1 1 1 0 0 0 1 0
022
2762 25 24 23 22 12 022
226=
39
Subnetting a Class CSubnetting a Class C
split subnet mask # subnets # hosts/subnet total # hosts utilis.
1:7 128 2 252126 99%2:6 192 4 24862 98%3:5 224 8 24030 94%4:4 240 16 14 224 88%5:3 248 32 6 192 76%6:2 252 64 2 128 50%7:1 254 / / / /
40
Variable Length Subnet Variable Length Subnet Masks (VLSM)Masks (VLSM)
Subnets are of different size A means for conserving address space How to do it:
– how big is the biggest subnet?– split the class into such pieces – split (“sub-subnet” ) those peieces further
41
VLSM (cont.)VLSM (cont.)
How to do VLSM0 255
42
VLSM and routingVLSM and routing
Prerequisites:– routing protocol must carry subnet masks– or static routes must be used
43
Classfull Addressing: Classfull Addressing: drawbacksdrawbacks
Classfull Addressing + Subnetting– at least one route per class is advertised in routing
updates Number of networks is doubling faster than once
per year Memory is not growing that fast Only a few routers can keep the current number of
routes Route flapping
44
Classless addressingClassless addressing
Introduced by CIDR - Classless InterDomain Routing
Networks are grouped (aggregated) into blocks Blocks of networks are advertised New way of thinking:
– there are no networks numbers, but just address space prefixes
– there are no subnet masks, just prefix lenghts
45
Classless addresses notationClassless addresses notation
10.181.215.32 /27 10.181.215.32 with mask
255.255.255.224 binary representation of mask:
11111111.11111111.11111111.11100000
46
Classless address notationClassless address notation
Hosts
. . .8163264128256. . .40968192163843276865535. . .
Prefix
. . ./29/28/27/26/25/24. . ./20/19/18/17/16. . .
Classful
. . .
1 C. . .16 C’s32 C’s64 C’s128 C’s1 B. . .
Subnet Mask
. . .255.255.255.248255.255.255.240255.255.255.224255.255.255.192255.255.255.128255.255.255.0. . .255.255.240.0255.255.224.0255.255.192.0255.255.128.0255.255.0.0. . .
47
Classless network Classless network aggregation - Supernettingaggregation - Supernetting
Class C 24-bit prefix 11000000
192 168 64 0
10101000 01000000
Class C next24-bit prefix 11000000
192 168 65 0
10101000 01000001 00000000
Prefix Host part
00000000
Commonprefix: 23 bits 11111111 11111111 1111111 0 00000000
00000000
Classless23-bit prefix 11000000
192 168 64 /23
10101000 0100000 0 00000000
48
Classless network Classless network aggregation (cont.)aggregation (cont.)
Before aggregation– 201.222.191.0/24– 201.222.192.0/24– 201.222.193.0/24
After aggregation– 201.222.191.0/24– 201.222.192.0/23
49
Classless addressing and Classless addressing and routingrouting
Longest match routing Route distr. between two protocols, one is
not supporting classless– use a default route– “explode” supernet info. into individual
network numbers
50
Classes of routing protocolsClasses of routing protocols
The early Arpanet was completelly flat - single “network” model– one routing protocol, all routers had all the routing info– with the growth it become hard to maintaine and
computationally intensive Solution: split the Internet into a set of
Autonomous Systems (AS)– Each Autonomous System is a set of routers and
networks under the same administration
51
Classes of routing protocols Classes of routing protocols (cont.)(cont.)
Special routers, called “Exterior gateways” used to connect ASes
Two classes of routing protocols:– Interior routing protocols (IGP - Interior
Gateway protocols)– Exterior routing protocols (EGP - Exterior
Gateway protocols)
52
Interior Routing Protocols Interior Routing Protocols (IGPs)(IGPs)
Used inside an Autonomous System Designed to handle more redundant links
– Links are cheaper in a local environment => one can afford more redundant links
Designed with a higher bandwidth in mind– Cheaper bandwidth => one can use more
bandwidth for the exchange of routing information
53
Interior Routing Protocols Interior Routing Protocols (cont.)(cont.)
They generally contaion less ingformation than EGPs– IGPs in general (with exeptions) do not have to know
about any other network outside the AS No policy support
– Inside AS, one generally does not want to aplly policy– everyone can use every available link– policies are generally only set on what links should be
preffered
54
Interior Routing Protocols Interior Routing Protocols (cont.)(cont.)
Fairly extensive metric support – Redudancy => one has to distinguish between
redundant links– metrics or “costs” help in the decision proccess
Designed for fast convergence– Because of the redudancy, IGPs are designed to
make quick changes if the network topology changes
55
Exterior Routing Protocols Exterior Routing Protocols (EGPs)(EGPs)
Used to exchange routing information between ASes
Designed with lower bandwidth in mind– long distance links are more expensive => routing
protocol should use less bandwidth for the exchange of routing information
They generally contain a lot of information– EGPs have to know about all external networks
– In the Internet that might be 40.000 networks
56
Exterior Routing Protocols Exterior Routing Protocols (cont.)(cont.)
They assume a less reliable network– most of them are connection oriented for reliable
delivery They are designed to provide policy control
– generally you set routing policy at the border of your routing domain
They do not run in every single router– Only at the border of your AS you have to run an EGP– Internal routers can be less powerfull
57
SummarySummary
We have covered– Internet topology– Routing:
static, dynamic classes of routing protocols
– Addressing classfull
– subnetting– VLSM
classless
58
Where to get more informationWhere to get more information
RFC´s (RFC-1880: Internet Official Protocol Standards)
Books– D.C.Lynch, M.T.Rose: Internet System
Handbook– D.E.Comer: Internetworking with TCP/IP
Mailing lists Usenet News